diff --git "a/iterative__dvc-4166/docstore.json" "b/iterative__dvc-4166/docstore.json" new file mode 100644--- /dev/null +++ "b/iterative__dvc-4166/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/command/base.py_CmdBase_": {"doc_hash": "8ed1bd65517b2b15fbe562055a05b2877a749c13361f9974e352546c76072b39"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/commit.py_add_parser_": {"doc_hash": "f60ad2c4e5eb90746398ef109b1030ebf71182e8e830e4a247296a3792f46a52"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/daemon.py_add_parser_": {"doc_hash": "0ac772a1497929d1c162e4cf7a17e9af70981d68569b11c697107501d6ee2a62"}, "/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": "ab81c5ac0665d327cd33d8bd4f299a0cb5eefe89530a71846db623ab98fcf7d7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/imp.py_add_parser_": {"doc_hash": "d1e9708036d5eee02e03b8e968831f82c9be44499717bffcda83a03c1f431bd3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/repro.py_add_parser_": {"doc_hash": "09c43331db0d8cd1ed6dd845eae90f1d3d32d4def172616a0807c533f4c13e3a"}, "/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": "cf39a58e29e434969e68bdf4e24123bba22bacfc1a79ece4919ff57780d3517c"}, "/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": "60b91df1467478835acf61de0eba579b37494a6cf73c05a22a3440c1e16e84f7"}, "/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": "4438404988c1c1ba2a6a9a758901d369b8bb471df71f9160fd5671df01d17129"}, "/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": "22175052ed01a03d73de567a51e0589471a6f21aa39bdd5f458e0121dcfdb4f5"}, "/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": "f688adf839f2b26a1ae8fd3d7eab613a0121ab423169625c3dce84b878a87eee"}, "/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": "9bf4862bdd1edcf3d6a1cb46e9aa1e7bef056ca06487be8d2a586d3dffb642fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_draw_": {"doc_hash": "ebae308441dd36ebaec5b98fd9971178db187f52e240261452c326ed0736c279"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/gs.py__": {"doc_hash": "e89569b7090f0a4716b0bd17198e2c359c503a4278a86fc36f41ad00ccdc2391"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/hdfs.py__": {"doc_hash": "7d5e26ff982cd671f6978c0d262dc30a135c293b56408b4d65acdc493a2891fa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/local.py__": {"doc_hash": "9a740ea3538cb8701c9018f14df89d5ad26fafd73ea6fbe6c0533d60e191415a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/s3.py__": {"doc_hash": "374d44246032306f6be91952affefc3946657653075d8efd03a2add5de98bd99"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/ssh.py__": {"doc_hash": "1ea987e9482ee8130aef4de338328bdd7cee31a3d426535edaed2900bbbe2339"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/gs.py__": {"doc_hash": "deb520f228bc20a55daf59245b82dfe4421023989aa56f934ae15154eaff310b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/prompt.py__Manages_user_prompts__": {"doc_hash": "46618feccaac0eef4d711d8f6339592624e2bb8c344dc6a171010b1982e43e55"}, "/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": "576329924924a01e88c9c9cefc77e03c520d2c44203f34c1d9a3d722f48c2b6c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/destroy.py__": {"doc_hash": "d350671272d316b9d159032fe14d1cc784414d03d63cda75756dd008c7f29079"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/gc.py_gc_": {"doc_hash": "e04cb477438f451bfaeb2b756200a79e7f972eb3119f979f4886c163561da978"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/init.py_init_": {"doc_hash": "dd72ccf695679ac59b5c4a510f6021ac6a3cb6f570d37154684b1a542c6ef76f"}, "/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/move.py_os_": {"doc_hash": "f8ad3ee83f3037718fd3bbbd8b91942ee904cbe040268b392afff69527a86fd9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/remove.py__": {"doc_hash": "68c6a799689ad219f3f3878c0fb53c140763365a696b159dd38fed20f080db41"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/reproduce.py__reproduce_stages_": {"doc_hash": "70fb9c701752a0d1b1ac6f863b6930d6b3a0b0b5e5e5399d14201ef11f603fe5"}, "/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": "12463bedf91506d4a2f6830981f7e9be48dd158cbce4085ebe7a1705e14b3e88"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/status.py_status_": {"doc_hash": "b88d2eae221f151bc0e15f7c10bec57be70c9ce00dc2b7f0e5632b78e7df7460"}, "/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": "1ad19584bfacdf52a5e397c16983e87963989f1d5cc172cc2c0f9df5bcc2eb39"}, "/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": "6218d57311b7b0780f52bc31c279681b49a2155a7112a2479c90c50ebc19e700"}, "/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": "ce81e1a2c0ea1b936047cab99d2de2a0bc2cdfe156f274eb5f163f1432448cfc"}, "/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": "2e96e662fe6b0843f08dfd0e3054f4158290d6f888c2d6bc2adcf7ce246329a6"}, "/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": "16ddc9b22db5817b211c4d66031fc111a43bc58db4b186bdc58f6602d1171c03"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/hooks/hook-google.cloud.storage.py__": {"doc_hash": "b427a0e8614eb6ed821f5dacac6653d8219f7976c3d2d46ec882de3f0f48661d"}, "/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": "279dbc5d002def4b2f5f488c0d9186caabd9e99b333544b1aa0ca7b3c7d188cc"}, "/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/utils/httpd.py_StaticFileServer_": {"doc_hash": "566e615f9d414ba49b3215a0243ffb8a24160693e164d0d1f3cb2ef143c00041"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/add.py_add_parser_": {"doc_hash": "cf3caacafbeabe0c103b33deea67687bcdff03e8a155613d800e6e0bf958ccf2"}, "/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/repo/metrics/show.py_show_": {"doc_hash": "b66e178a43a7dcc7c6071ccb1a91a7f19094664a1c640cb6b7b6824bddce9b8e"}, "/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/scm/base.py_Base_": {"doc_hash": "a7a6e249619f0b4b1157990e96644341e430656b886ea7ce126d9780ed16932a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_gs.py__": {"doc_hash": "ce1f1913d37589e356ec555584421987e12f0029be344c22c55d41a42544f8b2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_hdfs.py__": {"doc_hash": "7c34f1f0c88f664d4995ab26d703013edca2285794ef0192706f1229758aaf75"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_http.py__": {"doc_hash": "12a7f2c7d1a75681f5154f5a61e978c7a8887fcd33d048a96fe6743b02e08180"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_local.py_mock_": {"doc_hash": "bc4d1629b6c405ae6b86b0a6b7b8a7e82189e99d01de054886be8fd813dc4d5f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_s3.py__": {"doc_hash": "137f5657e42340c14425b8c159bd19db5136a8f90c8f11ed8801ae8b6a2b9c2b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_ssh.py__": {"doc_hash": "9bce7e6f784061d1267d08ed5127bd5da80c15d7b3999dd4e7509922e52aa6a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_gs.py__": {"doc_hash": "1a973ddea889c57aae51b9c46290a3f017ccf3e977e6ccbbc64c39ea55df038b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_hdfs.py__": {"doc_hash": "c2a8f5604ef91275ec2158be71c4dd9f6013a124c1f697befdf164c56bbe4860"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_local.py_TestGetFilesNumber_": {"doc_hash": "6869832d1e5b93b9f6eda46c17fd0dabd77af5814977eac4ebd9cff265cfdee1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_s3.py__": {"doc_hash": "c12b2fad1793f73babc133fdba13f5be866eaaa6f24a9ba2c94d37baa396e77e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_ssh.py__": {"doc_hash": "964ed461919c03a05b0b1897fe2d394ea3a65fbe1b3b340bf3078f33149542a1"}, "/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": "c11f3ba1493e3219ea074c2b1ccbbe0d930984c6767ebddaad0cfa7098f670f0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/daemon.py__spawn_": {"doc_hash": "fbb03ac8918475b6607fd5d246d3ec2b396da9df737623f6357f1e4ab52cdf3e"}, "/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": "aa1d1651e5cc6b39a94e0d600adcae11edf9842427e41c1d8c3353963b968239"}, "/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": "638f4d68c708f488a9bcd8b19a74fbbbeb673fb74e3651c5ec44530e0a18698c"}, "/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": "78becfdad2728ed2cd62a0ab70b03ba8fbc2c47147ddd48745e4909497ac4fd4"}, "/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": "b090fd8a093a8d886ec3856d601345dd16c093a8806fe4b7d9b01e14832b3174"}, "/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": "0a32402a9fcbe1b69a527ee278d8f70f6275f6626dd7330085c41585847188bc"}, "/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": "af178e407a6513cfce2494889da72bd92e79b78f8c0529f60fa4642899fd2e57"}, "/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": "3083fc6096c4e106d65bd282746cf2a778feb59e12b97e66aac1981bec73faac"}, "/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_TestAddLocalRemoteFile_TestAddLocalRemoteFile.test.None_4": {"doc_hash": "6c32a365d98f575f3332ea3854b95bec9c97bb90e2138c3d21bda1d91c952083"}, "/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": "c7fbd7e61a2d3b47697ff29a4e5172e28cae041042990f81ef89996d810b6508"}, "/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": "4ac395ffbaa3636e70bd8151310b97c644f5c5e456dc6e20c2efb0b1049894ae"}, "/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": "342868a15a1da3bd07fc23db84c1a201bf4d01096353fa2cc7d18869a166a501"}, "/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": "ad204de17f0b68895d263a1fc1b7a3bea7de653f251e43e92489383f5ef2af9e"}, "/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": "f5343f5c5c4baf664ea8bb69e68afab86bb9f426c1ff9be1437f03ae50f94ac2"}, "/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": "ff4435833a1c88f3e019af414933e708c24c22d9a118152959bd409da91fa99d"}, "/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": "7da01784768c6a9112459918dd2be982d3f94478141cf7e407fc4bd9f406dd73"}, "/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": "96dbd32d78c9c799fc9d132c81fa25a1ee349096153efb8e2a54acfc925c8f6c"}, "/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": "86b061f1d5f7916a2715db26bc119d2c4af6e2e473fc7b2a0668822f7fa63110"}, "/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": "515bff44f6070363ddf523081c1615a0512a11b260b58f4a98051154f946424f"}, "/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": "079d7fbd7a8bc553042183dafe9d920952784dcbc969197a61b9bd8980e11580"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cli.py_TestPull_": {"doc_hash": "a973fb1aa05de2dbe927efebdf749a8549de136c15c4c0b44dcfec3f1fec76a2"}, "/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": "720da6a6eb4d4f7950d332bd4cfeb1deacaf8fcf2ce0a902412cefd8b125f042"}, "/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": "83d5c07654959d1f2afe16b11313c009b3ddbb922da98f018fe26dde77ce5f6e"}, "/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": "37bb56393f2becc41263f34850243bec8601f16c5dedaeac5961a1af47537da3"}, "/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": "dcb8c81b69ac41332996ac40de4494ac0c9df2ce77cc5d52ad88e736ddb41386"}, "/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": "33f5da791ce8059bbf6166166a8b9ae6d2240975fc012f9c5fca2e8bc1a591f3"}, "/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": "2eb53aa12f6df5fc8b2604557719656f12195849a358b32bd132e7e41817b115"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_output.py_pytest_": {"doc_hash": "a09b991ace10dc45a578839835b16049016e04a7b4b6b8b7eccc0fa0873b593f"}, "/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_repro.py_TestRepro_TestReproFail.test.self_assertNotEqual_ret_": {"doc_hash": "a8b4248d3015d34eac453a2ae97e1418f7d5fcfc585b98a5b253688da13513c6"}, "/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": "97014bdc0cfba441296aeabc2be2080daac776f2472b3b77653b7355a7110104"}, "/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": "965b1fdcbbea8c29ec45d7c73cba4cedc7790223c72119e9b65b5bb603b14163"}, "/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": "37ae210a601e8b0ac06bd69c77091a79bbeaea3d3dbeac7938259625695db585"}, "/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": "8ae1fda27f6cbe7fb52f0ac675429cc00d9f46a98da17d9ab04c504966c9bdc3"}, "/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": "7f2077b7c58d64edd366c9360bb13286998b9d69d02eb1a9eef1eea79269f6d5"}, "/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": "281904c4efc6b2d171673cdaf2c633f724cd2f2526f9a4e4bd29b81075407cbb"}, "/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": "87ec2486ba5036ee7e416f3da7827d559dadcada0605e9cef38a2480c6cb38f0"}, "/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": "93bca4d37d682bc4aaa00d52c919466e8f338dbc64d35fa2bd189b9914e93209"}, "/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": "d9d9354069a3bcbef6285e31c44e7917a99087dbe39489741a797d3f90d2532d"}, "/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": "d90d634c5b4cf80cf3e2303e4ae52ec47b97d4493f2fd3b7b87832fce89b8915"}, "/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": "42659dd5da3254168517b4efa71d94adf6a8bea4bd474c18380e941e8fc84764"}, "/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": "cb14784c40a07775197f25ed5cdd39a9deff5f2c26d0b2d76ecdf2a296b33a4b"}, "/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": "79e89955ea71f104a2cda5d9cf15f124721841c628fb8a5d81be979b0d279ba8"}, "/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": "8f90b1ed80f832b19b837111a0f1d2fabdda6cceb0ad65b0e1b2e3185769909c"}, "/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": "e70cdedbbae56b980e9c564532fdfb2f9b153301ad0e7cf9b559f17c5260ebfe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_s3.py__upload_multipart_": {"doc_hash": "cd8727ae7f4f2b5e93e1ebb70e8395dba1a3d49dd0aa914387e0cdaf54d4c83b"}, "/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": "09d4aceec7d841cab18abfcd1b88e400de57c0f4f6d4fdd2d79fc3cdcfc5bc46"}, "/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": "f9c5099c31b6b3536440af8e33ad60e05259a379f7619807344da35761dd2ee9"}, "/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_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_unprotect.py_os_": {"doc_hash": "0d36ab4df0a011e350721e9d1c0c666383b4528249580acfdfc3cc605099c5bb"}, "/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/dvc/dependency/https.py__": {"doc_hash": "cde2f932772c51ceca28b9bd2eb6681bf4033819a279e7c65c494a278c281a69"}, "/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": "87e671af9f2759f8791159bc2554bbba2980aca294d477111ceb5ff352003631"}, "/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": "9803e85f12b6ac1e3ca52da33c1115d31cdc69058ec5e06874f4a558b5b4be0d"}, "/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_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": "533f8010ef6ee1dd714217bfee6d56082545c55cb0befdb153d619703c351c27"}, "/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": "29964fc39ba91faf8d3220a7569648d723466f01a97613c6665a7cd6d29d45db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/hdfs.py__": {"doc_hash": "a1a797e3fa6734030bbbf3a23098caef304858bd4623a9cf3105ac618c1b271f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/s3.py__": {"doc_hash": "ac959ecf9a26e15215df6a83d85807d4fd75d703907a329a360d05a693b40b62"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/ssh.py__": {"doc_hash": "368672c5fbf0acebf00e3a5592a3b06f709778faf892bbba1da77c8104849d37"}, "/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.ignore_remove_Git.add.try_.except_AssertionError_.logger_exception_msg_": {"doc_hash": "89d6627aab6a27068246618a02f9573990ea05fd9df3514a0613f3775c39dd58"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/setup.py_tests_requirements_": {"doc_hash": "0988cc079f84d3c78911bd1e349e42e20ba5168014fd8587401c9e7b3c267ecc"}, "/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": "4ea6f5e950ee7f84fe8d8adc9457f8b4e8041dead59d555ac77bc4268a3c2bd8"}, "/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/test_progress.py_logging_": {"doc_hash": "dfd7ccd002b2caf79cecd52eed9c9cdca333e44c345e3983524d97219f459a37"}, "/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": "b02aaca1d6117f5cf574bbb1c9b19e80a4602eea9658b2e79a5f492c3ed0a801"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/get.py_add_parser_": {"doc_hash": "da16780d2d1dc5bd50409a165d46b8fda6c7232af4b883936e79e4463627c017"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/imp_url.py_add_parser_": {"doc_hash": "c5cc31268962c6ae0a67c5cc5cb3671ba86ab6c65854c66d6edbdccf70e7e9fe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/get_url.py__": {"doc_hash": "a26d2fb1a630436669ee3bda3d36dd9b65f6cd6a0bd139622b20874acb532573"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/imp.py__": {"doc_hash": "4f2e7b6159f6d82ebe56398e171e00090ac9d82ff298ba451b4adeb6c96c6667"}, "/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": "a682502a9c8f040f291648e1b470572b1652138b0ef5e40f3a8075c00ab6937c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/__init__.py_os_": {"doc_hash": "ae7e78265786c71e0abb358f600de649aceb751dd5e5b8656d13ba1f500cb86e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py_TestGitSubmoduleFixture_": {"doc_hash": "d6518a1f8902e69f21926c60017ed31582e78965fff8b614b6ad57feb78fb830"}, "/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": "0706448f6c8c0c821d1704b10466db717f555cd3be01e345c415870cccf87ffb"}, "/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": "54ff8f23dd96da6062f10c3f0021cabbe53584f7766fe3f1fafb46f6f065e5a6"}, "/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": "a67777e8305aa42fc9dd3359e97c651d807cfdc67602fd1566fcd4b02bebc1fd"}, "/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": "6e3c41095bec6f3d044de21e1ce6a2fdd48c4fae5b07e570644884768797562d"}, "/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": "3633c15f515ca6dd9928797959849f12ac2c2d356baade217f10ebd2143c6d6e"}, "/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": "3f3065e111c58542680b7dd93d4acbfacd3b6c08ff615a913cf1585ab10bd5ef"}, "/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": "8d8b1f93e37f77b4c369d7fb1df97d8cc614689ddca0fcbf14d382f0d7d128c7"}, "/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": "4292f808a0b30320a975e06bd9d796c44ecdd516a0711470251f9bf8d4af8a82"}, "/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": "d251c4d8330da233c177d5a29f4fe8c5691fb95037d4962860479586a506c61f"}, "/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": "3212801e05b06ac0863adc9bdb19da2d655ca3a21ed7be40f6246f63e8352777"}, "/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": "a6d75fe930971cfc628b2d986217c6168eb2a137cde88cf4d5a4b4b343670276"}, "/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": "bc61a6e28101d3307b7c777f7205c49e78f404a935fb9cce90aa6e4491c9cd20"}, "/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": "428db611afb88055082e8740dfacb71de6ea7507cbfe14421ea8d417ec410b70"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cache.py_NamedCache_": {"doc_hash": "ebc86fbb3327e130e592325adaefc18537c51aecf3d9039044d12ccff173657e"}, "/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": "ee3df9433cff2729c95d034f01d86d6fea53c591b5bb5924a7e76187edb51abd"}, "/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": "bba1b6f4e2e11ffd728465bb760a428a9e565e513bb073fc53b69e44bd530d00"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/cache.py_argparse_": {"doc_hash": "ed259e07ce121d1b0677d4b27e5396265523c638cf62d5bdb07a5471f0b2a5cd"}, "/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": "2502f70d0c3844a6e4c90fb660a60a134634bbe082ba4957c8ea27aab4dcc4a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/checkout.py_add_parser_": {"doc_hash": "d589a7f3835577d9e4e431e0d5617a766207f1e995daaf448acabbb37d455569"}, "/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": "570ecd67a0b0f2a3e857ce222111c5afc4d6df76df2696bff17d09f6ed1fdffd"}, "/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": "053306481c7589661dbcd030aceedb7f2f62eb4d57d366a1029ba8d3273f436f"}, "/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": "25d33bd01d231c5008995dd8702bc396d1aa9a6e0a7bcda522665d7993a71d84"}, "/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": "729fd207f6230f22d8fd4d174c77763334c49ccf9c4031da79dab7768a151229"}, "/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": "2ec4b415070fa67c19d745507a7e1dc9a6f3f855dd5c0a7cf09273f24556e853"}, "/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": "5853cf53364b6dde6827b34f8479b19ca49be5d8ad3c401bb58c569ea5402113"}, "/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": "552fdb6fed8050e1bac6f9789d57aa04fee73f7d03575bfc69d7aad5c385416e"}, "/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": "60d390de9a725b0aba45b7e994c69fd6ac7d74dbdc0e32418096a99c30c9bc97"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/get_url.py_argparse_": {"doc_hash": "086cff16193d2cc73ac74f101015b7ce1de3a266041fd0c3f0d67c7019c65561"}, "/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": "ff59ce89f66c042405f43dffb60102608377482608e592903fe1bb4b2accbe8c"}, "/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": "3ef709c16c316f21100f10ca1eabf69928ba56de27b535cb2cf74a1a054b781d"}, "/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": "98e1ac694b19afc24bc689f74dd5a2d0f0e5e15ebb4b629ce5df4c055ed18f3c"}, "/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": "b46ac0a7add15a1f75537ac7464220e9b1ff698abeec9aff373851c94b1afd3e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/install.py_argparse_": {"doc_hash": "8c144b1cf4aea2fd4bce9d4da91ede7a7dab82124d1f86f99354b245d30dbc62"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/ls/__init__.py_add_parser_": {"doc_hash": "6d59c4a8570c2871d75a2966c3f14e5af1e919e09b1ebc63dffe2f8dd561b261"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/ls/ls_colors.py_os_": {"doc_hash": "787ae6fa1d5a787acc3000dc4c8f4a470d2b9051c1cd3a77e808c6a55dc3f653"}, "/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": "7ee095689d32dfa676ab5e26a981b6cbec3b9ed069a91a538bd3bc239550e824"}, "/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": "94b8b7440e144186dcfa1470711348d1a66db56b8c51d318f39851b8abbafea4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/move.py_argparse_": {"doc_hash": "abff7174dfd7ffb2a26940af657e2ca96d90cdf550a712971d46923c54c7e8c8"}, "/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": "ee8d11efacc1d4e23555d5341dca340ca0e6d8d366b5a9f8fadb603ce52d8be8"}, "/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": "1868ce224247f0d4b65b2546f9ba92883e022c4b27dcfffa28a2f05486621741"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/root.py_argparse_": {"doc_hash": "e1ccd8154580a568b83bc98916050ae5300218d9bac86eaa25003a08c144b390"}, "/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": "a306457888fb93de2a29f40d275b9a1056966c1c81c498324640ccf48acd15fa"}, "/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": "8070964781c1700be17edfb08f39b94f58919c1f6ebc39fa7321c632b540d9d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/status.py_CmdDataStatus.run_": {"doc_hash": "9f1b62fa876fd5a1741b1d26ceb0bb643446a07e1e3755e1b852176a9cfee664"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/unprotect.py_argparse_": {"doc_hash": "d7de3494c94bfdd3f6b18e9e159051a49c659778be4a08dca6d0eddec710757f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/update.py_argparse_": {"doc_hash": "e936eaaad8e4e9332a629e5a50d06bb1a8665cc61f543174669e0bf1e75dd267"}, "/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": "e71abfeddef3a348de249edf8f55f69a58b3d96bbd1c50fd861931714871fcae"}, "/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": "2be734b44cf32c4eee93e57b7dd27e6869a33ac8eb82bd2533560bedff146853"}, "/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": "467e1bfdd82c21747481706ea32191b976cd6731ac1ce9d21bbb754093564d35"}, "/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/config.py__DVC_config_objects__NoRemoteError.pass": {"doc_hash": "a0484bf9292d30cf2c6290c2e4ed9601be99e9d89bb2233119740ac243302a41"}, "/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": "71d658f401726e003172f808ed4514a4c312d6139c90b3a212f88c22885a17b9"}, "/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": "5864f3e40cf089c3f897e75d3fd7ac29cbb6ff9ebb8e71b627019ff701b5d770"}, "/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": "8457c1aa06590895d6d2a31cf76c6c73eb62054d6184cb7655d8349fae0f7127"}, "/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": "ad6aab83708cdacc5ac6feeb9a7f7d7e4827036793e12c9bc48cbfa72fdfcd5a"}, "/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": "d11e43f30489497463f8b1a32d35d887a6ba0f6bcbb3ac8bbc286281f04809e8"}, "/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": "b330df642e8071339d8dd323dbb7fec9b550273d0b786a3ab832c303dcabdcb6"}, "/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": "e297d8b5bdc2bb01d58d430a6725f9ad59f412200fabb0eec23f6bdc585df6d9"}, "/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": "38903a8ebc46919d9feb599985c01a0231fd6112c0720a04f151967cc30ac928"}, "/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": "834b284d8f205ece058dbe3c81bd89519fc352eeedc6960338efaedb29a7cd10"}, "/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": "1bc35a4b0f6da72c54ab796b8188f4709c510f1a4f6e0f94915e8999903e64df"}, "/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_RemoteCacheRequiredError_": {"doc_hash": "49a2161ad285687a91b48aaccf67bfc7f08cb029408217caf1362b8f581ef2bb"}, "/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": "15d99ce5eab4992c542eb107cb3265cc61610c8499e4633d6aa8af93aad7709d"}, "/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": "a637be4f15f3d3acb756e364052cc23361e766f3956b0e97cdad9795a79043ce"}, "/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": "a59b10fa9edd23d9ef6fc53d9b41e8ca3ca5785b4afafa32829f0e87124e2baa"}, "/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": "bc3b4f833d9101d7cf3dda003bbf95ae464e54a00484d11ec98b4a3cfa43caa8"}, "/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": "a0c8dfb26d012b5415789d7934e6f68283057fbfc12c7535b80868b93d125346"}, "/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/istextfile.py__Use_heuristics_to_gues_": {"doc_hash": "feb0ca572bec20cebebfacbb11d7feab62bd0e852955a24df14abd126fd44d8a"}, "/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": "045fb345287fb5b453cd52957fb1045dd0bc7c16755460557af631fa5520b9c2"}, "/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": "ad7f147f34043617cfeeae3006ea6e3ae5571a4864d0d0e5c3c49475ee421bef"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/lock.py_HardlinkLock_": {"doc_hash": "dc0100c7f4b8a150ceb88e1c783d98f02c8d732f6776b0b6b8a5b72d3f9686dd"}, "/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/main.py__Main_entry_point_for_d_logger.logging_getLogger_dvc_": {"doc_hash": "77f6c75c7369678820927d932adf7524e565484e2cb857bc4effcfab40074cfa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/main.py_main_": {"doc_hash": "613bde8f99d904c9a7f0d827ff4157c8241f5929bbd952ff61db230b5ed514ab"}, "/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": "56647d1592917ba48a6badfda38d24394f371196b2384545e9e49eb3b7874bfe"}, "/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": "08bdc3a26d5ad7faaed9e25268a8ad18f3ff02112445b21391fe7ead0a814a91"}, "/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": "5afbd9d569363c5f446f8373504110044be7118b27ef76f3f23e0919e15e4ba2"}, "/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": "28b9b80f2013f2591614e422431cdac1a49a98814bbeeafb4c41e2508b2969e6"}, "/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": "d915512ef912c350704bd9eba697a28c259213e7c2a8eca61bb03b9b71ec82d3"}, "/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": "8d46128c5c5c8dd09fa5bc10a1a5c75402badd48f5acb9ad0e37f127c9ad2db9"}, "/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/repo/__init__.py_Repo.find_root_Repo.find_root.raise_NotDvcRepoError_mes": {"doc_hash": "b3af27e18ec4043a8f8c364bee4aa7cd9b60c5a52d21d0cfd67812ecc8a8529b"}, "/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": "8b94aabb2f9b4f8c6a0e3fda90e54440008da8eb6651d76851535be02a414a97"}, "/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": "cdd3efa0c7b2c14a385e996f3bd3f9877797ad394f6ff401d152921fa8809b14"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.close_": {"doc_hash": "0f86dbb628f3f1dde547ca4ac924faf2280681146cb4660f4e7d40692825bdbf"}, "/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": "02d4c2e6c192dc7fe2ecbb3edda81598bdd7e827338b3c18d1630ba3a07f514c"}, "/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": "5cd53a0e7ba65254e8efff453d36b1cb8e7b43b1ffc9de5a2fdc1952b216449b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/add.py__create_stages_": {"doc_hash": "ab075c65872599c6b2d7b6bfdcd1fadb5e72f5f599d4e5e381d656137633d994"}, "/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": "e8435c64e17c8ea94e5cb945732708b9f1d83562414c43bd02efa9a4a1b10e82"}, "/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": "1321a8835c2edb29b45c1d387165eb4fe0bdaf3265ece51df13c54dcfb779ae9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/checkout.py__checkout_": {"doc_hash": "eeceda05670c256d521bf3f2d840fc198fff9a681722328f18a1f2165967b420"}, "/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": "6187f2307f6c9b00c3d5a17953a1c43533ec629820cd4409406b769317f1b896"}, "/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": "cce455f662ab9313106f9b2df5924c8518c8bce8f2ee6527515c523979d84ed0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/get.py_logging_": {"doc_hash": "1daee4481ea7f92393fb2dc069ca2121c1837a4bccf584c294cd18b0932c9707"}, "/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": "7d9fcf487be12bb1bbffed7191e2b7704e6ddf3a1b5dd8bae137d94508c423f6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/pull.py_logging_": {"doc_hash": "67bdb41bb4f9413965c3790ec0427fe1d80cd31e62935c089add1a876131853e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/push.py_locked_": {"doc_hash": "c45ec4056c5673375349327bebed3d73cbf88d6fb3368b15cae361d2e8fafb5e"}, "/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": "85cf7a1e3edc9cd46b6131ed0ffbe1839acbd641c6b0a5f5808e031972c91e2d"}, "/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": "f689e28b39c113634daef5bb7201fc3d3792207d34bbc0367e39c6ff31966c20"}, "/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": "64f8e9e9495c774695a8b4265e115188c6700a3929762d30b6f871824fd7d882"}, "/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": "0ea12ff0d00b0128b126cc0893c34d3abdec27f208f6bfe96abd309634de1a58"}, "/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": "275209fad3b9c610162e116637d402c97315f38d74fabc3faf5477dcfee910d6"}, "/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": "f42ae7481fb030c18dcab6b57a2a1e8fe9b8a946024a6f5a78248bb76c447a1b"}, "/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": "820763673f6cbcf0626b9c5e7444dd3961026074e7f3568b9093e871c8ee2370"}, "/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": "8f4c62e8c76405d10c5a691037a14910efcb9f0ccca3e011b926275bb229f1f3"}, "/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.has_rev_": {"doc_hash": "62021f27620144a6bf18436855de761a1badbc4d2ea2e1ff166cc2f64124a7cd"}, "/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": "99ebbe56aae815611e60cc933c19dc557c1bc7194041d9c0c68f4e9c1caeded9"}, "/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": "1018478b23514229de766d8e33c815a24d50d2e463f7d17f3c3e6bcc517a413a"}, "/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": "a2cc2937f4105af3a2dc9b28222b0183fbe7dca205759814650ab234185db6aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System.is_symlink_": {"doc_hash": "519e4df767b924121c08868c9997cbade4da7f50d93787685e4e30311d9bbf44"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater._get_update_instructions_": {"doc_hash": "dc2e126836c9bb2a45477615de9163aacfe918c024faf44351423e251bc8e71a"}, "/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": "ef1bae13c73041265bab696687ddd424adbdaa4410d912e451c6273bed106d92"}, "/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": "d165747159ed6984ffcb90980f9a64b44b2ec873b5b309bb2fca0df145eef3b3"}, "/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": "75c23ea2696215d6d9152e5f00a5e242c580834681bb9a03ae21e4fdcdd3599e"}, "/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": "db105915c39bcacd13504392e4a40d680b044d28f7d7953a30f86e3b46a8acc0"}, "/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": "6cd33aff6f53c22f02487c8a91c4e50b4aaa0562e54e24ecde3d42834df2011e"}, "/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": "a4096833f4ad2beededb3cd57b0926821851b9623fa52c44f803b1bceda11f83"}, "/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": "e4e2c4fd314bcae876054426b6c51296cf07660f9ce52dd4b174d7f04f75d13b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/fs.py_copyfile_": {"doc_hash": "80a6639d65776e94e324943c8fa3f074094ef1496e27d85ff365657525c231ad"}, "/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": "b03c68780aac823b24452b65f373b7ec72d600b374fd072db6c9b1d7d18d810e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/pkg.py__": {"doc_hash": "88d036370701a87a8bff1b19982232274b85599412eb50cb4351c0fc1ae3383e"}, "/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": "f62ed4b7039c36ec3f827e901c0ee07c47c4a3284fe5f7ca13f43866ceca4aa1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/fastentrypoints.py_main_": {"doc_hash": "d4104e3141d24a4e1a0482c42b30582b788312a3e5d55de5d921e6d230d5b7b4"}, "/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": "b89bcf724a221cadc8e356f8b183a5872bd28b1727ea7e5f1184133c13958db0"}, "/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": "ea6f0e24ef5cd66b98927c88fe0ebdbf79cb0983ff454a96751480b81be64a8d"}, "/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": "3be3b3fcec44f82c8b134ba3de9b6f6bb0215792ce2a9fbf0ec8560b523a6087"}, "/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": "3b9cec44d1a3e0414ee0010c2f4f1bcad6a2e833260ba16ebb61e389fd6d7090"}, "/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": "532eaf981aaedee8383e36787291e16e46e228f028662acfa6173d5e1e0c43cc"}, "/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": "d1fd7f0cd347758ed7b2220030cca681c574f507ca1bd2990df82a6264bb1320"}, "/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": "87ac8e2ae5c5ff27bc8a76c936dd501001c6a9f7a31c86f56aeab7aac9d61a15"}, "/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": "fef925fa8f9b08ed68a4390afac17a4b65fb18e61c8940c05a0631ac48d1ba9c"}, "/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": "2aa26a8c75f662aa11370376ca1bf949dc09b667010920232448a397399832c3"}, "/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": "863e4b039f03c8d9ad397965b57ca4d94e88211ecf4253170bce9ee5a80d158b"}, "/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": "6d329d83c9119e37a9770974b33ff3353f848254c45ccfb4c0256d928ff77d97"}, "/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_api.py_os_test_get_url.assert_api_get_url_foo_": {"doc_hash": "c1fd464de339588968af236cbbe1a2fee8eddb18f07ccaa8a1d73a2da6b4e2c2"}, "/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": "b5cab5d9cfd7810ca82c8b9b8849a73ad097523916625e6c2be28ff579113d02"}, "/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": "c5d591c57dceb0b4fe0f9ad1b1bb746bbf5818c3ada53c7d80c55d36dd4535a7"}, "/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": "0aae49e0b9807ba2a7e84160e2da6beeb00a2f82b4514367eb9843e0dc973ee2"}, "/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": "fdb2ab083c02c76760a1e7d5f3c3d64a7ad198d2ed2fdf6fe1f05bf8f57bf6fc"}, "/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": "101d4f6deb76ce68e22f167562775121575238afa1d74f44827e646690a3aa21"}, "/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": "6608ca500ac689faaa4e417f751cd6d5356e293b0ff240a82aee8f5210176c94"}, "/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": "ac4ee39e4e0ac7ec2706ba9d928213558d179c4acf7a26c72d8132f6c93206b1"}, "/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_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_dependency.py_copy_": {"doc_hash": "a97ed2af1f97ae690e9999c7563b28ec8d367226f934bb144f9ee4a0947ef0a6"}, "/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": "7de70ad8cb792fc62ba7e2bad1f2bd71b5cfb6c50453911ea933f5429824757a"}, "/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": "6d066faea7ff500203be6133bf465acf3d9541604c8e4a02c9fd606796bc34e5"}, "/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": "97e9dc8a589549a9235717cbcae06da44a80a455b55707d4b07dc661fe26cd83"}, "/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": "eb78b2514a92cc128d694c8f1f3863867924cdbc0185f4b693698e1a04135fdc"}, "/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": "9420cad99a33b4ea2ac8ad781601c1cc6ee7589f0ecda8a5f8369ce6c2db5683"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_fs.py_os_": {"doc_hash": "653e94af668561b1d5d38c3dc3039b0181e16d80555fdff269800b4630f0cd97"}, "/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": "825914ad2e21cc379c0d408ecc5abc48dd1d05a7e57650bc9d193d8bdcb5a2dc"}, "/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": "e5b1dbdde7c1d3c3eb5bfb1bff8cf114e40c6ceb77f1581a174d4d1643602ae4"}, "/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_get.py_test_cache_type_is_properly_overridden_test_cache_type_is_properly_overridden.assert_tmp_dir_file_i": {"doc_hash": "9828d7920d7d929bf779d6800cebc62667b9ffd2e55ea60130fca8f8e3c16523"}, "/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": "461b6ab109f4760ae583b8f06fbd5ee45027fd640e0d491cd8654a88d515fed6"}, "/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": "b0e3aa853e34ff93caba927b6c5d0bde132cae74114311420fe29b89bf7b3c0a"}, "/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": "3784cbbb6ba06c34d5231c2a2a31899c71dd7e596d1cfcdd29e15521ac6a88de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get_url.py_pytest_": {"doc_hash": "20c4236721570b0d097c4c709ace874c9ad12d028ebc1601c5455c967bcf195a"}, "/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_ignore_collecting_dvcignores_test_ignore_collecting_dvcignores.assert_any_": {"doc_hash": "09af40b756f51f9b168d6227d7ebf6a418926e69068714cd7ac01e6bdf226803"}, "/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_import.py_filecmp_test_import.assert_stage_deps_0_def_": {"doc_hash": "94a365205ede95d8de9fbdc0fa72d002d44c4a4b4bb45efe41e423ba681b8169"}, "/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": "5b02a72437d6485568f800680f92a934224ad0f6e45a4082cf6f1423bd20db37"}, "/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": "0140599789ed6390d5890a8c6da35b4eb468108b78acb31d920ba666e33a919c"}, "/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": "3eee26e38d261ec992e6d127256ed896fa7923a424bf82bff2623b2aab763f1c"}, "/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": "5dfcc31e6db7c2b326dfdefd0daea8991ff4ca61f26cdec67efb826be0ac26ba"}, "/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": "1100f49ff2fa3aedde45c9621725ce9d7a6d3b268d0cf4f62920d846367f3aac"}, "/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": "c12b122c8be93eebe3327e4317251aac5e082f13520df8fda5a57cd9a641d8bf"}, "/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": "a9af771710fba64a390a92dda48ae670e97d540c7c00fa098cd24c146a9049fa"}, "/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": "4fa641231cbbd0689265b8ea27b6db0b9ddb7daabed92576b961678da635fb11"}, "/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": "6b2d8cf4e6dfb842e891afff29fc0aeac035a9e5b96a97f7db49ef57618dcef6"}, "/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": "cb8e05040b855abdfd69c913761b9d74bdbdf1f3e8b87579ab2a1ad1a68d9611"}, "/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": "05740c07e3fe17c4dd0e3c27b08a8563b024a9b584bc3b7637574c75e2cfc46f"}, "/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": "642b4b205113edcc1f5fa8b3f952b41054f1e1210ad75af93442583fff98df2e"}, "/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": "d5a5ca123d0b75521ce92f860e0b51c0dd35b53b6a9dbf6a36d9851b5488c23f"}, "/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_init.py_logging_test_allow_init_dvc_subdir.assert_repo_scm_root_dir_": {"doc_hash": "e2ea3fa46f15eada0a6582f8e22069ced0350989dc98e2239e895c0fdf98c4a0"}, "/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": "6f1f16e468aa05188ff7a17e3907cbfbddab9e39ae903f2b0cfaa42fcf635fed"}, "/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": "c116aa3b4838a60d3b465bcfb44decea2c301f61c6ec0ef78c7318629a278184"}, "/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": "fb67841f6e81027886347a2384bce02ca09a815023e219affcaad7951d6ca6bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_lock.py_os_": {"doc_hash": "38769c13b7142e049a78a0217345b34c20468624d6587b12a3ba574a42be15e9"}, "/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": "fd0d7e55198b67259a98f919e86f6208d788a21d1a0d29dc25cd13f8f2206e65"}, "/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": "fd7dc466c3f351e06380ae82fad15dcc6bb34aa8e9fdd443a789cb84f6b35a8b"}, "/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": "bc3c9bf697fd01de06746b2b61258a6408a97623b14c9fd225145f51c53997fe"}, "/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": "87adf23e248c9767ce7c5a4af7f767003f3c3845d848828cea2c1e8803dc799d"}, "/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": "6678aa1c594d5ba3c086a83566bc8461deb0449e9e07a21de067967f31f78d27"}, "/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": "20dff59c54d32250c5d67569959d31eb784fac062a4f1fb03e620d7ff492e33e"}, "/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": "f30c63f6858d5bd0d0f3d42ab4d97dab603c955882bd484f5d209b8fcfcb24f6"}, "/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": "f0a87684bef55921f2497d3b50f08798ea7db3dcffee17274bc9e830418e4dd6"}, "/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": "b3daf0d876914acfe8a47b1a0d6f29f3e76824397d7d087794235bb3b3bfcf88"}, "/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": "9f5180a32a43b3a762a026b663c8f954eb747d3213038660b3395c7f5e634869"}, "/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": "ed482123a13765e922f42cac0d7dfbd9e4f554f84e3a65a15ed0cbf1f067f57f"}, "/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": "848fc371bd3adc2bf42c4bcaa1732e011b21d2830d9426f6bf81c1bc54a8df1c"}, "/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": "b87aabe89c7d59a2b2744ef517851a912114816d73e46ce89d881bc7bbb71cca"}, "/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_remote.py_errno_TestRemote.test.None_5": {"doc_hash": "bca61392c847e410e75cfbc0515abf7e3244451cb72096071efacfe248296284"}, "/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": "206fc58369adab9d4b72e57db6128ad354b8d709a12b3c51c3dc801facd106d3"}, "/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": "ff6be90884b113086bddf2c425121020e0ff53c976a5746d6a0e211a62ba1ecd"}, "/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": "dbcbd60b24979f5f74720905e52a12eda4a9e45060448f8df6d05f0ea2ae5600"}, "/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": "4ce563cfcb6c2e91ca92056a0fea65bb97719a98a3a3450facb52c18aa13caf4"}, "/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": "8c38e9988237562c676576df010b292b35ace81097c314ebbd3ce0a904428f6d"}, "/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_scm.py_test_get_gitignore_subdir_test_get_gitignore_subdir.None_5": {"doc_hash": "a1fbbd0e29664f2d99843992c305fafd2d7f41eb643c37e693749146f9487de9"}, "/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": "ce65f4ee6d1aaa28a402eca171dd7ed67aed08f2edf0844348e651c818d3d3bb"}, "/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": "936bbd1ce30954e8f48621b3b091ffcd7737ec8f98671426be3c7bad96d3bcd1"}, "/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": "96721039b05a4347212a53db6819b22a0db5ea3b6e054a3cbf1dc213c8b8cb11"}, "/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": "e9b4a592a5365c4e27f1a6cb3a4cbe0cd003dd0064244094ef9fc19e63471fa0"}, "/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": "8506cf40e3472b1b24631025a22d966f65ee6b452cfa8f4dc753281c4319258f"}, "/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": "5d26c649225685019f1901a2715eb5a954ac7357337dc214613dbc4e2ecb9745"}, "/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": "db744685c84e15806be7866357aac48a6aa6b0b97f7cb1a5d2e3369c53efc5d9"}, "/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_test_update_import_after_remote_updates_to_dvc_test_update_import_after_remote_updates_to_dvc.None_11": {"doc_hash": "f76254ddebd2a5f938e4342659dd7602b87febce31949858e805f0c8c9db185e"}, "/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": "b3bbf8be7117d959e3792b874db4c5ad2249085e261eb862fb9fc1aa96243882"}, "/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": "9fc1472217e4f2fa6288851d753a14e5f2d31734aa24f74fe80c42291394c31a"}, "/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/unit/command/ls/test_ls.py_from_dvc_cli_import_parse_": {"doc_hash": "2f87c90c76bd6a2a563f4b4d0b24738d32cec0bf111039f7b8100bede4322704"}, "/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": "76953dec4d3dc48528f0dc3b0d2c2c9abd5b7893de68044e2a341800fa157ed5"}, "/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": "4e1bdb860be09a5aec9044050562f04f85938d26849db65aa194aed8c647176f"}, "/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_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": "13dcab4d1c0ac7efe5f0063c5f338f4145250a0dfe5b679e3a1e2d5a2914d920"}, "/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": "78ea5cd8186bda16a3284552564119abcc13435dd803bc36d4b5b8315742ba54"}, "/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": "61d6a04dfe4c90f3b1aa547d234fa56e3fbba23c328334759a0ffbb2c536aef9"}, "/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": "99ed5ec5500de0c4c96d04fa5762eb6802e4abdddf16eb6dc87f44c9e77f1d48"}, "/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": "321d25a077e8418da4e04de4776752c2ba601efd2b2b894a1ef4a9578ee6141e"}, "/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": "3f2a1103c2cf5373f3c3f67953f5163c363977fc4cbb4564a6ef078f403511fd"}, "/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": "65fb0657763e8307ebda00772a7c2ec8e6c7534062f542c7416437e1636d4899"}, "/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": "6fee0c64b3399661970397b929bf680b23f2282d42a2ca577b86b037245ebeb8"}, "/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": "cf3826d0e0379969246d0dc98bc860264b2b5406e549918ba03340c58372e105"}, "/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": "5efd68bea2b69184ad92bf963cc23c2eb6349416f53c25f678ad2bc283bab724"}, "/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": "963700fb0818cb4bcfd7f04bbe9467a6f091c3e27d9c52712369c2fd3adc0c1e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_gdrive.py_TestRemoteGDrive_": {"doc_hash": "8dd96ffd422328045fa1dd8dd242d6045953b62b11261a7915fedb1bf72ed074"}, "/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": "a03706b3aa80027938e625454d5ed3e9cb47aaa2379d5adca454fcc87718890d"}, "/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": "91e92af7154ef142a56a0cad577d6c256f909e45bd4f5debb12fbff743f323a2"}, "/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": "c4c5b794bddd62c6a2331863e7aa9d98b1ad6b533b9f8e5e102cce3b1cf12a52"}, "/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": "26db6bad62201a0d2bc674133e3c6aa5919f7adcc9a5fbd55b5e1c63681e8e5f"}, "/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_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": "957d6d4bc9ad05a3a526ba88a7d51d3fec2f1f990f49b5785c4536e69243032d"}, "/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_imports.py_subprocess_": {"doc_hash": "71a2730c8ab90a484c1de8cf8beb0f707da39fa3a3ab73cb17c60d05f68903bb"}, "/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": "e6ee9caceb12d14a90b99e25a68cb0dda008d91a02fa8ebdef9daadf2b4ca04e"}, "/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": "812f5e57de83ad3133122a6277a1bf30035c02a1c633e7c1163cd98078d5077b"}, "/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": "c573061916510c090249cf4a34dbe7b74dad920fac73d3877673f9c8f0814f69"}, "/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": "a672e7e3083305f3fc80cfd3d7d450dbd3295209aea11d3d95dee7818994b807"}, "/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": "2db8704da8a4136b2b07e727a0831861fe6f3a1fcd52625ef7df9aee07231481"}, "/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": "3e860b59e565da5b652d39beab0027130336e583f3bc434c6cf037f738eddfd8"}, "/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": "90cb4900572b94b6833be8f7a413ea6a596392a5fab7e5cb50a5fdd643c12733"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_state.py_pytest_": {"doc_hash": "b157b207e1106592711102132726e4aa20b7162db6159bb7862c09d783448c1c"}, "/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": "c47ff507a9ab2949842c774bd4f024fecd72805d9303f1f0c6f86c7be4c94594"}, "/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": "77bea26b6454ec43ec8b8112ce9238c33d2bf99217f0748eafd0f7f08fe4f8aa"}, "/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": "22040e866c6ea26d474f1935d90ffc2b09e74697bf274447682068cc467a3bed"}, "/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": "5b2738717a1d5bee06a1332bc7867ddb03b5b5ff1a780f23d25aad64f6e135e0"}, "/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": "f7ba80a47a1511df39b5014fe6beaf0dcd53dd3375e0f2ca5d8ad8bfcdb478a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_http.py_io_": {"doc_hash": "232f5ae68069deb1bbb1e8147416a23b07c1678ffae411a5f16f2c37662ea04f"}, "/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/func/test_data_cloud.py_test_pull_git_imports_test_pull_git_imports.None_5": {"doc_hash": "7a062b8bf756afdf8aca5401861a2205d4bc608c2f1078d1f837faad9e149424"}, "/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/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": "85b1ca374247b26ef1daa3450e711eb551ab7cd333a0023db8ef405acf104e84"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/progress.py_Tqdm.format_dict_": {"doc_hash": "aa5bf428dc68319120a3db341668c07b12ac8c6302138061f2886c6fa0b1f9b4"}, "/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": "5e344da8f7f38cd861671a1ef0a44538367ebd662315d215a00f67a6e7d155b7"}, "/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": "a451dfe77f0a4dd0a44ef31eb12705fd8e7f401fe0c9316f78cff06be0b0d0ee"}, "/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": "6b31e8c3ceca457fca004076ed1524caeb241fdb44c93bda7f41344546bdd55e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/__init__.py__": {"doc_hash": "d143ab5f07bca9902adcfca1fa1af9eb52a989642fd2ee035391ffb05ac098bc"}, "/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": "1a704ff7de1e30801ce57ec5a3a4ccd9c9c1d21346661feeec87adfae2013425"}, "/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_add_parser_": {"doc_hash": "a1672bc400df6ad98f9a1668cd7031327fd45a676dbf0d442005798141a2f823"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/params/__init__.py__": {"doc_hash": "314b303d6d55a9b929ae95e2593bf406e1af542df1a46f4fb68c756c70142fbf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/params/show.py_show_": {"doc_hash": "18ce4a7d0e9c93ca4deafd821fdfe8cb799c1b651c25b70506a71c63424cea57"}, "/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": "a9de7e0188f15e92ed2594b2703cea98008439d4fc2e434887d110c2b874b1df"}, "/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": "b4fb307525eb3ebe612a25ec59903a91443b47ad20e394af620f8824d8bbd5a4"}, "/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": "5d1bd7e1cfc46e67580a4960a5cb0b35e852d003fb11ad9b8b9c244fd4c7ca1b"}, "/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": "320c19b1088020b801b5a460784d912587f9a85d90824afd0b2c66b429284c55"}, "/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": "06c1a601bd65a65b4a3e20547c59a21ff839f31c6f7dd07e853aab2541d2d600"}, "/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": "d62d16c8549b702590c5273cf15e205492446592f4943f616b58a43b50b747b9"}, "/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": "434d7d345967e81eb09b9acb02eead9459474a4cd47872a8e98bf1007f1738ba"}, "/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": "0b5446ecd59e5e1f9ced845a2afc3c20f8ad778c6e05e93f4ba2b4f7eb7b8fe7"}, "/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": "5b82b1b114228d58d1dd891e924799778f99419e0ac75724528cd13732abb473"}, "/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/remote/ssh/test_ssh.py_getpass_test_url.None_1": {"doc_hash": "9c6a8a3b2a97faec51178f5c199db2138620dcf74823f015f9272792b80ee14b"}, "/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": "dda3c33e29ab3a3c6783986a1c0e6cb24c85196ffb3bac4f35f8b12f5b07200f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_gs.py_mock_": {"doc_hash": "9fd5a629792b9aa24d37b22101e15b750bd18ad2dea71344a6ffeda8a8f15696"}, "/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/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": "2a344b9b6b3b4524abef0f0825dfb84d1658fd436ee45abd8d6f16dc5ec16c84"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud.status_": {"doc_hash": "fc01d73c08666064b1664dc407f86d6e22168d2265c505e2a24911ac01fde67c"}, "/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": "88ec55811f86061c46e48104fd33f634b3780bb7e8d41c054b2ed4a7f9f485c5"}, "/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": "b76964b25e02ecd9fd9bc7cea325fd3ca6f7ffbb14068f31e1afeb32a9b55a1d"}, "/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": "da8903a8e4d7bc1da0209b9c9121c2b9f9410ea83a17893263e3d3e230d6eb87"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/index.py_RemoteIndex.intersection_": {"doc_hash": "8b7369810dd8c83621bf2ce2dda1be5651e7f439d8196ba93816f866e8c7b7c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/imp_url.py_os_": {"doc_hash": "8e65d1d7502a4b618189f71fa50b1ce16279f78f2a907b5d691893975136ba86"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/ls.py__ls_": {"doc_hash": "2358b7326ec9ba2d66b3f515ec68fa7b032dd79c35cf753bcf5eb7bbcea260f2"}, "/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": "3c409a6dc6616607d3ca1fc62d3aacc1ed42c2ffaab9cffc3e9a164b63fa36ed"}, "/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": "7e930d2fb63bc17ebb8627c1fe2170e427f1206ee96693a2618c39b73c78e640"}, "/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": "23f35c5272c89584127a25812336dc319b7ad571f84f33c40b6ea2df4bacd0b0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/run.py_run_": {"doc_hash": "8b21813b93649f8dbed7b20b0963c7a203562cac01185508584fc2465dbb6f19"}, "/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": "fc7f7510b9fed7562b45533a183861a1fc1c0db2e67ec8e8c1a8168a28910961"}, "/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": "157fae43b41a13fa2b0018fd2f8baadf87e58ef60f83300d074a34de84b8fd6a"}, "/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": "2539661f6d66b71f93cd2e4d7bdc60baf753e74c9f72049a87f29324f8b6926f"}, "/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": "8c8db6e139765643565f109e8e98fbcf2f50c6efc8fe8b1f24696f04e48e48a4"}, "/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": "f6632fe65ded79b027dd8673a56dd77db18cedf5cd55e5a658c2402ad1a778aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_PipelineStage_": {"doc_hash": "cab059862e70e063f5cf5f26b59e8417c5b273524376066d4a0183ba0178bc2b"}, "/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": "70a15fa83bfb7a204635c88d26ef2bf0cd8fdd45096652702f1c12acb0a36762"}, "/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": "c65c3dc7dd1c79edb09b13ef0d4d553cf603da534c18fff295f5d62c6075d4bb"}, "/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": "c26bc99400fe8b2ea3eb5682e196d65cace8d2ef964f9f7e6bee983fa5e60baf"}, "/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": "62a68835345cad64518247d0e5bd2d338fffa37c2d031a0906401f4fbd4bfc31"}, "/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": "555b5ae7c868864aaef53006c1b1eaeac804e2a072868100413fbd437876e2af"}, "/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": "a5265c88a932bec04c78ca283df676a963f901ab95541b93c43b2eb82ed0ef11"}, "/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": "4e3e7a181d56a35ad1ec8f9078ad6620e432a8ec027b22dd9de1f5bdb9cf2d34"}, "/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": "96d80f2ecbd7bc07a5bc085ecf7e34613b12c4533f0a9eb0e748ce865bae68eb"}, "/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": "28bc554d2b3288018e4a54b090b597b5c26f73ec050f9fd3ad7035e521579572"}, "/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": "4970efd8cd9eaef4975df9066a8ca5714b4c51e6c97801bf710077161552ff24"}, "/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": "e038243d769d764d7b4d4294be22f886d2bfee0110210d2f6b038e128b6bf879"}, "/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": "2b9d17390ca84638952bd1d01a9a450119a0b1879498697ac220ad9e2b66b671"}, "/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": "6bbd5faf336dc69f0a2fafbb555a60488f3bbf7d9cdc00135e771bfe0bded4cf"}, "/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": "085278ce5c1c6e7a7287574e9eae8dedc5b65e487b61f862ca80f44d2b298051"}, "/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": "c88de12236a3642c9c2ab0a43dfd182ee0953046c855f938fb471f9f8ef49da8"}, "/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": "6794de1f07b457cd1124fddce7c50ce2b704301f4086d3365984fa6b000a8fbd"}, "/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_test_has_stage_with_name_test_has_stage_with_name.assert_copy_not_in_dvcf": {"doc_hash": "81c97ecaae80185bb7d8c9955218df28599f68cae9da0dda37f3b97eedb9ad7a"}, "/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": "900195931d575d6afe965d9d511f8d25b47c126afd9a5726ca6a9d8003a9d5f1"}, "/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": "2304596b2d485263437daf6a797e215ec4c0278c2d6d947883616b955edd781a"}, "/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": "d88aa7f72e5beed3e8ba7e47605a83aaa9e168a429d7bb4e4db7a89661b986fe"}, "/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": "480acc8e845ee4e930f3dd54f23febda5fc313065397a7f13082c4320b680d31"}, "/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": "df5f3e02badded01d46a03963f3d1998d5a6ea03de48c343a9d7860d0ade793b"}, "/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": "bf75fba2685326afb20482127b68d2bd2d3e7cddd0800b0f7af94d2ef0f9933c"}, "/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": "26f84455d110f361dc5c75e7877ca70639e3e22f30719672b002031e24d046ef"}, "/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": "1e5f8a1ce3f2b62a0629802870189b94577cb6f7cc2a9d20902abc05739733ca"}, "/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": "57e214d20eac7c3f5207f26c9d30f3d9a0bc8d0f9503bf89207bf828280f5dfe"}, "/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": "77d9fd6d5426209d86f83250ba079f63df50225bd1d5371d0f0ea6b5321d6c45"}, "/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": "38de980f789ac7fbb4f7d72b6d1fcc6efa3080f0a0adc60b5463367525fb2077"}, "/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_single_stage.py_filecmp_from_tests_basic_env_impo": {"doc_hash": "2400b824f86ab5fff6ef8ab4ddb2051fc79216cee0efd036f12385d07384c4bc"}, "/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": "46bab952156aa2eb0cda15f39976ece73e49934be1df23ee1b7bcbbf90bfcd07"}, "/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": "ef44357a084c1afa674c4ffe03f8c0d488656931911dac09706173c5f91d5b5d"}, "/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": "06d36e88d2255acc4f80d509d5a40231c463d71a58a323efef2369b1df7d5745"}, "/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": "511e0b82bcbd70ef42fd71a6733bcef6f24cbf3b3aa2238127e1812dc4857f0d"}, "/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": "539d2913259c2e28c82472caaa50f7ee10fee4f4262816a36058fe8eca20186d"}, "/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": "447040ad04a614d82a7be1e1517273774b51c5d64635d2215fff7168c1a3ed0f"}, "/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": "aa950ebeeb416e7fae19680c67ac9d28903d1bd71777ebe55b41c77532594447"}, "/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": "7f61c5dde373a4bf2831e979cf1c1bef9814b234933d5e7914a0fc88029e01ab"}, "/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": "7fcb30d565225d925bf741a1ede8b5553a7b7e5a17b405a8d324635cd72decea"}, "/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": "698f6358fba6d29e55ecb28ec1b66b27db3a5fa9822711a1ba8407f6dc24271c"}, "/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": "991c63203c287431390eb5a37da88fcbafbd7eed0dcde07aedb7d5d8801f6bec"}, "/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": "cef9fcb5dc2a9c5fa56bf19852c814cb6b90c5c8c39a83bae9b495c1ed3d9a2b"}, "/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": "3589c04bc9cf76afc136c54d5be7499c61ec8af4c84f595431ee38ff4bb921f1"}, "/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": "cd950df43bde1d78e47919e80765c8c9ecbf5543ba07e0fe8acf9bf8b4c082fc"}, "/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": "41cddd18ac3e7c6e5c7a94a228b7274c6e55f96c8205c141eed3275841c20894"}, "/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": "228557f17ba58be23877cfcbb3e277009559329f1f5f534a50d3e31b16cf6deb"}, "/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": "7c67f5460bd147c7325cb533bdbd0c0043169f7de6147a249a68cc89965b694c"}, "/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": "a4697dd82fab92b2c2669b2f747b068d1901e5e6083e63873072f2190cf516ff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_index.py_os_": {"doc_hash": "20c6fb130a09eecdc219368948ce0226a074117b521b5d5973d26f8675843224"}, "/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": "5e99c4903cbed8f79c4491b77a96905cf30413cd11a58b4166bb173af2285460"}, "/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": "8bec75bcdb37c7d3e356ff753acf6eb1fefa168925983cf8fead98b42aaa7651"}, "/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": "d6c66e3cab9e0a12f0ddc811c8701ce8dcdef8c60822490ea452dbfc6e04fc29"}, "/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": "1b9068704df2e434d8b12f7303ec434c4ad1b9ef7ac72a8ed4af5d95b462efcf"}, "/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": "fad80a03e352e86e60bcf0fb31bacf4502d6690824509f20d8ddeb431dea236b"}, "/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": "faf1a98bbd552f41ff71b0bf72ba88e92dd3460339fd6e036e0b68e788bc5609"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/checkout.py_argparse_log_changes.for_state_color_in_color.for_entry_in_entries_.logger_info_": {"doc_hash": "6b65958c17baa0491fd2d857512645e5c6ca94d1e17afb5a2bf669219d0f9ba9"}, "/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.parent_parser": {"doc_hash": "193ca2164450f359df5d75bb2719cf64c71306548b4e01582cb02321e03de691"}, "/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_HELP._": {"doc_hash": "9fd421180b90879b3631dd066ee494972cea2f5fc388a600176139d9ada220d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_add_parser.fetch_parser_": {"doc_hash": "9314b50c8ac456c1cd3db2a649e7ca025de326ee375c0488b7852a5f18618684"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/diff.py_argparse__show_md.return.table_Status_Path_": {"doc_hash": "075687dad5d7e279a086c5ed5c7de2003b3e184f4d6a7b7a08cfa35298c22492"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/diff.py_CmdDiff_CmdDiff.run.return.0": {"doc_hash": "647b8ecb2f9ec26f9727dd7c49070e7f14ebe2fef8cc4aaa1293d4a48016ecce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_CmdRemoteRemove_CmdRemoteModify.run.return.0": {"doc_hash": "fb3d7e074ab34a43b52655e34e3d86ce1a7adb6dc81e475a12c83d0a1507de1c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_CmdRemoteDefault_CmdRemoteList.run.return.0": {"doc_hash": "8a3071e3784430236ab54c5be35ba36edff7de0c2a4754cbf371eaee3b02642e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/__init__.py_from_collections_import_d_SCHEMA_update_ParamsDepen": {"doc_hash": "49e7d9c4183632e894c17eec6fa3cd27523bc1c115aac5d2814ff4ce18e2824e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dvcfile.py_FileMixin_FileMixin.exists.return.self_repo_tree_exists_sel": {"doc_hash": "f81d32430172944b466656c793b61ca1743c0a9678ca44eb5b38a8f4335f8b85"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dvcfile.py_PipelineFile_PipelineFile._dump_lockfile.self__lockfile_dump_stage": {"doc_hash": "4490bf674d7130f52dd861d761879aaa4d98bb0673be19228ddf22ba5af83565"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dvcfile.py_PipelineFile._dump_pipeline_file_PipelineFile._dump_pipeline_file.self_repo_scm_track_file_": {"doc_hash": "9d75ae68866c7d6bba5f34a66a97baa7fc4b9be619c288c40a45cc6f0eafc928"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dvcfile.py_Lockfile_": {"doc_hash": "b768aa9ee1fb6812204ab8af1ed765db2da426a608e1c4fc50174f7ca16611aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py__Exceptions_raised_by_t_OutputDuplicationError.__init__.self.output.output": {"doc_hash": "1964c814721c189c1c3eadfb8a9b36683c5e7e04b084163f80b29541ba330137"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/__init__.py__get__get.return.LocalOutput_": {"doc_hash": "40f83cf110ae2ab6a87c51bb42e6ffb62972e645508692baf9fb9a907dd09fac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_BaseOutput.save_BaseOutput.save.self.info.self_save_info_": {"doc_hash": "89e6cca9bebc0358320e5f8476e2fe39c6b47614d65e164dc28b6af0c67a8bcf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_BaseOutput.commit_BaseOutput.dumpd.return.ret": {"doc_hash": "cadef329d4e4dec720681b99420d5caa52a7d2295e900ab64b8249b18bf6854b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_BaseOutput.get_used_cache_": {"doc_hash": "44f82064418a7fd740955522a7453e54d1653ea06b536f17e4ae99256e95c3fa"}, "/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_self_": {"doc_hash": "b1e7306fc34debcca1150ba74048eeec79f52f2c6a41c530766823357f9c5aae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/ls.py_from_dvc_exceptions_impor_ls.with_external_repo_url_r.return.ret_list": {"doc_hash": "a96cc6d1ab4793c9825570c8f11b5661c7e6d845a7b8104400283aa6c4c73a12"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/diff.py_from_dvc_exceptions_impor_": {"doc_hash": "64a627a18bda02dbe017e365ece494acf2f1ddbaa80b6d1c7c325bb092af359c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/show.py_logging__collect_metrics.return.list_filter__filter_metr": {"doc_hash": "52bfaa48ffff1c1aa9ed651ea0e001a9cdef3cb0be65c26827950ee556b1fc0f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/params/show.py_logging__read_params.return.res": {"doc_hash": "ed2e1c4fd9c498ac239624cf350d52fbb510d3837583f04af09eae1caf5cb0c5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/update.py_Dvcfile_": {"doc_hash": "0b7fc12017df5408fe8514af14791aaf3dfb1a6623238d5f4c29a04e682c0b14"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/rwlock.py_json_RWLockFileFormatError.__init__.super___init___": {"doc_hash": "949568ebb9158a3aed206dd5f87f9e3aae6d66dc5485a38f65cc3592b35f8642"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/schema.py_from_voluptuous_import_An_": {"doc_hash": "0036ba4ee958585da6216463daa7e7447409d80e124f37e8edf29e0e364550c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_errno__item_basename.return.os_path_basename_item_pat": {"doc_hash": "f317fc1c0f00bd2f5861f58d5f6ae607206d91cefea898d50d188f4e7c242caa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_logging_loads_from.return.cls_kw_": {"doc_hash": "cea2f3ecd293d1134413e8caf1f5a57aa38ff45bc912b6b574b2988f911f9edf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/cache.py_logging__get_stage_hash.return._get_cache_hash_to_single": {"doc_hash": "41a5860461e369856e1894bfc3e109829049fbd407dd40f60ae7e0f2d179a8d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/cache.py_StageCache_StageCache._cache_type_copy.try_.finally_.self.repo.cache.local.cache_types.cache_types": {"doc_hash": "53c80014a3f01004a7b9a0216b0b13373727bc9ba1739c2ead552476079ae264"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/cache.py_StageCache._uncached_outs_StageCache._uncached_outs.with_self__cache_type_cop.for_out_in_cached_stage_o.if_out_def_path_in_outs_n.yield_out": {"doc_hash": "7958635b4bf7190413ed089bb7bfee29c637065637343036b904bafbc9530ec1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/cache.py_StageCache.is_cached_StageCache._transfer.return.ret": {"doc_hash": "f950884259758350b5d1b3ae9e8a54d34b3cae017dde198dc8fe0f776a146330"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/cache.py_StageCache.push_": {"doc_hash": "f96dec1820efc5cb26a47e3b47715a39ccc57bd8068dd7d355cb8db89c10b54b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/decorators.py_from_functools_import_wra_": {"doc_hash": "8b27541bd309a391c57a01a4e945076d6f2c74edb055511e7047440d1ab92528"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/loader.py_StageLoader.load_stage_StageLoader.load_stage.return.stage": {"doc_hash": "5f57928248d32c75216ee615516e5ad417fc1437a47a99df8a93854f4384624e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/loader.py_StageLoader.__getitem___StageLoader.__contains__.return.name_in_self_stages_data": {"doc_hash": "153bfd5be8091001e09111ac5a639a80d2b33a170e1db4914330710e0114a135"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/loader.py_SingleStageLoader_SingleStageLoader.__getitem__.return.self_load_stage_": {"doc_hash": "7cd0c5be5b1ca145ec76bbc17590f52590be416359d3a4dc2f4fc742db94ef10"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/loader.py_SingleStageLoader.load_stage_": {"doc_hash": "4daadbd671598c660154cc5c6a61fab4b870fbe06b2c01235b6933e91fe68fbf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py__Manages_state_database_StateNoop.__exit__.pass": {"doc_hash": "5368d0d237a01b11de5c88c56823a2d73d84e9e1f810a7fc21195d9283474d99"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_bytes_hash_is_binary.return.getattr_sys_frozen_Fa": {"doc_hash": "b08b1887810b7c3ef63a64a6660857a5f03ed034b1f6e88fa9eb5e09b92b6701"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/fs.py_errno_get_inode.return.inode": {"doc_hash": "c55bcc9428929c45c88a0045798599b550eb3637aca20380abfe967b0629cbf6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/humanize.py_from_funcy_import_is_seq_": {"doc_hash": "cb8d49fb570c7ac07c07f862d3dc9998f8a4e831bdeafe8472dbe634a0953ef0"}, "/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_test_diff_with_unchanged.assert_dvc_params_diff_a_": {"doc_hash": "5078984a4157a3437f10e58bb242f05b42bade9496d0de6b1c07e5c9f025eb06"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/params/test_diff.py_test_pipeline_tracked_params_": {"doc_hash": "c4b39cd29f572148b8130915aa3ed3a44662c92e71dbccc14eb2241be8665735"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/params/test_show.py_test_pipeline_tracked_params_": {"doc_hash": "c662c0d9d035aefe65df51e808b7197095d0c062a1778fd4188cd7600a9bf355"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_gdrive.py_os_": {"doc_hash": "2c4c45eeefee0f2ade8b430aa849ec9b025dd807b24e02c789bce6c52e64cdc4"}, "/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_test_add_optimization_for_hardlink_on_empty_files.for_stage_in_stages_.None_1": {"doc_hash": "da1e4d7dd7cb31fd98e750560e0d7c69f035990e051c8b8aea7ded4148c52a9b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_output_duplication_for_pipeline_tracked_": {"doc_hash": "34df735d7bd89369f12c0bbdba383ef67bc54134148e90fcf833d4971abb3d63"}, "/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_test_checkout_for_external_outputs.None_2": {"doc_hash": "3efa9938a42c4bcea478985f10ec4db9855ce658221d8ffd1264eaabebdf4121"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_checkouts_for_pipeline_tracked_outs_": {"doc_hash": "0cfa9682a8e8b57e96d541b1dd56a8f7d0688f025fc7d3b8a06ac28b3e78aa59"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_config.py_configobj_TestConfigCLI.test_root.None_1": {"doc_hash": "fdec0e0ed103b51c90edaaa02556586ad2d9aefb235ffac2f51ed141842811f8"}, "/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_recurse_list_dir.return._": {"doc_hash": "f066b046d4739d064e94f9fa1d9cb4a69327ed5e332598a3406c92aa2ca37cbf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_test_dvc_pull_pipeline_stages_test_dvc_pull_pipeline_stages.None_4": {"doc_hash": "af66bcda94ac872036628f9c432ec47cba1dc64dffd73d59c70183c6340526a6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_test_pipeline_file_target_ops_test_pipeline_file_target_ops.None_1.dvc_pull_dvc_yaml_Stage": {"doc_hash": "1fc26997c0325b52126329dd4e46eae1ac4759d969cd0eb42ecd6232fb24242e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_test_push_stats_test_push_stats.assert_msg_in_caplog_text": {"doc_hash": "7634394fde9acc0cd372a9472d00c64f87b193620ca84fc25d58ce77cf16fcb4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_test_fetch_stats_test_fetch_stats.assert_msg_in_caplog_text": {"doc_hash": "b1dda7419e2a6acc8a0fb5711ef6c07ae44a371fc8867b1e19e18bb2ca88cffb"}, "/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_P": {"doc_hash": "68e426f0151d6896e5418489fdb55716260d6713f6d9e34fa4cf1c778a5c4bac"}, "/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_try_get_single_stage_from_pipeline_file.with_pytest_raises_DvcExc.assert_Dvcfile_dvc_PIPEL": {"doc_hash": "1eede6729335938f196232ff898685a9d7c5f96af8ee1dee0a31f0001592727c"}, "/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_cloud_positive.for_flag_in_cw_ca_.assert_main_gc_vf_": {"doc_hash": "dbccead7c77470518560b943532e99bca4b85cffb2a3e01038cc670b23b1f18f"}, "/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_test_gc_cloud_remove_order.for_args_in_mocked_remove.assert_checksum_endswith_": {"doc_hash": "c7075fe1dce6d44323a5814479aeb4e577fcdcc3c179ab051769aeb0ee819bd6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_test_get_url_positive_test_get_url_git_only_repo.with_caplog_at_level_logg.assert_failed_to_show_UR": {"doc_hash": "757af733d4a247390562715252111a8c463dc5bcbf38019fd165a19e5f853b14"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_test_get_pipeline_tracked_outs_": {"doc_hash": "fd9af20183bbc4e95137b9b1af6671cdf173480304d8f0a0349f520f36ac8cd9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_import_pipeline_tracked_outs_": {"doc_hash": "ce20445e1c54f26ba1a149f69717121b2991e9012fc8f3603b72be8337e68eae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_lockfile.py_test_deps_outs_are_sorted_by_path_test_deps_outs_are_sorted_by_path.assert_list_": {"doc_hash": "312f74b4b01423e167adf4c517aab8f8cc748656fe94f0dbd0816882a6902fd9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_lockfile.py_test_order_is_preserved_when_pipeline_order_changes_test_order_is_preserved_when_pipeline_order_changes.for_reverse_items_in_reve.None_4": {"doc_hash": "0606d8d166c20a4cbb73d8a4c224b3b2f25e6caa1adb0c003ae90422f92de4dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_lockfile.py_test_cmd_changes_other_orders_are_preserved_test_cmd_changes_other_orders_are_preserved.assert_eq_lockfile_new_lo": {"doc_hash": "e5b9927b395e24e1d88d86f80cfa32b3a22922b98465f78ced20a952cdff2e88"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_lockfile.py_test_params_dump_": {"doc_hash": "0da850de7b2996c2d22ca14d2401b97d851b41a4b9b4f98aa7d3c4c5087de580"}, "/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_test_ls_remote_repo_with_rev_recursive.match_files_": {"doc_hash": "1e9e7411ca5e928a43d74f0b32456532f1d42b5a72514e3ff1111d236e69aac7"}, "/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_modify_missing_remote.assert_main_remote_m": {"doc_hash": "ef2156abf68c3e2c314ba2889f318a8d03bd84202fabffd639bee3241d6d1750"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_downstream_test_downstream.assert_evaluation_4_relp": {"doc_hash": "429dd9a79a82cfb21845a2cbad7a2cb0d6649cb4f5269ed4a4efa3408e02556d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_os_TestReproChangedDirMultiStage.pass": {"doc_hash": "fe1c39cfe856b065ec8cb5ae2d1b74143965fb13d964e57f56658445437fbdea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_downstream_test_downstream.None_15": {"doc_hash": "bdc7f4ebe518f8acb2365a3c88fe34ca9cb9728d9cab8a93368836b1218962b8"}, "/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.assert_": {"doc_hash": "ff7736445226ce1da14149ea813cd35f22d47635fb83eb64942600f17012db05"}, "/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_test_cyclic_graph_error.with_pytest_raises_Cyclic.dvc_reproduce_copy_baz_": {"doc_hash": "40ae22bc6dee8da1e2706c23a86924f79ae90b68d4d1caac6f1656afe6d41fcd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_repro_multiple_params_": {"doc_hash": "c33ae51f3335c9cc23a703c7c4cd924e0d4defd1ab0712501bfbf054688e8455"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_os_test_run_with_name.None_4": {"doc_hash": "1b9cf314ee6d52b093e6b170dfcf40fd3927d13c3ec4394b7e7afbd28ead614d"}, "/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.dvc_run_": {"doc_hash": "a31f4d9b8dae82b04ae33e4ec8d490e42d661f5a46fed647ef774c63001d5ccc"}, "/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_test_run_dump_on_multistage.assert_Dvcfile_dvc_PIPEL": {"doc_hash": "7a67af2de7da88e0c1ffebcc276cf9bae8fbc40eb11874313c6e5c3906d81dc9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_test_run_with_invalid_stage_name_supported_params._": {"doc_hash": "1deb2fde9ff51fbbcf12371ea2c31a6f3c0b0671c0b0ab41872cdaa3e471a3be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_test_run_params_default_test_run_params_default.assert_data_stages_re": {"doc_hash": "6fb9717af8e8530b4f695a84e2af7db4fe6b5fb5a419b8e7661760c032363af8"}, "/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_non_normalized_paths.with_self_assertRaises_Ci.self_dvc_run_": {"doc_hash": "b5057c671475599df63548a7b38dc815212eae9487e80b10e4aa18add4ed3496"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunCircularDependency.test_graph_TestRunCircularDependency.test_graph.with_self_assertRaises_Cy.self_dvc_run_": {"doc_hash": "74e3d5798162565d3424f7176cb9a07da880b0fb7d2208e3d98e732b95941991"}, "/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_": {"doc_hash": "4056530c1cd5f0b9ca0656e0e49295a411500426a8c81d7c060547ce0d106398"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_state.py_os_test_state.with_state_.None_2": {"doc_hash": "a4299dc67841562fde173b0ae3b3f475441aa2b169b5356cb7709d519dc41921"}, "/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_test_status_before_and_after_dvc_init.assert_status_": {"doc_hash": "fff144e000d262e00efec84d7285d676c1ee89f800d8a16f164850c48582577e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_status.py_test_status_on_pipeline_stages_test_status_on_pipeline_stages.None_2": {"doc_hash": "e1712d4547ab4b1d6c9e69103a29acde63bc89a6c0501d62dad3c9397cdfd24e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_status.py_test_status_recursive_": {"doc_hash": "5e9d56214cdf1b1c64b9cea4f3fe37a44da62802e92d7774b312d1d2c158920a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_update.py_test_update_rev_test_update_rev.None_4.assert_foobar_foo_f_": {"doc_hash": "d74b0cac82e4e9266ea03cbcdd4df05674f43f99176eebfc1afecd3e91727dbb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_update.py_test_update_recursive_": {"doc_hash": "1a434969cb0b5f909ce91bbdbbbde1625561bb9f72143c88c7a9f829b8de7d60"}, "/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_test_show_json_and_hash.assert_modified_i": {"doc_hash": "645bf4e3079c15b3e72e345770b418275986c209a0a5d418f08a1bea796712db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_diff.py_test_no_changes_test_show_md_empty.assert__show_md_": {"doc_hash": "4be4961338791981bb50d1f8ade0b157498978a67c6ca540789e3867942a4826"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_diff.py_test_show_md_": {"doc_hash": "16a0f47ceeda9669f99572e10ad87a2a83a9cff74a1173392f9c66d319289b37"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_metrics.py_textwrap_test_metrics_diff.m_assert_called_once_with": {"doc_hash": "07f5b86bc9359f0055c10e91962daeafae2f8b36d04fdd9c65bb861b911f5a7d"}, "/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_test_metrics_diff_markdown_empty.assert__show_diff_mar": {"doc_hash": "2d08e2a2f3c80343f875da3a17d0048299acc19675222a93550c306a2aa2cb98"}, "/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_test_params_diff_markdown_empty.assert__show_diff_mar": {"doc_hash": "58f3627fce9e806d5872999381f42317c1e00e55e06ef9d970abac38c891b444"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_update.py_from_dvc_cli_import_parse_": {"doc_hash": "a4bd1a7935a4302279bc371bfeab6169e8c99abe8bac937b32c55350d7f1c3c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_gdrive.py_os_USER_CREDS_MISSED_KEY_ERROR._": {"doc_hash": "d47598b0c8f90c0bde486c4792e0f66b32f9949805bda7fb091793902bf10850"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_s3.py_test_grants_test_grants.None_3": {"doc_hash": "c62a8c831ae913b9208b7cc89ae5145a33b6c8fe7f47247875cf928c4819dd25"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_s3.py_test_grants_mutually_exclusive_acl_error_": {"doc_hash": "ceb5a434b11486e76cdee4a22befa1ad94f6cb3df8f255ac0ea2e1f5ef8dd418"}, "/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_test_walk_with_submodules.assert_set_files_g": {"doc_hash": "978c4ed43b1f60a80570ee0bc4ae6d6e16dca7a73737200c77941bbc9442d133"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/scm/test_git.py_test_is_tracked_test_is_tracked.None_11": {"doc_hash": "bb5dc5a1eece2ac892bd85f6ce321cc88757e66a6cedc66751954145ad5cada0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/scm/test_git.py_test_is_tracked_unicode_": {"doc_hash": "dc88ceac10914c6d3077b2097f3e9681903917df1670abddcedf8fbf7560df59"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_analytics.py_json_test_collect_and_send_report.assert_mock_daemon_call_c": {"doc_hash": "f3fec5bbe72f1857de8a0be919031fab689f65af30b84ed9ff7d0d9f15085b24"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_lockfile.py_pytest_test_stage_dump_when_already_exists.assert_lockfile_load_": {"doc_hash": "87271540780b98b09046b1f44231ac87700509f69683b9f561397cdaffacf45b"}, "/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_": {"doc_hash": "14f6372aaa5e82616096184da47332027e01ccd7de24a57bf3399971e7991a29"}, "/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_dvc": {"doc_hash": "b2d7e066dde952c68bdd65c1fcfd86abfc611fd8b375e075a7fd373ef7d1f438"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_humanize.py_from_collections_import_O_": {"doc_hash": "78b28e4b75960c07551fd7310d55bbd7aeda355d7d07a6d8336f07f53fe0e835"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_utils.py_os_test_to_chunks_chunk_size.assert_result_expected": {"doc_hash": "d0206ba6f1c5ee8d92252ca896698638e213c5738ed97faec1ecf0adf1d18ebf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_utils.py_test_resolve_output_test_resolve_output.assert_result_expected": {"doc_hash": "62020587abc59639de58754cd051736ebe078f28aa1507110a120e5694309f75"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_utils.py_test_parse_target_test_hint_on_lockfile.assert_dvc_yaml_name_in": {"doc_hash": "b8186d5fdd2722872ac490122278716af72b5940f281cb4c9d85f1e5d8151dc5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_utils.py_test_dict_sha256_": {"doc_hash": "7806fd11abced319c7e1c9aab0633f0fea6654a2c0e1383785a91458efe3de2d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cli.py_DvcParser_DvcParser.parse_args.return.args": {"doc_hash": "fcc81d3fc6df2474eceb8b26be3bf98daef3bff3e7833e899cca7b9b68d5a782"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cli.py_VersionAction_get_parent_parser.return.parent_parser": {"doc_hash": "64d3c7a91495f5d57607005082dff9286f8f8f423ca63712c6610d19510fcb93"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/dag.py_argparse__show_dot.return.dot_file_getvalue_": {"doc_hash": "129dcb19d9e751e2f5a713a6e462e1628a2afa18b34a7bbed4cfff48426bc583"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/dag.py__build__build.return.nx_relabel_nodes_H__rela": {"doc_hash": "8423c6518325b1d1c5a1e7750af7942e063f98a042b5c25257de93492ae533aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/dag.py_CmdDAG_CmdDAG.run.try_.except_DvcException_.return.1": {"doc_hash": "ba3ca77b29652c406b2ae1f681de9b720a930b473f62c50861a45dfeb694df8b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/dag.py_add_parser_": {"doc_hash": "de9c32aede07dbf2abe49f74353e5c050f946b94e7cb72d0ddeff1dad6e84330"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/freeze.py_argparse_CmdUnfreeze.run.return.self__run_self_repo_unfre": {"doc_hash": "6a5d8768ac862e88f5d6bb08e81cd0ee1df37529155588e9efacc89e9cfd933b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/freeze.py_add_parser_": {"doc_hash": "31c9fe81db58f23d82f5712414960c04ea3808eba13e7e5f2c7f6e8e6ab3e8e4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py__show_diff__show_diff.return.table_header_rows_markd": {"doc_hash": "3f4e3017c5aed4f838c0ee97c8d3a00e20499a9496501cedf1edbcc3ea00d750"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/params.py_argparse__show_diff.return.table_header_rows_markd": {"doc_hash": "377612a2b07eed0b7d608de4891f82dbfbf8974c10030201063d7ee7a23cf25d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/params.py_CmdParamsDiff_CmdParamsDiff.run.return.0": {"doc_hash": "7b0b577d8d980a18d2b1f0407f724d32a1ead18091e45e8a469feaca56b4b496"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/plots.py_argparse_DIV_HTML._div_id_id_div": {"doc_hash": "c2327b4d522490aa4b0bc09b2bd8716893ffac1808a1485e81425285266dba24"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/plots.py_CmdPlots_CmdPlots.run.return.0": {"doc_hash": "18b7573cf24cc1ef0e7c6addf9fdf02ab4b6531ed3d02ad33930366f464f2fa6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/plots.py_CmdPlotsShow_CmdPlotsModify.run.return.0": {"doc_hash": "d0871429555af47b01492a00770f250e85fc4b34fb5397b1ffb8842017df702f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/plots.py_add_parser_add_parser.plots_modify_parser_set_d": {"doc_hash": "1ce6edf25468d53ef17706b33b335eecd5bd0faeed725b9a861d849d5514e8bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/plots.py__add_props_arguments_": {"doc_hash": "29b2c0ba049ee592fe60db621318b94e67f7df954be58823ada1f6ab8d0e31de"}, "/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_f_remot": {"doc_hash": "40174e961edf7870ad6fde879928198d0850cc0e8f50260752e8d250d2d41c34"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_CmdRemoteRename_CmdRemoteRename.run.return.0": {"doc_hash": "6db25d130b77af31a72045b971c70e16856adb4df332248db49435acc264741e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_add_parser_add_parser.REMOTE_REMOVE_HELP._Remove_a_data_remote_": {"doc_hash": "e8d82cafa1c3dbd847e7bd02443488a55cbc9279eb5e33873a746296cc283fba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_add_parser.remote_remove_parser_": {"doc_hash": "28809b0889e07aeff4b93dc2d6f2a318aa5d6f8389a047f43adc31dbe1e1b8ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remove.py_argparse_": {"doc_hash": "4728c220657b8fcccaa04cc52c73a6ad9e5217ddb66b5708e10ec3c3975abc72"}, "/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.f_argument_": {"doc_hash": "8d52bbf10c3f80574aa3bc38a06f9bf75f94e5050303eff2b6d0c2fec5719fa4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_AsciiCanvas_AsciiCanvas.draw.return.joined_lines": {"doc_hash": "21926aed487e0b0e1fbabc144262d834c0e3ad678c61b9c9dae7b0f283269c0a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/__init__.py__merge_params_": {"doc_hash": "5d98198a4be8e2b10318fc5747ed37260397acd80d84f910cc43f56904468a9b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/azure.py__": {"doc_hash": "6ca7bdfad4e63e61a9f37185e9908280c2942c630355f5dc7ea073c67be58f2c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/param.py_os_": {"doc_hash": "922a5de17dd497bba1e51e06db2e0addd3996d6a05f08d9810e3b2de59e412bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/repo.py_os_RepoDependency._make_repo.return.external_repo_d_url_r": {"doc_hash": "6296f2eef9c5c67337e5e9654bee1dfd30cc7d0b2dd590cb9ee48e5aa9122837"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/repo.py_RepoDependency._get_checksum_RepoDependency._get_checksum.with_self__make_repo_lock.try_.except_OutputNotFoundErro.return.tree_get_file_hash_path_": {"doc_hash": "8b37a0fea6dbd5c692c400e5fe34af9896d4539036cdaaee2eb4eaa53faed0d7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/repo.py_RepoDependency.status_": {"doc_hash": "a16b8a0589b7ba3b11bd52931eb11eafecdc2a3e4305645db101dc432a1eb43d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dvcfile.py_SingleStageFile_SingleStageFile.remove_stage.self_remove_": {"doc_hash": "877aaafdb74d50e37bf87bed28f3d3d49caf085870634afd7a548c88c970829c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_CircularDependencyError_ArgumentDuplicationError.__init__.super___init___f_file_": {"doc_hash": "919c084cfc3e5b98246491e20345aedc4c8da2e4447efda4f08df0b1891268d6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_NotDvcRepoError_DvcIgnoreInCollectedDirError.__init__.super___init___": {"doc_hash": "3c88f925c749874542ccb4275cefc1fd9153334895c61820f76a5ae4b89a23a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_GitHookAlreadyExistsError_HTTPError.__init__.super___init___f_code": {"doc_hash": "1d12e7039620a9394f7236ce6be9327329956a17d963e3bb6be2fd2c184d2b2e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_PathMissingError_PathMissingError.__init__.self.dvc_only.dvc_only": {"doc_hash": "b2c1157b4bbc7f9969a730b8a05cdcf116f3ef5a4f4ddbca47119fc8bcb57738"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py_BaseExternalRepo.fetch_external_BaseExternalRepo.fetch_external.return.sum_download_results_fa": {"doc_hash": "e755fe69e0749335bf4d4940350fb849d29e6180396962fd8f711bc9a48f933c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py_BaseExternalRepo.get_external_BaseExternalRepo.get_external.if_self_local_cache_.else_.self_repo_tree_copytree_p": {"doc_hash": "481ff103e6d381da5e5ef4609036ea56fb176df3587f8fbba6f20e7fc75fcacb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py_ExternalRepo_ExternalRepo._set_cache_dir.self._local_cache.self_cache_local": {"doc_hash": "c3b74de51e889eb04c35bfafb2cb278b1603618a0ecc87d4caa8925a47a7f80d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_logging_DvcIgnore.__call__.raise_NotImplementedError": {"doc_hash": "f167a4aca7971273fa2230e4c3b06e901dd4594df7516bbce75f08d8b463efc1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_DvcIgnorePatterns_DvcIgnorePatterns.__call__.return.dirs_files": {"doc_hash": "3c108acd5bb8859d9b0dc3ab2ff7b487a6ef15661525c0f9eb3badeb385c65a0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py__Manages_logging_config_addLoggingLevel.setattr_logging_methodNa": {"doc_hash": "e1983ca30ec61bcab33cb27d9ca42d4c9f1cfec23fc33b921740d8349eeaa047"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py_LoggingException_ColorFormatter.color_code._": {"doc_hash": "38397c16dc03fcfa0454b06d89faf8f5f9f884172a9d611fa896e3767ee6c741"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/__init__.py_from_collections_import_d_None_4": {"doc_hash": "8a5214c05edcaa3f7735f6579b66d9bf26a06eaf02911ca7da61943553e23369"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/__init__.py_loadd_from_loadd_from.return.ret": {"doc_hash": "3649d216e333cff2dcb3abd8885201ef93457f6b5b4410dae33add6191450bd6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/__init__.py_loads_from__merge_data.return.d": {"doc_hash": "ec27c0cc9278a55e8ef91524146ddcc1f6e5ef90d06d1799c71c44042654f9f9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/__init__.py_load_from_pipeline_": {"doc_hash": "922233d93e2a1c29fdb880328cf6cb2e2c60a90ec9c13f784637797138dec8fb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_logging_OutputIsStageFileError.__init__.super___init___f_Stage_": {"doc_hash": "3da787cd397bb540dcb09c333034634649d17855917206f2b564ce3aa4d9e50f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_BaseOutput.verify_metric_BaseOutput.get_dir_cache.return.self_dir_cache": {"doc_hash": "b4a150e24eb8ad2c8d3eb76beaf3f1bcc5332e5d57dc2daf58947fbae5f6a488"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_BaseOutput.collect_used_dir_cache_BaseOutput.collect_used_dir_cache.return.cache": {"doc_hash": "de028bf593909936603ceacc71dc021268fa2f3bf745d08125b1ff8fab3fbce4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/local.py_logging_LocalOutput._parse_path.return.self_TREE_CLS_PATH_CLS_ab": {"doc_hash": "064d2367db8dae71bf389b951057d0cc5a110966ddb1fb5d8f0676683adaa369"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/local.py_LocalOutput.__str___LocalOutput.dumpd.return.ret": {"doc_hash": "085fa5ddd7bface4ee6c163f924fc3f6c15be780efcb445b3f27fba43b441681"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/local.py_LocalOutput.verify_metric_": {"doc_hash": "ce8d04fd23133777f4bf216cf3750513ee1bb32c96ddb9c49368f8d50ce21cb7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_WindowsPathInfo__URLPathParents.__repr__.return.f_self_src_parents_": {"doc_hash": "a4c76ce7521423a8d9e978863c9ad6530b62399a2e326076728ceb1e6d50dedf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_hashlib_index_locked.return.wrapper": {"doc_hash": "8b4733f4aadb3dd5bd456be8ee921d8d63ccb2ea6bf75612b593190950e484fa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_Remote.hashes_exist_Remote.hashes_exist.return.list_indexed_hashes_li": {"doc_hash": "9ab2df9206391b14e9434ddce4580a33767055b7221c8d67d8d465dbdfda10c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_Remote.gc_Remote.gc.return.removed": {"doc_hash": "3e7e336426f47e28c2aa51a90e666f30c7ae4c4d4c6d72157c25ffc268f8c404"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_CloudCache_CloudCache.get_dir_cache.return.dir_info": {"doc_hash": "8e46a0ad45e82b78fd94547163ae354be7c297f8fa869079baa2616889c2e0f9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_CloudCache.load_dir_cache_CloudCache.load_dir_cache.return.d": {"doc_hash": "626caf90635cf655652280be05e55f879d7b0d63d26a0382f0bb17df42ed6d38"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_CloudCache.changed_CloudCache.changed.return.False": {"doc_hash": "55840d4069d7e5574626c478e563e37ddc5ad408c11fa5f9221ac9957d64d154"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_CloudCache.link_CloudCache._verify_link.self.cache_type_confirmed.True": {"doc_hash": "50acb026002d1593147287e0f2aac7118b28f8bef69200b4b009913c0d73a741"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_CloudCache._try_links_CloudCache._do_link.logger_debug_": {"doc_hash": "bc08e4efdc73c70df46b5ef972a025efaad3ec1cd88919ba7d1e665bb8eb92d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_CloudCache._save_file_CloudCache._save_file.return._self_tree_PARAM_CHECKSUM": {"doc_hash": "e4c50bfea4aa98ba40dd0bbd48a5e19acadfcd9e7668593ce6c2d9722f535c55"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_CloudCache._cache_is_copy_CloudCache._cache_is_copy.return.self_cache_types_0_c": {"doc_hash": "a1770917899e665d16055e9e33e4cb260eee5b4520753167b15b75c35a7d27dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_CloudCache._save_dir_CloudCache._save_dir.return._self_tree_PARAM_CHECKSUM": {"doc_hash": "93dc2a08abb258eb22acc61bc9f4ba92e80a0627a9f10cc502cbe608ab47e06a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_CloudCache.changed_cache_file_CloudCache.changed_cache_file.return.True": {"doc_hash": "80f8843afe8366564d0ecee0f1ce4c9ffdcd674de88277459c68273b16c4a93d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_CloudCache._changed_dir_cache_CloudCache.safe_remove.self_tree_remove_path_inf": {"doc_hash": "6159ce644ff73571803849eab0a2e5fbdaea1755aeffe338f6ea24ab6376c848"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_CloudCache._checkout_file_CloudCache._checkout_file.return.added_modified_and_not_r": {"doc_hash": "61c682d07440912b397ff092ac27be6c3233cde35c9672a2b1b24fb7ae918498"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_CloudCache._checkout_dir_CloudCache._remove_redundant_files.return.bool_redundant_files_": {"doc_hash": "2d99ae724d51eab71eb42276fa28011ec12669455974812252a0fca5155a4987"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_CloudCache.checkout_CloudCache.checkout.return.self__checkout_": {"doc_hash": "53a498bade2476700655a4f4ea611592fef2a832e023beaad8d9f9613363a754"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_CloudCache._checkout_": {"doc_hash": "d75e713434a1475938facb39ec7cf8f3ab445d90be04e60785032ae17c6e2382"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py__log_exceptions_LocalRemote.INDEX_CLS.RemoteIndexNoop": {"doc_hash": "8a72cf077d79562cb3cc3b6f2a0254b066260e69e3a9f51546ca48b424ae02b8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_LocalCache_LocalCache.status.return.dict_dir_status_file_s": {"doc_hash": "1a3ac552be194c6807a23e3e06f927512eccb7e19d2e0da680b3d3bd5ead7aa3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_LocalCache._status_LocalCache._status.return.self__make_status_": {"doc_hash": "75c29257ce3c4e0c651d394b3edacfbc78db78d536863952e700f117e72f5ae9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_LocalCache._make_status_LocalCache._make_status.return.dir_status_file_status_": {"doc_hash": "88527ad105aad56a15bf2989e9c292b62ca5ec85d19d80b009b61acd1d5d18e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_LocalCache._indexed_dir_hashes_LocalCache._indexed_dir_hashes.for_dir_hash_in_dir_exist.yield_from_file_hashes": {"doc_hash": "8ba01ed35e4de4b3efea3112e93a091f16756929f259cb213f9261556b67b5a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_LocalCache._fill_statuses_LocalCache._get_plans.return.from_infos_to_infos_nam": {"doc_hash": "a2cc269019bd5872d1886f733394557b8711efa7f48e57062bef70b579c46bd7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_LocalCache._process_LocalCache._process.return.len_dir_plans_0_len_f": {"doc_hash": "b9516bf0972d885c0416b664aed5b6b1c71e491f3977c6d23f874b4ccae4da33"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_LocalCache._dir_upload_LocalCache._dir_upload.return.func_from_info_to_info_": {"doc_hash": "7fc639e6980340186eab825a0f1d8158b2b2f712570e733f267cc32d35729afa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_LocalCache.push_LocalCache.pull.return.self__process_": {"doc_hash": "19ca1b049cf2abe99944dfcf73a7978d638d2742b013be7ad41152c57d470892"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_LocalCache._log_missing_caches_": {"doc_hash": "c3676992d163e47cb8b7de2adce8c3c12fb1053a57b19e5122a1c45766add740"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_logging_locked.return.wrapper": {"doc_hash": "a46014a7fe9c18882212bc1f3ca0828b1d41189363b7e4bcdb79fcf52dd97379"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo_Repo.__repr__.return.f_self___class_____name_": {"doc_hash": "ac0d3d590031e96d9626d87623f3504c5c0f0605589b9f650c8443b1639e163c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.find_dvc_dir_Repo.get_stages.return.list_dvcfile_stages_value": {"doc_hash": "250f153aae49964c38140c209161305efea4de7879aab946129e0a0909822f7e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo._collect_inside_Repo._collect_from_default_dvcfile.if_dvcfile_exists_.return.dvcfile_stages_get_target": {"doc_hash": "46eb514a3d798d4b267e95ad448a6b4fdd55549c3a7ecd9e3e4da4e1b9ffe14e"}, "/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.return._stage_None_for_stage_": {"doc_hash": "db6f7b070211cef825066f61053e1d12c25ee874f739d52cf4445fa6a4b61229"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.graph_Repo.stages.return.self__collect_stages_": {"doc_hash": "d589ed5e8c46f1b9496c8ca32c834b18e8d890288076afa9deb0f7804a95e454"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.plot_templates_Repo._collect_stages.return.stages": {"doc_hash": "5af277d2594dad800cb6e8ac8b6f353a0e42fd925d85db04382f0cdf446f5834"}, "/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.try_.except_IsADirectoryError_.raise_DvcIsADirectoryErro": {"doc_hash": "1f975707bc2fd3ba07e8f29ed65870bd931c8760ab6e8176c98ad6e42ba909c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/commit.py_from_dvc_import_prompt__prepare_message.return.msg_format_map_kw_": {"doc_hash": "60c625bdd49a44c7ee0d8c64155bc03c266ad021e081bd166db86e59c4a1247b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/commit.py_prompt_to_commit_": {"doc_hash": "da683674a9ddfe72de2414d802292832cc9f7cde8cef7c8c813a6e445e9dd1cd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/diff.py_diff.if_self_scm_no_commits__": {"doc_hash": "53a71c9a97150e839049aa6c994903820f70d09e33b03fcb5dd7d3bfb75449c5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/fetch.py_logging__fetch.return.downloaded_len_used_run": {"doc_hash": "deea21a6b41f04e614e7c12ad960810978a4392b5762f2850ca3eb4c085e0105"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/fetch.py__fetch_external_": {"doc_hash": "820700da9416eba9ccc85791d1c01fcc225e5fcad162784db5cbc48665478809"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/freeze.py__": {"doc_hash": "049748be1abe35cbe0ec3a42920f28db69f719aee9ae814c3db2dce06ece1934"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/__init__.py__": {"doc_hash": "b27073827941147a630ebf6b23e38ba4535ebc6f3784cf1a618d395890ad8efc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/__init__.py_logging_PropsNotFoundError.pass": {"doc_hash": "0ebedb9d8161ddd601a74be2ef58f999a1100cdd95e0c3f3380dd5c62bc95113"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/__init__.py_Plots_Plots.collect.return.data": {"doc_hash": "41912503a20ae244e720a6d47fb00cbd32a0500f651df2adbf550b76bdf27fb6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/__init__.py_Plots.render_Plots.show.return.self_render_data_revs_p": {"doc_hash": "e34ec2d7a4669e8f39570d7a9d58afe4a481a797a5342cd1164b0d94dc4138c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/__init__.py_Plots.diff_Plots.modify.dvcfile_dump_out_stage_u": {"doc_hash": "5fca46187d31b8d6879bea6bd367646bed6a28f90ac413f79527e315695a3704"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/__init__.py__collect_plots__plot_props.return.project_out_plot_PLOT_PR": {"doc_hash": "f81de47ba6aa23e9cb31182d56bf319128216931b323b461b7514575e4cd1a01"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/__init__.py__prepare_plots__prepare_plots.return.plots": {"doc_hash": "c78c28e77fd632a63cb259e890e555f9ef959c681c7c5158ef172ece0f2b03c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/__init__.py__render_": {"doc_hash": "28199aeecc8e00d5fea22f0ca15992e34a1ddc3f92b0255b29210caac50f9cd0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/data.py_csv_plot_data.raise_PlotMetricTypeError": {"doc_hash": "c51bc9ef22be22ec2efe94ba566e06f64a675f779b364c69bba9589d1c97355e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/data.py__filter_fields__filter_fields.return.new_data": {"doc_hash": "4a3dbd69f4d532b21153ab2ac1fa2d27754f79fadf575e0e399a8291d8a4f8cb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/data.py__apply_path__apply_path.return.data_points": {"doc_hash": "6022572256da39531619408837d795b49a7eba61af4337c16d99f224b35fec4f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/data.py__lists__find_data.raise_PlotDataStructureEr": {"doc_hash": "eb31d5f5b55142f739ad90f31c5660a76bd8886791dc54460da054fad60b26a9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/data.py__append_index__append_revision.return.data_points": {"doc_hash": "0bb21f6b1224b1583127c4cf8af56198aaa03a6d37a618325cd0a2409c818832"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/data.py_PlotData_JSONPlotData._processors.return.__apply_path__find_data_": {"doc_hash": "9d0e350ee0b12a545d252867fb37f517d4047e34f44965d2efb7d3ec866eb678"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/data.py_CSVPlotData_": {"doc_hash": "1a3d7fe4fefa3bf2949fcf78c021ab8b113b6e0837e51d536011299bd5a7344f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/diff.py__": {"doc_hash": "eb532ea4ae0163b820cca046894eced7c10502cec47935755549c49f3343f2e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/template.py_json_NoFieldInDataError.__init__.super___init___": {"doc_hash": "8c6bd7c6bb1a79264a173c5adaa10d1d2a05cd2eb88e69d2eb83c2766405fa6b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/template.py_Template_Template.render.return.content": {"doc_hash": "9fc9fb7f79ebc5af6b09fa9e486d205e5b1745ba547a059764b513c6b687d527"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/template.py_Template.anchor_Template._check_field_exists.if_not_any_field_in_row_f.raise_NoFieldInDataError_": {"doc_hash": "339b0fbd74d12ad4e0c0b67a56ef41de3ca37f92cee185d924db0533cdd2922e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/template.py_DefaultLinearTemplate_DefaultLinearTemplate.DEFAULT_CONTENT._": {"doc_hash": "65131b925f3d41cdc757f267a6e1d697d30623c70a9b3db11f961f78623856a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/template.py_DefaultConfusionTemplate_DefaultConfusionTemplate.DEFAULT_CONTENT._": {"doc_hash": "f00314e98e59e22bc26349a0be3b16536168c2e9149e89af024f8e20c52a378c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/template.py_DefaultScatterTemplate_DefaultScatterTemplate.DEFAULT_CONTENT._": {"doc_hash": "ccc096a6c4cb5fc0a072993b69a78ebce613f054d240ae0c4c2bb7d63d9af34f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/template.py_SmoothLinearTemplate_SmoothLinearTemplate.DEFAULT_CONTENT._": {"doc_hash": "79a09ecb040e8bcca9e5e57097d1d2973224fefd80e40e22c3c6caf6259c1ef1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/template.py_PlotTemplates_PlotTemplates.default_template.return.default_plot_path": {"doc_hash": "79ff93974cc88d034d4d1349272a68900e23abcd9025b2bc41207b363b3e73a4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/template.py_PlotTemplates.get_template_PlotTemplates.get_template.raise_TemplateNotFoundErr": {"doc_hash": "7a3e7fd06528546f2cc89896bd19ec01943c2ce305ade6ff6caff252c42f5aa8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/template.py_PlotTemplates.__init___": {"doc_hash": "4a6db02338b89bee1f6ef7805e29f6b4d9b0316e33ec8cba34071afcc41ed265"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/run.py_os_parse_params.return.ret": {"doc_hash": "35a2614041a12346ac3860da99d776618713fd0189c212ed3aa7c2cb8d3fb817"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/run.py__get_file_path__get_file_path.return._": {"doc_hash": "36d48de29581a768fef6d7ca4ecdd6e59551f6e0680480930cad0f8782c582e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/run.py__check_stage_exists__check_stage_exists.if_stage___class___Pip.elif_stage_name_and_stage.raise_DuplicateStageName_": {"doc_hash": "18797065315de3829336a4da65e09df658cbbc3f4aab820c46a3736d1ae5adc6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_DvcTree.open_DvcTree.open.return.open_cache_path_mode_mod": {"doc_hash": "34e3c27555244c6b1fce4ef98fd5e2a34e1f62a50758d99cfe2f377e7532779b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_DvcTree.exists_DvcTree.isdir.try_.except_FileNotFoundError_.return.True": {"doc_hash": "4e581b634751f844bb3c2efed0466788fa26feef6241a8c37e0e42b10ba5f8fe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_DvcTree.walk_DvcTree.walk.yield_from_self__walk_roo": {"doc_hash": "331c18c705d47c27569e1c7754e9edcc9b03fc17ce3ac0d634167a3a904239d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_DvcTree.isdvc_DvcTree.get_file_hash.return.out_checksum": {"doc_hash": "9eade10a817eb2fa8f38c7f4817b99f2bbcf642a6f7dcc2871b49ff9bb4b8610"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_RepoTree_RepoTree._walk_one.for___in_dirs_.yield_from_self__walk_one": {"doc_hash": "cd52992b11e89883f597e842aca8c66f090784dde51ae07a36ec337c6cae83c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_RepoTree._walk_RepoTree._walk.for_dirname_in_dirs_.if_dirname_in_shared_.elif_dirname_in_repo_set_.yield_from_self__walk_one": {"doc_hash": "9ad159656cad34b3148186e30375c4e90129431e4f46d7dabe08930df59aed64"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_RepoTree.walk_RepoTree.walk.yield_from_self__walk_dvc": {"doc_hash": "cf044d53d8bbd0dcd3ae19de96d04be3e45088ff47950a659b876ec8a2fb7231"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_RepoTree.walk_files_RepoTree.get_file_hash.return.file_md5_path_info_self_": {"doc_hash": "dfe92c688699c7e1c9f0caa0a63836065d05f3e764813237ae8911a0b6702c97"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_RepoTree.copytree_": {"doc_hash": "8830919d10061126d4a5b6109459b97f67a0e87fd0606de27bcdb66c7f5bb35b"}, "/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_f_prefix_ent": {"doc_hash": "00a376a8c69eb90911deddf6f0b1530ebc968d935bc62c98ffdc44ecd04fc8f3"}, "/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_f_unknown_": {"doc_hash": "b95acacfe56fb36248e5e222b8285e8977d4f8eac17986896aae1d66dc7c54ca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_GitTree._walk_GitTree._walk.if_not_topdown_.yield_os_path_normpath_tr": {"doc_hash": "9c99669e6bef1a675b4ec0dee37c4792d195144fca944755b26ecfac0971ab6e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_GitTree.walk_GitTree.isexec.return.mode_stat_S_IXUSR_st": {"doc_hash": "9e969e16cf4e03ab7e644dd524f2f7feb306f2e9ef75f026446113a30525aee5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_GitTree.stat_": {"doc_hash": "669002f11255f755c0ed8a1dc4a9f8a1cd66d45e24f1c36becf119fe15cbc902"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage_Stage.changed_deps.return.self__changed_deps_": {"doc_hash": "f467a8d0c4749282d1ce5163583ba96d572e536c7d768dc01fbc0bb2ca0b9cba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage._changed_deps_Stage.remove.if_purge_.self_dvcfile_remove_stage": {"doc_hash": "44877655ad9ec3c024aa874f7027fd054cee60958d44acb5ab3a4c0e52d3ca6a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage.reproduce_Stage.reload.return.self_dvcfile_stage": {"doc_hash": "b2e360d0f85e4cc977dea5adae9c2493394cafd293e3618dafc012f2f3909de7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage.dumpd_Stage.commit.for_out_in_self_outs_.out_commit_": {"doc_hash": "72899298671f2bac16d9c2d1a48e676db40e73491a7a9e40288d57a3b60f84ff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage._filter_outs_Stage.get_used_cache.return.cache": {"doc_hash": "a225d551ef5ce032896559d88babdb5de0e688c826e1212c699cd3e1ee7e21e3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/cache.py_StageCache.save_StageCache.save.dump_yaml_path_cache_": {"doc_hash": "54fc6e5abbecc13b40782dce4e7a06448b80cd7a48d4eab76579ec37c1a50ce0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/imports.py_logging_": {"doc_hash": "276eefacf77f906855739513df32a8aa4bc3d0273bf8a56ff8848317e184c63f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/loader.py_logging_StageLoader.fill_from_lock.for_key_item_in_items_.item.checksum.get_in_checksums_key_p": {"doc_hash": "42ba461771071dab0493990915bfcdaee7b03f9840eb78786ae17b1c87d8973d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/params.py__": {"doc_hash": "e0351c8f3a81b3066ef7049de8b935d00d6eb73b864d77ea2f2f42158334bcfa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/run.py_logging__nix_cmd.return._executable_opts_get_n": {"doc_hash": "ee0ffe8d76fbdd7ab16c5cd1dc71ed30b047707e5c97bde124a703f0262d50d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/run.py_warn_if_fish_warn_if_fish.logger_warning_": {"doc_hash": "7ba495ada6c96f1be1ccf290fef957430331c0e777dd576ea02edb3391ddfc15"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/run.py_cmd_run_cmd_run.if_retcode_0_.raise_StageCmdFailedError": {"doc_hash": "ba822208b998f02e28416541e5f3afc210b225016ecbfe3d4ac073ca7bdd915e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/run.py__is_cached_restored_from_cache.return.restored": {"doc_hash": "a661de91c3fd214bd82c4772c3d31bb35702ef229872efce4a57e572b48e40e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/run.py_run_stage_": {"doc_hash": "8c826484c25c7aef4e4b102698b7554d61a54e3b322dd74b3db3857ebb587aac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/serialize.py_from_collections_import_O__serialize_outs.return.outs_metrics_plots": {"doc_hash": "2dfcffe041dd1d219f0f81f9dec6f8ec31e72beec97126b14049ff5cffb32b25"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/serialize.py__serialize_params_keys__serialize_params_keys.return.keys": {"doc_hash": "4536718ec9682a7590462a7c09422994cb10d57f20182fe2bf09fb89acf4bc8e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/serialize.py__serialize_params_values__serialize_params_values.return.key_vals": {"doc_hash": "175726de9fe27b6cdc4d9b43783e912e1285b51a97c08300cbe8574cfb8c5d21"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/serialize.py_to_pipeline_file_to_pipeline_file.return._": {"doc_hash": "8749b710a0d10509a20af304c7225193a330c023408340fb14ce9975866f03ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/serialize.py_to_single_stage_lockfile_to_lockfile.return._stage_name_to_single_st": {"doc_hash": "108593d2c936272534409e89c7c8e4846203acaad76a2fe5d2d77e2e32dabdea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/serialize.py_to_single_stage_file_": {"doc_hash": "55ba9d22d3e5af16bd363e5ce9e82834942dbe423dd5b5c1abc7645a9faa99ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/utils.py_os_MissingDataSource": {"doc_hash": "1c57d80735a1b0efd26a782e9900d83ae2caa9bfa1cc1d42dbc12da3cf58d552"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/utils.py_check_stage_path_check_stage_path.if_real_path_proj_dir_.raise_StagePathOutsideErr": {"doc_hash": "61161bd8f3135c757d543e254bf83609eb8de4c0c49ffa2c277e461b5a4f112c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/utils.py_fill_stage_outputs_fill_stage_dependencies.None_2": {"doc_hash": "a09f5f8f956430f86c883d38fe8648280d70058e5257f9ae22696bd9b0f83c9a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/utils.py_check_no_externals_check_no_externals.raise_StageExternalOutput": {"doc_hash": "86df12b5faaa9a8a029fff45243e2d5680bfe4ac907c1d774fc6f8ed1fb6b30d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/utils.py_check_circular_dependency_check_missing_outputs.if_paths_.raise_MissingDataSource_p": {"doc_hash": "4a2f5f14559b84894cbce6152b16b519325e4358d9494f0a01446fc9434ed1a9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/utils.py_stage_dump_eq_stage_dump_eq.return.old_d_new_d": {"doc_hash": "0ccb08648661405421bb5e5bd2e1a95c8ce292157ec48d2806aa7ee4d9058604"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/utils.py_compute_md5_compute_md5.return.dict_md5_": {"doc_hash": "c0e956d3c1ec87de041d7f942bfde3bd8859adc8bfa81562f07fba75a94951e0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/utils.py_resolve_wdir_": {"doc_hash": "d8726302bdf44db91ad28382f781b0f56b4b729a26029e7af9ae93193330c356"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System._reflink_windows_System.reflink.if_ret_0_.raise_DvcException_refli": {"doc_hash": "4eaa7da8b1163a05af647e39b75bbab881e2642af3ad4519788baa896e4336e4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py__Helpers_for_other_modu__fobj_md5.while_True_.if_progress_func_.progress_func_len_data_": {"doc_hash": "bb82d19fdcd63b35759953b7c4c60045b5d55f958393ba181d24cfdb9f02b4d1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/http.py_iter_url_": {"doc_hash": "da19d5532a908000af48e274ac0f3c3a783851abd6ea57b1f989955b366d75d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/pager.py__Draws_DAG_in_ASCII__": {"doc_hash": "a87a98562a4153c977315743426e9e859841d6d80f8586ab07b5ee49f909b607"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/stream.py_io_": {"doc_hash": "1bc1d71f046fb0dc8af6b757c870494f1dfaf94e39883d469fe0eb92546d6727"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/yaml.py_from_collections_import_O_parse_yaml.try_.except_yaml_error_YAMLErr.raise_YAMLFileCorruptedEr": {"doc_hash": "2d9e6aab921d2a58ea2704a62c7b647a13585bb2f2c32c34b2e94d961889853f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/yaml.py_parse_yaml_for_update_": {"doc_hash": "9aca587f92398366df62fa334e6788492e8fc50951f580347059788084aac9c6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/hooks/hook-pydrive2.py__": {"doc_hash": "51590c6cde42a6727880f7e03eb2485eda04ed9b43925cc85059733dd9eeb777"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py_logging_TestDirFixture.setUp.self_create_self_UNICODE_": {"doc_hash": "965c04fe0bd7ed3e48b482956961a0c6f2a55e4227075e061595fab06b19e7cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/conftest.py_os_": {"doc_hash": "ff6d15f318e7b21c3f48d4f822c7eed5df407ec4ebd1661fcda67dbf2d769e15"}, "/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_test_metrics_diff_with_unchanged.assert_dvc_metrics_diff_a": {"doc_hash": "3ae385f231598d0de916cce3b2a9acacc6ae106f4ea19163eadb2cf3de8e2f85"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_diff.py_test_no_commits_test_metrics_diff_dirty.assert_dvc_metrics_diff_": {"doc_hash": "dd9a11f4d36af18f03505d2bd062ab36580ba41d8bcdfe51988359ac4cac61ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_diff.py_test_metrics_diff_cli_": {"doc_hash": "460162f0be61fdc8b875f979cb75b481aceddb3b98de17e895c330eb4a8e4f3a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_show.py_os_test_show.assert_dvc_metrics_show_": {"doc_hash": "3442e34400a40d9b76a34da2f6a0fc1d5e38f8e117433ba86e6dbeb7c5135492"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_show.py_test_show_multiple_test_show_invalid_metric.with_pytest_raises_NoMetr.dvc_metrics_show_": {"doc_hash": "c57502a0f333480eac8d5dbce9360e98c53b9a64cf3d978e6da04154febce78e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_show.py_test_show_branch_test_show_branch.assert_dvc_metrics_show_r": {"doc_hash": "522cd30a5df73ce71c81ca3bc79e6246cbde33cda2ee8c0f8e678ad6a3277b6e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/params/test_diff.py_test_diff_dirty_test_diff_dirty.assert_dvc_params_diff_": {"doc_hash": "cb6ced7cfe20811e3f02465493eaaaeb995e2e3141ed6b5af55c5e8847fc3a7d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/params/test_show.py_pytest_test_show_multiple.assert_dvc_params_show_": {"doc_hash": "faaa4f80de18da0775c6446791df2dbb0307794c68a7abd17c667534a232da90"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/params/test_show.py_test_show_list_test_show_branch.assert_dvc_params_show_re": {"doc_hash": "70d115404b8cfc59c4d000bd73ed2c167d339129b3c0ae8013da141f8636a2fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/conftest.py__": {"doc_hash": "091e43d172145ed0521625dd097079dbcbfe15a9827d8ecd51323538aeb8305b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_diff.py_json_": {"doc_hash": "eca7e413b71fbceff6ec58418f5b7d88ae61c32c007d4ac8847a0f3053797cfb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_modify.py_pytest_test_plots_modify_existing_template.assert_stage_outs_0_plot": {"doc_hash": "3c01ac31d34c262a3564a9b42d8e505f6e418ee9816e6cf3272d464b481b138c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_modify.py_test_plots_modify_should_not_change_lockfile_test_plots_modify_should_not_change_lockfile.assert_not_tmp_dir_PIP": {"doc_hash": "f9c1cd2b9d62e8d1009f27dae63452841d30e8221c8d9788993557b85d4084fc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_modify.py_test_plots_modify_not_existing_template_": {"doc_hash": "135d7aa304c2e7f18ea6690008b2b7f1c08e581853f90ff48882a5142e8adee9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_csv__write_json.tmp_dir_gen_filename_jso": {"doc_hash": "a19ce401569caf584af0036a4d173503dc4ba824659522b8408603c396ad1654"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_csv_one_column_test_plot_csv_one_column.None_5": {"doc_hash": "aae1de4c257c9a8f439375444ab15475602271bf5965b2b0b19df0b72e6e2407"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_csv_multiple_columns_test_plot_csv_multiple_columns.None_2": {"doc_hash": "257d8705077cb2e208b8c12466c2a06c2851f0fa020f426db74cfc7615adfcbb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_csv_choose_axes_test_plot_csv_choose_axes.None_2": {"doc_hash": "3576d678d7e7b39dd085b684c2b7da1b05eace7174e65a9703fc7c8562d42b7c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_json_single_val_test_plot_json_single_val.None_2": {"doc_hash": "d7566d0e300bc11a5619982ee2ac301a6925ffe4b63df7d976b1b94c3818a7cb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_json_multiple_val_test_plot_json_multiple_val.None_2": {"doc_hash": "ed8a22fb01cc67a60d5250693e59aadf4058ecd5029bc15f42a19b56d9dc6c46"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_confusion_test_plot_confusion.None_2": {"doc_hash": "cbfe948a629fbd6b02d848317cc4788fd1187030fbce66db262936c461b92fb7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_multiple_revs_default_test_plot_multiple_revs_default.None_2": {"doc_hash": "c67c250f44b453a2926d2defa7e545ae8d5c0648c6b514fb5c466b93387139df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_multiple_revs_test_plot_multiple_revs.None_4": {"doc_hash": "afcc53dfb52331eb0d06a381ba19680b35822a30c7ceb76b724e21b1e15265f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_even_if_metric_missing_test_plot_even_if_metric_missing.None_2": {"doc_hash": "830d003e299e6e5b791ec67c6550770aee21dfce64e45537196ddd7aff95cc8c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_throw_on_no_metric_at_all_test_throw_on_no_metric_at_all.assert_str_error_value_": {"doc_hash": "0803cbcccc9f116a887d6480dc007ccf978d41f7a22058df642f2e6f7b1220b2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_custom_template_test_custom_template.None_2": {"doc_hash": "020bb754eb81a580944b4aa1004321cda00354f2bd871211c9679568c95f1d4c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py__replace_test_should_raise_on_no_template.with_pytest_raises_Templa.dvc_plots_show_metric_js": {"doc_hash": "a4941a12c665a9f71fbd725f3e8afd08d8b5c8740b17691c17f54f716fbaae30"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_bad_template_test_plot_wrong_metric_type.with_pytest_raises_PlotMe.dvc_plots_show_targets_": {"doc_hash": "7019c973eafe0f8bbf6d388b77e7616a5dd0726d4d07910ed22d19b3d3e1c1fe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_choose_columns_test_plot_choose_columns.None_2": {"doc_hash": "b3fdca7eb95cd9912325bd8cfb63e847dc5a44841b93c5794116a467f5ca0b33"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_default_choose_column_test_plot_default_choose_column.None_2": {"doc_hash": "fa495966d45be0f1fefee35025ced3d90fa38a4548dd76d6131708faa6900cbc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_yaml_test_plot_yaml.assert_plot_content_data": {"doc_hash": "1ebf212b5cf96424c6f3cd0031a1a5458e23975521c7c54eb4e2f90f7c465333"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_raise_on_wrong_field_test_raise_on_wrong_field.None_1.dvc_plots_show_metric_js": {"doc_hash": "253d294358562e3af69fda5c0daf28f6a09a1168d363a7a6ae4b7b5d028dab95"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_load_metric_from_dict_json_test_load_metric_from_dict_yaml.assert_list_map_dict_plo": {"doc_hash": "08717ff05d2c521225bb62e9d471638e08b5111c52e04e970d6a29f6b4cc64e0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_multiple_plots_": {"doc_hash": "8076fe136a3bf58060a94107345d629a59c53f8c8c6753fdd00d92ec228d9e72"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_index.py_os_remote.return.dvc_cloud_get_remote_ups": {"doc_hash": "da633a5ab1cbd476c19b53896e426020896fd62728070a8c90692996d41e0a6a"}, "/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_load_yaml_foo_dvc": {"doc_hash": "ce5f628032679f9fb8f10631d4cea99889a8ae1ebe9e9b6a6eb5973970427447"}, "/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_path_": {"doc_hash": "685ea0d13493041f7383c209657e3bc425d3bc2a53b8222ec42dcc68052149a6"}, "/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_hash_count": {"doc_hash": "63c0aa129a410b985cb7980e58d04837060576f35ffa82f4ed8a102820491d57"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_analytics.py_os_": {"doc_hash": "cd1ff3045f823a579583cc5d679625c9f3cc2f2f531d0e89f8b3b6387c4a6daa"}, "/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_os_fspat": {"doc_hash": "fdcf736e620d03225cf1b706c7b530e8f651e3db4f9aa8724431e8cddccfcf20"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutSuggestGit_TestCheckoutSuggestGit.test.None_2.except_DvcException_as_ex.self_assertIsNone_exc___c": {"doc_hash": "8458286e11e37ce2ab6e9281e4f55c10ae0fe83a4a079ee3e30d1511fd5b3e28"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_checkouts_with_different_addressing_test_checkouts_with_different_addressing.assert_dvc_checkout_bar_": {"doc_hash": "c087fdea749e518ba17ed2a5f903d9a2890a54e21e49c71b0a80aec83c39edd0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_checkouts_on_same_stage_name_and_output_name_test_checkouts_on_same_stage_name_and_output_name.assert_dvc_checkout_co": {"doc_hash": "a63aced79b0b581dc6cc3a9f7a84dfcafa48ad6929b7e68c4ee27e09833ad5e3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_commit.py_test_commit_with_deps_test_commit_with_deps.None_1.assert_not_stage_outs_0_": {"doc_hash": "ea979e5ada39736753c3c49233094c9bcb7fcb75e6c1a9114cae296a81cb11ef"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_commit.py_test_commit_changed_md5_test_commit_no_exec.None_1": {"doc_hash": "1b87a89a5656ff937348923b5b938191fbea3bb3832d44ced2ff5aa944d15cab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_commit.py_test_commit_pipeline_stage_": {"doc_hash": "5e058265000f0763a0fa34eff27db724d4aebc8e42667b4fed1f32d53c0ba75d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_test_cloud_cli_test_cloud_cli.None_25": {"doc_hash": "457c40e04fbf871adb076461dc66b47d3078946650479686df613b86e019ff4b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_test_hash_recalculation_test_hash_recalculation.assert_test_get_file_hash": {"doc_hash": "c5bcbdf92055e3fefa35407df0d087615f32fdae281f0fb0da150c78fda15f5b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_test_verify_hashes_test_verify_hashes.None_2": {"doc_hash": "4a4574f09b2bb38781b227b150c6f0dfa21837c698572fcf73d838daabafd3dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_test_pull_stats_test_pull_stats.assert_Everything_is_up_": {"doc_hash": "f7390c3c10d6b55b01c9250eef9a21a535dbb913b824e090635dfce4b1c23809"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_test_push_pull_all_test_push_pull_all.assert_dvc_pull_key_T": {"doc_hash": "8d774a9f30521b6405c3037924601b3180e922bcacbf5b19ac7f332a50791040"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_test_push_pull_fetch_pipeline_stages_": {"doc_hash": "9a97bee28ed93f6fbd7718fc4456d0a1e4e288335b3387cd1864302db836f738"}, "/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_for_multistage_non_existing_stage_name.with_pytest_raises_StageN.assert_Dvcfile_dvc_stage": {"doc_hash": "69f6b73d03f0597fbc7b8d064b6531466c33480c228bae66ea102fe5d31c4be1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_run_load_one_on_single_stage_test_run_load_one_on_single_stage.None_2": {"doc_hash": "7440fd6fb90b75048beccfa9a37174cccdf9f72dfc3aec51fecbe49233e77548"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_remove_stage_test_remove_stage.None_5": {"doc_hash": "decc9b11da09e094662d1325484fbd4514c780a59f0b25ed6035c821582feeee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_remove_stage_lockfile_test_remove_stage_lockfile.None_5": {"doc_hash": "03826e575d76e8c75d4736b3178aafc42a0e78e25cd8efed0e4c35836c4317ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_remove_stage_dvcfiles_test_remove_stage_dvcfiles.None_4": {"doc_hash": "e572feab4e9bf3e891230264f887366f6a14b805c7b7295d1db0b8b59e05624b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_remove_stage_on_lockfile_format_error_test_remove_stage_on_lockfile_format_error.None_1.dvc_file_remove_stage_sta": {"doc_hash": "3124f9336477161b92a5245b0260e7c65e8ef803203362bdc3adb6f73f41efb1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_remove_stage_preserves_comment_test_remove_stage_preserves_comment.assert_": {"doc_hash": "ac873541c22c994b5a4cd4df49cc704ce4a59881d1f284a327a8be36652e6c74"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_dvcfile_dump_preserves_meta_test_dvcfile_dump_preserves_meta.None_2": {"doc_hash": "0e6b505165886423a005243f8f74cf58e93ad0773d9223484f4a00151a8728c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_dvcfile_dump_preserves_comments_": {"doc_hash": "8df75537f6eaccebc91b1034522a2f17d99b2f835551bcf5a307149ac001f9c6"}, "/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": "40539b20b8c1efba1867746904822ad4d5d0b85d1ceac9614aef316fd0a1ebe1"}, "/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__count_files.return.sum_len_files_for_____": {"doc_hash": "7c607764cafca014839b7c977aae9703da2e8fd39dc43e19662e5e5e3221900b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_test_gc_no_unpacked_dir_test_gc_no_unpacked_dir.assert_not_os_path_exists": {"doc_hash": "8b3c3261ad7aec55776580a81bbce0c2ecc0e3c9ec43dd725b21d3107c6fb290"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_test_gc_without_workspace_raises_error_test_gc_cloud_with_or_without_specifier.None_4": {"doc_hash": "34042117850caeadbb2818eaac44408c216f3d988f9bc44b0cf7f85202d3d94d"}, "/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_os_fspath_erepo_": {"doc_hash": "89bd2714f1fa3a0d9a789897adf5916560dbafc7d24003544493852c7979e312"}, "/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_os_fspath_erepo_": {"doc_hash": "56f3841e7e4936b9b78db7e59c7900df31471fe4f7890c42f8b0c2a611e2a101"}, "/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_from_non_dvc_master.assert_tmp_dir_some_d": {"doc_hash": "951a936a45946da42071a077b103e1bfac739b90f32ec46a20250ef8ebdc0c8c"}, "/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_erepo_": {"doc_hash": "943dd6f2a7a9b627487d54b415be66869af95c70283f9788463394c4f2e5f2cf"}, "/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_test_import_from_bare_git_repo.with_dvc_repo_chdir_.dvc_repo_dvc_imp_os_fspat": {"doc_hash": "5aff093508ad0c7533bc28ab7ff56cc1e433c7ac83c9fd8927789e21dd125474"}, "/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_5": {"doc_hash": "508aa6840811314cf011354d1ae4686115741cbb5ae699ce31f70ee21f884f54"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_lockfile.py_from_collections_import_O_assert_eq_lockfile.assert_previous_new": {"doc_hash": "777fc193bfb9d22cb0e7730c453d4f3328b1b04c47388871876547c0a38a57f1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_repo_dvc_only_recursive_test_ls_repo_dvc_only_recursive.match_files_": {"doc_hash": "1d25173a4b3408693de67ae21ac75377f0626d7e29c8f67f09a0c835ac2a730e"}, "/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_dvc_only_empty.with_pytest_raises_PathMi.Repo_ls_os_fspath_tmp_dir": {"doc_hash": "53db9b0c6d5ae4ed727caca9c78f6eb5eab5ad052776f5b4c1b181b999d68e7c"}, "/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_dvc_only_test_ls_repo_with_path_subdir_dvc_only_recursive.match_files_": {"doc_hash": "51eeeaa461c2d28f9c922d7cabbf70737d8a66bf8093338a21fb6ca67d1209b8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_dir_hash_should_be_key_order_agnostic_test_dir_hash_should_be_key_order_agnostic.assert_hash1_hash2": {"doc_hash": "0242e7fefa99c562c82fd6569cb394c9f3cc387892d355beff7c3219f8c0a08d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_external_dir_resource_on_no_cache_test_external_dir_resource_on_no_cache.with_pytest_raises_Remote.dvc_run_": {"doc_hash": "74dbec8a87eba156cef0239e9888f9199600b43e92a9bb92c1a7d17b3615b0de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_push_order_test_remote_modify_validation.assert_unsupported_config": {"doc_hash": "b0f647a39fdf441dd7368192447a50a823263f907913ed20a4eb84e3459365eb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_remote_modify_unset_test_remote_modify_unset.None_5": {"doc_hash": "1a17a4bde101831466bac3164bc810aa7072bbf6cad61b9c82d60bbd2b2c6de6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_remote_modify_default_test_remote_modify_default.assert_local_config_core": {"doc_hash": "6cf21c26e1aeb57f18001a0aacffa62510d44b50d624979185e78fdd9a49787d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_remote_rename_test_remote_rename.assert_config_remote_n": {"doc_hash": "bd1d94f9ddea8be6c6daad785a57d34134393d2466e8204c00e3b6d2ec3eb97e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_remote_duplicated_test_remote_duplicated.None_6": {"doc_hash": "f312c2020512ed04630995ac4f9f5599ebea7e4e6f3a4a19cc51a90c356fc92e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_remote_default_": {"doc_hash": "c248fb8595d2e200cedd12e603aab2d8bc41d6e8cc987404dbd37309545003b9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remove.py_test_remove_non_existent_file_test_remove_broken_symlink.assert_not_tmp_dir_sta": {"doc_hash": "841e70cf3d1e88caaec0d0d84978287a224a4dbd88755fc6bf47d324ac1f541f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remove.py_test_cmd_remove_": {"doc_hash": "b684b84a0719dfc6ae21deb9a87bf825b19550355b7585703a3e11745748960a"}, "/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_10": {"doc_hash": "5111a5468215a74b713407d1ba2f5ba5960d20eab8037c02b2fc939c16014d50"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_test_collect_dir_recursive_test_collect_with_not_existing_output_or_stage_name.with_pytest_raises_StageN.dvc_collect_some_file_": {"doc_hash": "84af0bdfab90e7ecbcde6e2408992de1b9b92487c0053bac35209220164092a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_stages_test_collect_granular_with_no_target.assert_list_map_itemgette": {"doc_hash": "ccfd4fcc66995aa780c63d59c84630e798c6b852be1bfc4a71d21d87880851ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_test_collect_granular_with_target_test_collect_granular_with_target.None_6": {"doc_hash": "184259c346d3d75d334d87bb95c8c2b550529cd22124997d30dbfc111c5de8d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_test_collect_with_not_existing_dvcfile_test_collect_granular_with_not_existing_output_or_stage_name.None_1.dvc_collect_granular_som": {"doc_hash": "b66fed6cfcc39463dfdaf5dc1003d073f056e645e444b52954116fdd2d943b24"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_test_collect_granular_with_deps_test_collect_granular_with_deps.None_2": {"doc_hash": "6035680cce3e4cb58ababc4ea50ab66d02940fc306d955b9930f2af938c4da91"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_test_collect_granular_same_output_name_stage_name_test_collect_granular_same_output_name_stage_name.None_6": {"doc_hash": "a5db9dba6d8d15875e69b5d45043c24930c52aa4417b30e7caf0121491d36f66"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_test_collect_granular_priority_on_collision_test_collect_granular_priority_on_collision.None_4": {"doc_hash": "22b243b0bfbefb02b70f914eba084dc437b800675baf1f52153945738e662efe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_test_collect_granular_collision_output_dir_stage_name_test_collect_granular_collision_output_dir_stage_name.None_3": {"doc_hash": "db5706257add0ce86909fc2383d044b137ab91a09a394fa23cc8f0012b6ad1f9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_test_collect_granular_not_existing_stage_name_test_collect_granular_not_existing_stage_name.with_pytest_raises_StageN.dvc_collect_granular_dvc": {"doc_hash": "ed6f57212f2626b634813cf7d38f3d486c6089253b68c7fdcbe68917f6facd73"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_test_get_stages_test_get_stages.with_pytest_raises_StageN.dvc_get_stages_path_PIPEL": {"doc_hash": "87e033447e47b64800a2d5bebb00740c07aabf7878c19bee50ef245d62423397"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_test_get_stages_old_dvcfile_test_get_stages_old_dvcfile.with_pytest_raises_StageF.dvc_get_stages_path_relpa": {"doc_hash": "831218fa5e3d53dac7cf8f9cf570750aaf8158aee9dcc866155ac332fe37d92f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_test_get_stage_": {"doc_hash": "433e5574400fd91cd7759b2e144a1b47934d8cd82cfac3755d91d9f31fce62ce"}, "/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_addressing": {"doc_hash": "d871c077c95190908b66341862034f15023550751c3ecdd4510774a47e8c76b2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproForceDownstream_TestReproForceDownstream.test.self_assertEqual_stages_1": {"doc_hash": "06431e6e30b2171d8692514aaf9bdffb0b403c6a7220462339c53a4e7fca8090"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproFrozen_TestReproFrozen.test.None_6": {"doc_hash": "04e6af0ac31276048a1d07f432cd661c7d12e232e739dd79b3915d5b8fc6682e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproFrozen.test_non_existing_TestReproFrozen.test_non_existing.self_assertNotEqual_ret_": {"doc_hash": "d6247ae6a2e808159c153378a0a5c8e378828db3ac5a40aa25b1151a3ae8ea54"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproFrozenCallback_TestReproFrozenUnchanged.test.None_3": {"doc_hash": "878d6536ce3eaf0da6040833809a52699b293c6d3aca5210358f437011733f1a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_repro_when_cmd_changes_": {"doc_hash": "ae3fc632d6056f5a44f70920ad0542bf18e2018f4747b54bbc084131bed38d0a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_TestReproChangedDirDataMultiStage_test_non_existing_stage_name.assert_main_freeze_": {"doc_hash": "34a4dc76542d7f9146a67c89d2d5184c947e7d0b71f982fc7cfa0fd4ec4408b0"}, "/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.m_assert_called_once_with": {"doc_hash": "972e8c7ed08f127f05ec5c0d83ee498bffe520071a2a2f61524b58183839f5e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_cache.py_os_test_push_pull.with_erepo_dir_chdir_.assert_os_listdir_erepo_d": {"doc_hash": "291a03278e8a9f2f71c51c5599fa69f138a7df29c3eb6a834f99ff0bd3ce59fe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_cache.py_test_restore_test_restore.assert_tmp_dir_PIPELIN": {"doc_hash": "81a0d052199d5c988ccd9ad5d18fa9aabf42b0ca73c31d42cca7730b4aec5b25"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_cache.py_test_save_test_uncached_outs_are_cached.assert_os_path_exists_rel": {"doc_hash": "6b24affd479194ae3ba33617b239891d179b0af910a6ee5fd43299d7054aca30"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_cache.py_test_memory_for_multiple_runs_of_same_stage_test_memory_for_multiple_runs_of_same_stage.None_8": {"doc_hash": "8b143918b68d9b186768144c7ee5c79ff36f76b77bb92d256ca5bfd84686ea61"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_cache.py_test_memory_runs_of_multiple_stages_": {"doc_hash": "30c6660cdc093b8b7f3ab557dcad2098ab24713adc5d9f554b30e055f9d6e7b2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_test_run_no_exec_test_run_no_exec.assert_data_": {"doc_hash": "063c3383f74882fd42aacceb1af3fe4880c288e97e2ac1c8ffda4d05efcaf8c1"}, "/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_stage_name_for_st": {"doc_hash": "f1c95fa167e5217c2d9616a852b9bacf24b0fdd2e9b8c5486b5164569fada59b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_test_run_params_custom_file_test_run_params_custom_file.assert_data_stages_re": {"doc_hash": "a7b9b856e1a7c9c2470dc1bd9858c253a1656fc9800629ee95f7be3671d803e5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_test_run_params_no_exec_test_run_params_no_exec.assert_data_stages_re": {"doc_hash": "c17f8e18847115cf9b8bd9b7f116819aa86b09311571a137bcae7414f7b6a4a9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_test_run_without_cmd_test_run_overwrite_order.assert_list_data_stages_": {"doc_hash": "06057ec025acbdecf77830bfa22f0421381fdb58e017d240f2a3c7bd4ccac190"}, "/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.with_open_gitignore_a.self_assertEqual_fobj_rea": {"doc_hash": "a5c8f4dc380feb250f4269c714aa4429feace1bc8b1396a59bdc7fd53bff8396"}, "/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_command": {"doc_hash": "192d49fea290e63e7d32e905a31331f27960f6ace07ac9a1619f29ac1435d98e"}, "/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_fo": {"doc_hash": "90058ffc43e32ce152bef0303cf5d62b36c164da823612b4e51b3e0508af2966"}, "/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_run_cache.with_open_greetings_as.assert_hello_nhello_n_": {"doc_hash": "e3efa2cba07db1963cd83ff32f728bdc31a8e89dfabcf28e9587ed76a022bcfa"}, "/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_test_should_raise_on_stage_output.with_pytest_raises_Output.run_copy_foo_name_dvc": {"doc_hash": "c92667704d2eb6328f2910b8061707a4952d0eda9063ac9e7e8daa817c826e1d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_TestRunDirMetrics_TestRunDirMetrics.test_metrics_dir_not_cached.with_pytest_raises_IsADir.dvc_run_": {"doc_hash": "81d4b12a9e503b6457b860d9f99a5e42e031546639a8fb01bc878f1c9c03b43c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_single_stage.py_test_run_force_doesnot_preserve_comments_and_meta_": {"doc_hash": "e49ed9a0dbe9ac2a5e3f2e3d6fa938d48d887136779e49106c0f3765846d9769"}, "/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.S3RemoteTree__copy_s3_fr": {"doc_hash": "0df4591b0d7b3d88298e6c666a5b24412ab0c46b5ca17fb4121e61052bf992d2"}, "/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.tree_makedirs_base_info_": {"doc_hash": "cc52e71200e33489672cbea7659c9389d2bce0f609fe42de02548ffcaf5073cc"}, "/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_os": {"doc_hash": "43cfb6bf8e09f9e485e2eb3d08027c623fb4f5519b124ea947b6c8c9b77aca9a"}, "/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_o": {"doc_hash": "5a9a7f4a2373213637e873443b05809e63bdfc2b78e1159b2ae953aac198d1b9"}, "/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_os_fs": {"doc_hash": "3016c419151aee067a03b5b113222e7b8153e2b9f60d3e815ff8dc2e4f21dc49"}, "/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_test_parent_repo_collect_stages.assert_deep_subrepo_stage": {"doc_hash": "5ca8b898c4b1f71ab3d9bb07b61d638cbeb37767089aca72b260a949d6040917"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_test_stage_strings_representation_test_stage_strings_representation.with_folder_chdir_.assert_str_stage2_f_s": {"doc_hash": "c52548e24b8f056e23038126e89d0ed1602a020627a9b63ca9074a3d5dce3a6b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_test_stage_on_no_path_string_repr_test_stage_on_no_path_string_repr.assert_str_p_stage_": {"doc_hash": "1c1b97262d2009ab870809c1d7f45ee269d9b0611f106ca25bd7a48d592de9bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_test_stage_remove_pipeline_stage_": {"doc_hash": "8f66d07331b7205f994f10b273ff9f0623d88f9ae6249c7bc22e48655e30a848"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_TestWalkInGit.test_branch_TestWalkInGit.test_branch.None_3": {"doc_hash": "df1dd8db7103ca04a2f95e4922708cfda2e4d365c481f72f7bdaf88128ed896b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_test_repotree_walk_fetch_test_repotree_walk_fetch.for_entry_in_out_dir_cach.assert_os_path_exists_dvc": {"doc_hash": "16a8a8b71c604bf29c2c6cb269cb2d2d78397d96603471f5f31b9ab7d725ba6e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_test_repotree_cache_save_test_repotree_cache_save.for_hash__in_expected_.assert_os_path_exists_cac": {"doc_hash": "b8b2a5743502aeb4fa2ae8e28d5bb76ea13d04ca2d6c58bd0ca489fce48c9977"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_test_cleantree_subrepo_": {"doc_hash": "140334f3c7645df329f68075d1b0d84c8006b195665095904a48bb208db81c42"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_utils.py_from_dvc_import_utils_": {"doc_hash": "81c1bfd7d53e1e4f0b060881458bea5f3435c6f3b3f6dbae25beea3104d565a0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/gs.py_GCP_GCP.should_test.return.True": {"doc_hash": "f849daed1af04eb5dd383f4cc610e3cfd2bb7ba5c41f7ddaf533d0574fcab96a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/gs.py_GCP.config_": {"doc_hash": "835d0eebf38868692414313596131a2bf24394835db06a0552f32f850bb8c07a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/ssh.py_ssh_server_": {"doc_hash": "94c7c63d6ad92d7734d64d92b22733d01fe12f8ab857e7f6e860c8959ae67249"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_dag.py_nx_test_dag.assert_cmd_run_0": {"doc_hash": "ebb9c155c2c658e74ffeed95baf4bbef6b158bd8cfd870c7aedbd209806c372d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_dag.py_graph_graph.return.dvc_graph": {"doc_hash": "c33238574fcb8bea9ea4df52498007031d328e20aab2b62c00760f4940adc544"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_dag.py_test_build_test_build_full.assert_nx_is_isomorphic_G": {"doc_hash": "8f7da3577c6fbbd09838efebb32434ad8e67b051ffb31b2321f16d37d5203d8b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_dag.py_test_show_ascii_test_show_ascii.assert_line_rstrip_for": {"doc_hash": "733d53dbbddf9302d4565c767f50ad55036f990179971c49580b955a152abbed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_dag.py_test_show_dot_": {"doc_hash": "3e965c5fec5c71eed4f7be654438bfcc27141720479b780a677127d7f074c597"}, "/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_show.m_assert_called_once_with": {"doc_hash": "7d0fa7b3bf526cca7d96970e3f28d63eda177ef8b656906d94e0f32405620ef5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_metrics.py_test_metrics_diff_precision_test_metrics_diff_precision.assert__show_diff_diff_p": {"doc_hash": "ba4473de76d46959d1a50e99ed499b8dad022c09cf538d4fc86c1c1dd44b7684"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_metrics.py_test_metrics_diff_markdown_test_metrics_diff_markdown.assert__show_diff_": {"doc_hash": "d8c8fdde02a03dff3b93e47aaad2a25e6e0a75386d5b71c3039fb9e43fd0c4a6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_metrics.py_test_metrics_diff_no_path_test_metrics_diff_no_path.assert__show_diff_": {"doc_hash": "a6baea8a2e9f52d5c802c8edc8aa81349b05bbfca4c623a787dae0f0d8026d7d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_metrics.py_test_metrics_diff_with_old_": {"doc_hash": "c5fdf4f036e54788827ea2befc590b701ee22710adb5246edfdd698b3835a054"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_params.py_test_params_diff_markdown_test_params_diff_markdown.assert__show_diff_": {"doc_hash": "d015a38fd43bdd65d3bb1b7bd19a192fe9d931cd0e070cf47ba5536bd6260903"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_params.py_test_params_diff_no_path_": {"doc_hash": "fe9584011a58fed96d4d8fcbfa33c24212e9a3e316dadb8bd6fb06aff630a5a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_plots.py_from_dvc_cli_import_parse_test_metrics_diff.m_assert_called_once_with": {"doc_hash": "4d0e3f6924b725f124cd3b1d8982a394e325589d674ee511fe6d51d3edfdb2aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_plots.py_test_metrics_show_test_metrics_show.m_assert_called_once_with": {"doc_hash": "4843e3ebca66a5de14487337a982e0127f563ce80600b9a9beff8bc4f68cb99b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_plots.py_test_plots_show_vega_": {"doc_hash": "eff749e9a58022129b77ff1638d0a003c7771ffc7fb6b86717c6d35864cae4bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_status.py_json_test_cloud_status.m_assert_called_once_with": {"doc_hash": "5505c758e05452ada4502f8fd23595dc20fd7df869f25ae2d579542e03be9450"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_status.py_test_status_show_json_test_status_show_json.assert_caplog_messages_": {"doc_hash": "daad21cb805ab845325f6a064261a6255197424453a24d1ab152bd6c50dad0cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_status.py_test_status_quiet_": {"doc_hash": "001713497fbdce7d191c10ccd53602e833aa4ab5413f008a9b743a4a19daee73"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_azure.py__": {"doc_hash": "815e61d1d88f720db211647649132f3d76a6877da3baa2ba24c61a9740228aef"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_params.py_pytest_test_loads_params.assert_deps_2_info_": {"doc_hash": "80845ffdddf97776639156245ef3a7167867feffd7cbf38f1baf7b2bf7ef9193"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_load.py_test_load_from_pipeline_accumulates_flag_test_load_from_pipeline_accumulates_flag.assert_not_outs_1_use_ca": {"doc_hash": "fbad427ebf571c6f311ccdc6b9e7ab0aca7c570f4d45f9a30f684c283a7847a6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_load.py_test_load_remote_files_from_pipeline_test_load_from_pipeline_illegal_type.None_1.output_load_from_pipeline": {"doc_hash": "d43a9f117acba5b5179fb045554a5936189468a08f44f07da43e818d77457211"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_load.py_test_plots_load_from_pipeline_": {"doc_hash": "35488a528494406c65f557d3a15fb62551ada296a707c9009e85003e60d717da"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_pool.py_pytest_": {"doc_hash": "f1b7c62d4de2441e3743a5e4a42fc81e98bdcb79fc5504e821ec96a94469172b"}, "/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_tree_path_info_hos": {"doc_hash": "d8fa0bb269ecff824e006155bb623e5310df6801616cf70faf32d805ccd57faa"}, "/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_tree_path_info_use": {"doc_hash": "1a042722717233d2e17c43da8bf709fd81dfd727d90041fbbdbd3de85d074e57"}, "/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_tree_path_info_por": {"doc_hash": "abb9b5ad6d002a84b98037d10288ba0210a90bb191b03a21bb12ca446988bd70"}, "/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_tree_keyfile_ex": {"doc_hash": "0f0713a8c29e4f046785d0dcc1df8f03918a557dc1ae77d2bd986d538c4e7ffa"}, "/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_tree_gss_auth_e": {"doc_hash": "137a20eb764eb4ea06e3cfc82e0f0623534390bca425b2cacf8538928ae46780"}, "/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.BaseRemoteTree_dvc_confi": {"doc_hash": "652e3ae19ba0db73af1bba3ba2bae1230907fd45d0386ec5188dfe8d2e2c6ddb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_base.py_test_hashes_exist_test_hashes_exist.None_2.traverse_assert_called_wi": {"doc_hash": "e47db5ce773be9e82c87ca64ea7170059f3d611b72f52255460efd6b64fa1f1c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_base.py_test_list_hashes_traverse_test_list_hashes_traverse.list_hashes_assert_called": {"doc_hash": "716f8bb03edc5f082a1a6d440f07d750345aa5f120a611a75cc7ce6c2d948bcf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_base.py_test_list_hashes_": {"doc_hash": "fd2695d62586b7e36bf1cd9319324dbb4572e0b9abbef3f3b3eb70b824ef982b"}, "/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_tree__auth_method_": {"doc_hash": "2bea250913ec902f8f1b61641880e29d11349d086e00954d35e61ac1495ac910"}, "/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_tree__a": {"doc_hash": "bd8d02e13c4d9c96a9002c7c102b6f9ca9f87b22f626c32be7cdfc481f13bb20"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_local.py_errno_test_status_download_optimization.assert_other_remote_hashe": {"doc_hash": "017c511a94180c874f964dc18adbbd28e5a2329918888d8333e2555bbdd342d9"}, "/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_tree_is_protected_": {"doc_hash": "18dbc7a5292170e85c115de54246adc18713db0e0b8541cd1d1042b6f6d1e149"}, "/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_hash_jobs_default.assert_tree_hash_jobs_": {"doc_hash": "7620024fde087ba63989b34eaf7f59a1b71b11632af60215092cc779b0b900d1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_tree.py_test_isdir_test_isdir.for_expected_path_in_tes.assert_remote_tree_isdir_": {"doc_hash": "571ae6250ede8c7469d7cd00370d48bc806f5e90ff2f6e808800ac739f01cfb2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_tree.py_test_exists_test_exists.for_expected_path_in_tes.assert_remote_tree_exists": {"doc_hash": "3bcd7d5e4a23b293e76710ba08dfb155237792e34381ed782e1fdb58a2cbbdc8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_tree.py_test_copy_preserve_etag_across_buckets_test_makedirs.assert_tree_isdir_empty_d": {"doc_hash": "5acc76581e7d2bd10d594877d4bcb04d2114037b82925daede60e5282baa6e4d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_tree.py_test_isfile_test_isfile.for_expected_path_in_tes.assert_remote_tree_isfile": {"doc_hash": "2bcac717753d90844a56c4d16c5d13292f6a591916b6bc73908b501165525883"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_tree.py_test_download_dir_": {"doc_hash": "dde453d66a5afbfaccc1811ae3142afe42abc895bb8200398b75000ca83843e6"}, "/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_tree_path_info_": {"doc_hash": "74aa4bf2a70dea93f23a351a6f5673185e7dfe5b518ffa93020965a2afff55e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/plots/test_data.py_from_collections_import_O_test_parse_json.assert_result_expected": {"doc_hash": "1653f002368f03a9365a0dfe2e79ef476f14b841b0b0a60b4cc87d360b15cebe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/plots/test_data.py_test_finding_lists_": {"doc_hash": "64cb31aeead01573a8d60f7619eca0b63a1bfce9f2831f8420c1df0c7d82b64a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/plots/test_diff.py_pytest_": {"doc_hash": "06f06c5c02a0aa59a63106755e2738a6f0500441fb62272e9ed0ed2b84f9f1d5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_repo.py_test_collect_optimization_on_stage_name_test_collect_optimization_on_stage_name.assert_dvc_collect_granul": {"doc_hash": "5c84b2a9a7f798f66b48362fe5c4d528ee31e8c8211f1d8efd02a1a2157f78df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_repo_tree.py_os_test_open_dirty_no_hash.with_tree_open_file_r.assert_fobj_read_fi": {"doc_hash": "ae91db762e2f6462c0fa3384c20cfa2dcf53cd10b717c41957bb7b91136ba69e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_repo_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": "6828b11e92f1cff0ccdcb0ce0056b0be9180cda4d562e5a0785051292d37cbdd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_repo_tree.py_test_isdir_isfile_test_isdir_mixed.assert_not_tree_isfile_d": {"doc_hash": "e0211f1516a9e752f8ef5dfc2056c4172630740955314a9e16b5920e353e231d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_repo_tree.py_test_walk_test_walk.assert_len_actual_len": {"doc_hash": "778bbad4bb00b4afbe632319a39b3b8f21c7275636cf7b1cfd3148b8d42aca4b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_repo_tree.py_test_walk_onerror_test_walk_onerror.None_3.for___in_tree_walk_foo_.pass": {"doc_hash": "04fc2763648045005e6390ced3343e3cda117dc8eb97eb7001b6e541641e9227"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_repo_tree.py_test_isdvc_": {"doc_hash": "f58904a04ec6116efff5da2a55db68579c65c921649a464b9316526b42360e5b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_tree.py_os_test_open_dirty_no_hash.with_tree_open_file_r.assert_fobj_read_fi": {"doc_hash": "1a84a6831739340f43d0cde07c31dbd817dba1417fc53bfb9e50d85513ea4113"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_tree.py_test_walk_test_walk.assert_len_actual_len": {"doc_hash": "297587d8db0539d672b730f99d7a6ccadf7ef6f6a67c146d40b2047f777a82f6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_tree.py_test_walk_dir_test_walk_dir.assert_len_actual_len": {"doc_hash": "521ea01173eb977c269c4c1449efca26e4b9e6fb21c73c40f64a48da5f2ac1cd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_tree.py_test_walk_onerror_": {"doc_hash": "28339e8e2ac49be251df8aac2a10bfbbf672bd2ee5d360587a9894c312d775ee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/scm/test_git.py_test_walk_onerror_test_walk_onerror.None_3.for___in_tree_walk_foo_.pass": {"doc_hash": "8d948c3f27f42df77650883aaf1e7384e5bbaa1656a9ed7251e2d51c45ad80b3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_cache.py_os_test_stage_cache.None_11": {"doc_hash": "09b2a9da6762a77b44d0008fdcf4e76bdc2eb1afc71d2e8143a8ff30e7a8336e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_cache.py_test_stage_cache_params_test_stage_cache_params.None_11": {"doc_hash": "0f07525c68f3fc0af6979fecdfcfb8a60f01796e25447b744aa516ae93296fe8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_cache.py_test_stage_cache_wdir_": {"doc_hash": "b83909242a61b6ea2f7b4cc16f4c06df6d76974255c06936dcc3245d736740dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_loader_pipeline_file.py_os_lock_data.return._": {"doc_hash": "6deaae0534842983f2718b51818d6c34a1fb98764c337db74afe018a67efbbee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_loader_pipeline_file.py_test_fill_from_lock_deps_outs_test_fill_from_lock_deps_outs.assert_stage_outs_0_info": {"doc_hash": "c7de2b0f929c528f5bbcfa8301d68dffddf5dd54cd14378ff7301a6da5f683d6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_loader_pipeline_file.py_test_fill_from_lock_params_test_fill_from_lock_params.assert_params_deps_1_inf": {"doc_hash": "2722edab3928f1d56bffd24418b3a347d1a818bfb207d0c862f001370a30fb9c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_loader_pipeline_file.py_test_fill_from_lock_missing_params_section_test_fill_from_lock_missing_params_section.assert_not_params_deps_0_": {"doc_hash": "4e35e951fddced6b82a122d8071800e173db446a396d32db9af393415775bb3b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_loader_pipeline_file.py_test_fill_from_lock_missing_checksums_test_fill_from_lock_missing_checksums.assert_not_stage_deps_1_": {"doc_hash": "85a3242e12451dbe98fdb9c2b3925899e4bdf05fb70bfd0658a60ecfae24acfb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_loader_pipeline_file.py_test_fill_from_lock_use_appropriate_checksum_test_fill_from_lock_use_appropriate_checksum.assert_stage_outs_0_chec": {"doc_hash": "07d5120c09f2b99ea268b6fb34cdd20a7205ff721feb839e1ab6b4fe34db6ba1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_loader_pipeline_file.py_test_fill_from_lock_with_missing_sections_test_fill_from_lock_empty_data.None_1": {"doc_hash": "dda4c62311e4c3fec8f41b521789329590272e9a60f225f9c77f5209d13cef23"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_loader_pipeline_file.py_test_load_stage_test_load_stage.assert_stage_outs_0_chec": {"doc_hash": "b7c4956458596f2aad2e42f61bcfa64cfb2437295ae7e5030111ca2e8642248c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_loader_pipeline_file.py_test_load_stage_outs_with_flags_test_load_stage_no_lock.assert_not_stage_outs_0_": {"doc_hash": "4cc3cba1c5356bd9bb07c12978a95931a2c31ff108158b8f42c57c7f49d1fa58"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_loader_pipeline_file.py_test_load_stage_with_params_test_load_stage_with_params.assert_stage_outs_0_chec": {"doc_hash": "139be59851d811cf8a4cec323cd689dbf820c615b9049c06641b37a8059ff286"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_loader_pipeline_file.py_test_load_stage_with_metrics_and_plots_test_load_stage_with_metrics_and_plots.assert_stage_outs_0_chec": {"doc_hash": "584403b510211e652c0bf1d070cc658e07487bdb237a01b98db1656781aa5b4b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_loader_pipeline_file.py_test_load_changed_command_": {"doc_hash": "d330dc0caecb1e3222264a98140770e1de1b297c9492577fc6dc3215b16c42d5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_run.py__": {"doc_hash": "28da4e62b144568e2dcc54e2e3182e16cb2f670749aab42f1f0a435636ae5b4d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_serialize_pipeline_file.py_os_test_outs_sorted.assert_to_pipeline_file_s": {"doc_hash": "91a4c8e563bd1fc579cc6c963b4783f026714b483b3a4b0be193cc4b1d494dc3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_serialize_pipeline_file.py_test_params_sorted_test_params_sorted.assert_to_pipeline_file_s": {"doc_hash": "abdff40f96f9a3c73ae400b9c2e34d21ba9d081edbe69f4afe93b267226a81e3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_serialize_pipeline_file.py_test_params_file_sorted_test_params_file_sorted.assert_to_pipeline_file_s": {"doc_hash": "22266fffb9394ed179516bb2e8a51254303a5d74fa3f4353fa04b7b4eb799f76"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_serialize_pipeline_file.py_test_outs_and_outs_flags_are_sorted_test_outs_and_outs_flags_are_sorted.assert_list_serialized_ou": {"doc_hash": "8c144ba2871e8439c1e03f5ee82db4de937cfb71eab0532bc802157531543075"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_serialize_pipeline_file.py_test_plot_props_test_always_changed.None_1": {"doc_hash": "9a333f269cfe8963f280cd2f414104206fa08f7f8bc790e74f0dd9836e8ec451"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_serialize_pipeline_file.py_test_order_test_order.assert_list_to_pipeline_f": {"doc_hash": "11794c988ab8d82e43a92dd2d2bea016ffb40814253a46105f793f32974f6965"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_serialize_pipeline_file.py_test_order_deps_outs_": {"doc_hash": "b743573f8126b7092ee56867afe57856a83d216a2f0642c8567169ed5e494914"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_serialize_pipeline_lock.py_from_collections_import_O_test_lock_deps.assert_to_single_stage_lo": {"doc_hash": "61d56e9dfb857fcd00e3c9b9ea35c019892ee5ceb7524d7e957bac64ed67573d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_serialize_pipeline_lock.py_test_lock_deps_order_test_lock_deps_order.assert_to_single_stage_lo": {"doc_hash": "c918f5549b238fc3a4cd4c9d3bff8850a411e85cb395e6eca5b6c57c7b0e6c08"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_serialize_pipeline_lock.py_test_lock_params_test_lock_params.assert_to_single_stage_lo": {"doc_hash": "8faf84149af91b85aff8a2b5c67c860a2e445bd42a72d620d8dcd35f58d5f875"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_serialize_pipeline_lock.py_test_lock_params_file_sorted_test_lock_params_file_sorted.assert_to_single_stage_lo": {"doc_hash": "ef627aff82ef4e81ea152145da83e1040de95bfe8ce6cc0fbcf3a742dfeb4c38"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_serialize_pipeline_lock.py_test_lock_params_no_values_filled_test_lock_outs.assert_to_single_stage_lo": {"doc_hash": "64dfad89d2ea1401170cbd30f0c64533d681e83415fa0041e020f2dfd209805f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_serialize_pipeline_lock.py_test_lock_outs_order_test_lock_outs_order.assert_to_single_stage_lo": {"doc_hash": "0a42ecfa1432c722f2167ebf13ca7069f33921353fffb1cf961d253ad04507c1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_serialize_pipeline_lock.py_test_dump_appropriate_checksums_test_dump_appropriate_checksums.assert_to_single_stage_lo": {"doc_hash": "b7c48576469c68ef270b63b62e85044a9c5d673584ee503f7402929cc686a62a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_serialize_pipeline_lock.py_test_order_test_order.assert_to_single_stage_lo": {"doc_hash": "5542c42af1b789022d086a8551238caffc755f23710e880d29bee23f554c9dc5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_serialize_pipeline_lock.py_test_to_lockfile_": {"doc_hash": "ce6de1ce520744cd304d7e6c5628af4c99345604660428063280703a3136be75"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_stage.py_os_test_path_conversion.assert_stage_dumpd_wdi": {"doc_hash": "7f7ed1b6ab22cd76ed3434fdb214d8b6a42648e09331764a9329350df8d5d1c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_stage.py_test_stage_update_test_stage_update.with_pytest_raises_StageU.stage_update_": {"doc_hash": "94eb89457ac6c879574ce844acf618e1fea2064045b543e07292be3dbf50d8d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_utils.py_os_": {"doc_hash": "20b54935bc2fa8200a57e819a4e7592f627c92f8ce8d1589b28e985b53c4262f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_dvcfile.py_pytest_test_stage_load_on_invalid_data.None_1.assert_dvcfile_validate_d": {"doc_hash": "2481c25c1834476be9cabcb390af2f72a74789b9b1d27db29138a8686eddf7e1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_dvcfile.py_test_dump_stage_": {"doc_hash": "450498179cf3cdc80568e95e4bddb8ce712167d7d5db900c87c961b17bd04257"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_run.py_pytest_": {"doc_hash": "c1a4818825ee858585d55177ed5ca76ba9db4a0f2404d0927dff924b104c95a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cli.py_get_main_parser_": {"doc_hash": "1a2121aba6fb2a785e697cfbcdbd0836ade31f425dad086ba21f92fa944ec97e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/completion.py_argparse_CmdCompletion.run.return.0": {"doc_hash": "816bf702d80e644be00b0021160926c321b45d47e7243f6d559861a0d08e2395"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/completion.py_add_parser_": {"doc_hash": "85c3703fe897325d2862e22e7801033ca5fc0998a88d0e3e97e2686c4f9d01fb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/daemon.py_from_dvc_command_import_c_CmdDaemonAnalytics.run.return.0": {"doc_hash": "c5e37598e94a766b83fd0a523e2723a7089948e134998e4a860a68d48ef0aabc"}, "/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": "433a4d217927e6738eaaa5b4b4218d897ac887dab54bc8cdcd1e1380efe14535"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/ls/__init__.py_argparse__prettify.return._fmt_entry_for_entry_in_": {"doc_hash": "958b846fadd4cdc3ced29dd444fc7af34ac2a95fd63c78b63ebefc18cf438492"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/ls/__init__.py_CmdList_CmdList.run.try_.except_DvcException_.return.1": {"doc_hash": "6313bcbbc015f0b0b06d6422058e950b86e4b26c6b72fd3a6325338a849e2988"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/run.py_add_parser_add_parser.None_16": {"doc_hash": "3942f6780e27c39e7a727bee36c262f2320a0ec8d9b9c8255b3c2c2a08dd786d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/run.py_add_parser.None_17_": {"doc_hash": "9e046e0ba2212a4c8c3cfd549c8226207da663d36d2004266c5c0cacf1b7f46a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/__init__.py__get_loads_from.return.__get_stage_s_info_copy": {"doc_hash": "96ee029095f01f2e501e6a57318fb433a5599a6860e45ac179af649b1c422a23"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dvcfile.py_collections_check_dvc_filename.if_not_is_valid_filename_.raise_StageFileBadNameErr": {"doc_hash": "331d61b85a2ec9ec2af3993bf57911275f81c806637672dccadc791a6dcbc4c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py_LoggerHandler_LoggerHandler.emit.try_.except_Exception_noqa.self_handleError_record_": {"doc_hash": "683b72a462856991b8311ee528ce0f8ebda48a04ae5e67bbcbbd411f00db2482"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py__is_verbose_disable_other_loggers.for_logger_name_logger_.if_logger_name_dvc_a.logger.disabled.True": {"doc_hash": "2268bc0ff7ed9842161aba3e4989ed3478bf1e8d103cd5050bb14a622b294d9f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_DvcTree.isfile_DvcTree._add_dir.for_entry_in_dir_cache_.trie_path_info_parts_N": {"doc_hash": "bfe479e1d649ba52d0b1849f7dd82bf1a57fc767b56dd2d3ca333ad308f5f783"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_DvcTree._walk_DvcTree._walk.for_dname_in_dirs_.yield_from_self__walk_roo": {"doc_hash": "b7d1ae8cc3aaef0baba1f6e443e546c2fb920561eef4c2da5a4dd8c4722e9353"}, "/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": "8456372b12e56264d685b0930484d6eba256683dea389d54ddff18656d9f963c"}, "/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": "a1c7f0137668f51b62610e57c2f913eff53d3f9da8ab8e00fedbf4a1f56fac1c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater._check_Updater._check.if_version_parse_self_cur.self__notify_latest_": {"doc_hash": "a72a31f42ce77f3266c79df3a8df9a61988b494a265d05d34a530d38a08b6b4f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater.fetch_Updater._get_latest_version.with_open_self_updater_fi.json_dump_info_fobj_": {"doc_hash": "e2bf9655939f97e5015d059ca6bf4afb6b9bcf65d089f81a790705b534f2ca6c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/__main__.py__Needs_investigation_py_": {"doc_hash": "c4a3c876e9013b4680f8e6dab9c4e985d3d7b2201bd96d66897d766d0c877fb3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_logging_test_cloud.with_dvc_state_.None_13": {"doc_hash": "c740a9e93299a6d203df6337dcfced9b2548c8d41223020a3e849920c135298b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_test_data_cloud_error_cli_test_warn_on_outdated_stage.with_caplog_at_level_logg.assert_expected_warning_i": {"doc_hash": "103706f88509957ad8ed584348b071f18d90190ef79658c01a1dff5435253c80"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_test_missing_cache_test_missing_cache.None_8": {"doc_hash": "ff3b1393199f2c4d264afb3facb33b4253e40951c239b3f1a4d325d77d191c96"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_stage_collection_test_stage_collection.assert_set_dvc_stages_": {"doc_hash": "0a31455f33267e5f4f7ab1e424656699909a3ee288f1fe78bd74038f15c7e428"}, "/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_test_import_stage_accompanies_target.None_1": {"doc_hash": "7bf5bf2fcc2825b17617209aab9852cad42a9b049e7569bb24388992200d47fc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_not_existed_url_test_ls_shows_pipeline_tracked_outs.match_files_files_ba": {"doc_hash": "42d971fe633fc5bb917c58879013e3983cf7b089004a9bae68ba7440cd057931"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remove.py_os_test_remove.for_stage_in_stage1_sta.assert_not_any_out_in_get": {"doc_hash": "a28737e831db9df237b1098343b9514ec7e90dd161e749a368ce4fbc590fbe7c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_test_stages_test_stages.None_1": {"doc_hash": "ea50c851d8828f751171beff7b438a4906e50e8a023bc41c0d762aa98040024e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproDepUnderDir_TestReproDepUnderDir.test.None_5": {"doc_hash": "345cbc5836409f252282728298d11eb56af97d368afe132070daea7ce8188dc2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_git_hook.py_pytest_": {"doc_hash": "02a9b1f4d547132f61ac9144b3cf629feb7496c7e43b2c9057d6ad35cc68ed7e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_load.py__pylint_disable_unsubsc_test_load_from_pipeline.for_i_out_in_enumerate_o.assert_type_test_func_out": {"doc_hash": "5608ee58dfeee1d988765567ba6119714475cf7722de2df913cef5bdedd0d223"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_run.py__": {"doc_hash": "38e628869171a0862cdb77e46a3bf5f54d0ea3cce29a71d7a3a81dcf1ad7270f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_stage.py_test_stage_run_ignore_sigint_test_stage_run_ignore_sigint.assert_signal_getsignal_s": {"doc_hash": "e008676dfefb8fa7ce737b474462fd8b655de7f21bca95dbc809a03f758986b0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_stage.py_test_always_changed_": {"doc_hash": "32a5b0fc619fd0dbe1ed5150f7dd91edb5a9a4ccf86161c389c8d0041156b6e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_updater.py_test_check_updates_test_check_updates.if_notify_.else_.assert_not_caplog_text": {"doc_hash": "d5e927ca6358769d3f99a5dda7d1d6e0c242abdd564d78cf42ce56a99e287483"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_updater.py_test_check_refetches_each_day_test_check_refetches_each_day.mock_time_assert_called_": {"doc_hash": "c001b33e096bb693fa4ea0b84cafa7bd634fd0c74d33bd8f69a6eb27804d7170"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_updater.py_test_check_fetches_on_invalid_data_format_": {"doc_hash": "67ed6705ed53af91c6cbb9a49875db60d5bdb31f4d5fcb29f3d66361dec6bbaa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_collections.py__pylint_disable_unidiom_": {"doc_hash": "4bd78cc114055673bffa93aeb03d989e4868169bff6e6e5dc54b21beab778086"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_add_parser_add_parser.None_10": {"doc_hash": "0875f0712ce07cae5f01eae637e1fd2b34435c6bd6f8f7d719f571bb919b0b6e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_add_parser.None_11_": {"doc_hash": "f770e1718f98dc8523cff4c6eff6bfd8cd1d567e8ad94ef6afb8fa2f3340fefa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dvcfile.py_FileMixin._load_FileMixin._load.return.d_stage_text": {"doc_hash": "23b243290a990c6121ef652b8c0c457e47b20d846f02a33e2e526023a91143c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dvcfile.py_FileMixin.validate_FileMixin.dump.raise_NotImplementedError": {"doc_hash": "da278741fb3eafc7df3136dfa8f3cb0e9bb65d835528226a800c911c7384d07a"}, "/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": "af14b9dacdec492bd7115f0e94cd2f77338e504d308448cbd96753f624cd130b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py_BaseExternalRepo_BaseExternalRepo.get_rev.return.self_tree_rev": {"doc_hash": "15410f5a7a4f63acfa8d0f5d7df6819545dde572819a1a3f3a0cf9e5426d9e3e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py__pylint_disable_protect__BasePath.isin_or_eq._pylint_disable_no_memb": {"doc_hash": "7bd6b3fc8c471693c9d2e020771058c6c7534c895929d0d8bd64472afb314f7e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_PathInfo_PathInfo.as_posix.return.self_fspath_replace_f_sep": {"doc_hash": "044dac3beaaee7da0c3ed353dfd2a0be5f1c711dcfeb7396058bd3f3f8fd6df6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_PathInfo.__str___PathInfo.isin.return.len_self__cparts_n_and": {"doc_hash": "e0e0ef14d4fff4f58e98c0c478212b4e0afee85f0d9fe12c3cf24b365ff6a65b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_show.py_test_show_subrepo_with_preexisting_tags_test_show_subrepo_with_preexisting_tags.assert_dvc_metrics_show_a": {"doc_hash": "f48f2818b9eabf33cd7730b37dc82389ba6240b4e686292120a4e9a11a68d43b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_show.py_test_missing_cache_": {"doc_hash": "08362b64ee5739108c3911840d7ee2faee255e744bf25ae71e96f025fa9b4064"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_add_external_file_test_add_external_file.assert_dvc_status_": {"doc_hash": "73e02faf478984ab1228955c84fe416687abb6947ef9307c5bc6e35e3831ff8d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_add_external_dir_test_add_external_dir.assert_workspace_cach": {"doc_hash": "6d67ef280439ef2012a077f17f91df4ef514eccb2833905a2173cfa107b6ad49"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_api.py_test_open_granular_test_missing.with_pytest_raises_FileMi.api_read_foo_": {"doc_hash": "a10d77306662570a28c2a688a7ba96dd364ac25bf42d466c2bdf060af0693c75"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_api.py_test_open_scm_controlled_": {"doc_hash": "6dd2ebe9ff1d41dbbef4193892f0691555c29228171642b61c6e1edfdc9bac33"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py__pylint_disable_no_memb_test_run_load_one_for_multistage.assert_dvc_reproduce_co": {"doc_hash": "3936a5bf7f71c436c094ff3e280b395a665b64fb804d81a2d078d51a3d20d373"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_test_gc_not_collect_pipeline_tracked_files_test_gc_not_collect_pipeline_tracked_files.None_2": {"doc_hash": "772e91695c9979ad28f5b0261b2a84f045235514b23ee1273ec57ffb26a3a0a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_test_gc_external_output_": {"doc_hash": "fc1230c5e33f9622a5a3e8ec10f9da3345d09f8df2f745ce20ca43d822708d3e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_logging_test_get_git_file.assert_tmp_dir_dst_re": {"doc_hash": "82d7ba69f705c84f5d9b33e7bd2d94ae7d28cf47b10e4830b34c2f0e69e415ce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_test_get_git_dir_test_get_git_dir.assert_tmp_dir_dst_re": {"doc_hash": "90da814316d78e6b26d4298f30659bffd61ae9d0f78ae8361ad84e5f2824e74b"}, "/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.assert_tmp_dir_dir_im": {"doc_hash": "c39b9e27d0a8cb944c98edfd23b03790fb5a8f03e75f48471abdd73b31ae3bf0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import_url.py_test_import_url_nonexistent_test_import_url_with_no_exec.assert_not_dst_exists_": {"doc_hash": "54e8d007b1f4ee72b7fd53b54f35ef9209bba8c4ffa2eed93237f1dcd4179e38"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import_url.py_test_import_url_test_import_url.assert_dvc_status_": {"doc_hash": "6f320faff1ba84c19f67e80ca7c0744093c9bb87be6d6433c52de0cd5b4d1cf3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import_url.py_test_import_url_dir_": {"doc_hash": "76408f7ed6840b7ad31364c7029b0cc78537eb9f71fc2be882cfa7ca2de70190"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_test_run_overwrite_preserves_meta_and_comment_test_run_overwrite_preserves_meta_and_comment.assert_tmp_dir_PIPELIN": {"doc_hash": "d8b7a0e2d8f1a5beb75f22de5009c5a11e76f7f229569522fe7bb546496f7f86"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_test_run_external_outputs_": {"doc_hash": "63e23089d56d9031a147b9d8e76617202f836cd764c81a6d5b0f9f2f4b3c0b3b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_update.py_os_test_update_import.None_13": {"doc_hash": "fae806cfb675cebe203e221a9db7085ac1271c9e78a5f348e19536c9719161a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/pylint_plugin_disable.py___": {"doc_hash": "9f4cf519cafb518dde52e1683abdd8b64e1a848d2644af38aa4b9f9fd306bf48"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/base.py_pathlib_": {"doc_hash": "ec790175ba59ce08843b7cffaa7a72cc5f5423d3938f18e388267899c7d9640c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/gdrive.py__pylint_disable_abstract_": {"doc_hash": "c06a72b7da38676c76af6d111f23d6ac9ff9ac714b3c10365e77eaa892512679"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/gs.py_locale_os_environ_GOOGLE_APPLIC": {"doc_hash": "ef93f328b3fae50d8537a1d8610e28ee70b1b43945aab640054cfe25d858351d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/http.py__pylint_disable_abstract_": {"doc_hash": "fb2d0780f10eb8fd692846e6cb66cfe2e5aa81dc606d8ba2f42e771cfde3bdd5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/local.py__pylint_disable_cyclic__": {"doc_hash": "a71a6610a398cf7f2de6a98c782f53c4c702e79e613ee2e869712226d370d4a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/oss.py__pylint_disable_abstract_": {"doc_hash": "1f77a968da1c86f1165ce04aa2ff9478c0f58d1f536dafffe81ef6c7b327a462"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/s3.py_locale_": {"doc_hash": "f0591ccd62bca83e31e5424d4b2ab8be9885fffa6c5f4372fe86b7c155a900da"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/ssh.py_SSHMocked.config_SSHMocked.read_text.return.self_read_bytes_decode_": {"doc_hash": "5ebf930c90bc4efe83386d8cf8b556ffd0f5e03a49a6e67370d5f7561d0e321b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_tree.py_os_remote.return.get_remote_dvc_cloud_c": {"doc_hash": "3b570b270cb56577b0f885f6707a3fa99653aac335df2ac0a439aa449bb63776"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/utils/__init__.py__": {"doc_hash": "c79568cd23740a0cf08cb4554ab3c586e12e3074971b9cc794a78972791eb3bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/utils/httpd.py_hashlib_TestRequestHandler.translate_path.return.path": {"doc_hash": "725eedb9774f443fb37afc4d2814ea4456e31d640ba7cc9e0e4e2752204be93a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/utils/httpd.py_TestRequestHandler.end_headers_TestRequestHandler.end_headers.RangeRequestHandler_end_h": {"doc_hash": "c22cd0a82b2a710ecb4fa9dd5f9dc346a1be811c6a2bbca658f5df98eeb0de0c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/utils/httpd.py_TestRequestHandler._chunks_TestRequestHandler.do_POST.self_end_headers_": {"doc_hash": "882516b40ac21da88afa6b021558f360e4820f326511a532304d36e2ace2b59c"}, "/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_hash_to_pa": {"doc_hash": "e516766db1338d02506ed320c361525659723d39736cbfb687fc7781348f3384"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cli.py__DVC_command_line_inter_COMMANDS._": {"doc_hash": "40087c059ca28a01c5488a8556a0e7dbfc6b4af2be7481999eb56850cc27a8ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config_Config._load_paths.return.Config__map_dirs_conf_re": {"doc_hash": "e445fb9a27cc4f151d7c1fdef6f1b0a8af7f8e3ba6f92cc943eb67014fdad4ce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config._to_relpath_Config.validate.try_.except_Invalid_as_exc_.raise_ConfigError_str_exc": {"doc_hash": "c8bbd3fd40d1b203393a60e17aba4b0625953b9db0feffb0cc4d76394950f049"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py__load_config_": {"doc_hash": "58a9983cb9752ce74c29666fca05005088a45ead972759f302799cd792d9202d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dvcfile.py_PipelineFile.stage_PipelineFile.remove_stage.dump_yaml_self_path_d_": {"doc_hash": "4e35cb0dfdff08e383b1b1e697d94f765b95ae0b711d1dad4c8d2bb34015b489"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_DvcIgnorePatterns.matches_DvcIgnorePatterns.__eq__.return.self_ignore_file_path_": {"doc_hash": "d09dc9d723803484f76a47c5c3fbd73e4a90eb87e8674ab86533c14cccc88dc5"}, "/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": "867d88d35cdee6893c5a761fc752ede5e2a029b23b02c747abc5fd32fa390807"}, "/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": "2b41abf3b0ba0e55c0a832586e39605d607ccbfc8e1ffb262219fefd43c38e4c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_CleanTree_CleanTree.isexec.return.self_exists_path_and_sel": {"doc_hash": "aa684b81f131f7dc887041d4a217eaafda85380a12f83adc0a4a2f863ebde11c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_CleanTree._parents_exist_CleanTree._parents_exist.return.True": {"doc_hash": "100d37537c737f6d4276c38b5b9308cc39b295541817ecc89e811fdb6e847143"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_CleanTree.walk_": {"doc_hash": "74980e4a5652cee9f9210625582c134108dcd3f4298f6d125919b82eba093ebc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_BaseOutput_BaseOutput.checksum_12.self_info_self_remote_tre": {"doc_hash": "0d9fd67de447f939d32ee5062b75ec565c8c9ce87f5ab22e23dc96aa90f53cc9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_BaseOutput.get_checksum_BaseOutput._pylint_enable_no_membe": {"doc_hash": "c8f4210cd73912f3b42ac563831184147f1bcde101e7e1f1037e3a871fec5623"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/__init__.py_posixpath__get_conf.return._resolve_remote_refs_repo": {"doc_hash": "e450c9e89fd496f70fe86419a692a88025b8ea219bc7703913f79cc143d96f16"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/__init__.py__resolve_remote_refs_": {"doc_hash": "58bf28980d0a9e39ad348786905f3900c5d30814fd5a8d846cf92309be5e79cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_logging_AzureRemoteTree.__init__.None_1": {"doc_hash": "860c74b5425afc983bbe30076438faed0385b4a84e19a33f6e74cda14b73a86d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_AzureRemoteTree._az_config_AzureRemoteTree._az_config.return.CLIConfig_config_dir_conf": {"doc_hash": "8ae727a9c97f652ff3ee949f14e9e3b0fa4e085a7025fb268bd9e9aceb28e7b1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_AzureRemoteTree.blob_service_AzureRemoteTree.blob_service.return.blob_service": {"doc_hash": "b944155f4ff1af0f2f0f605315db763597a9afa6bbf52fd6baa84f697d0c2549"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_AzureRemoteTree.get_etag_AzureRemoteTree._generate_download_url.return.download_url": {"doc_hash": "80b195b041139c0b9fab7def62602ecba04ac7c78cdf7c67c82ba2ac82d8ab13"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_AzureRemoteTree.exists_": {"doc_hash": "f92a5713ab5d838e3eee3ef19bac2e6105cacd36bb1b0c355ec69e1f8ae1a43b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_BaseRemoteTree_BaseRemoteTree.get_missing_deps.return.missing": {"doc_hash": "a00e3d01daab1890ca64bc7105bf9f32a2308b64df567824ede71fbeed829f02"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_BaseRemoteTree._check_requires_BaseRemoteTree._check_requires.raise_RemoteMissingDepsEr": {"doc_hash": "29c03609bf125cc270e27f0eb4afc2eb1aae58f8b28248943a92c09d121f08c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_BaseRemoteTree.supported_BaseRemoteTree.is_dir_hash.return.hash__endswith_cls_CHECKS": {"doc_hash": "75bdb4b8dc44f8e93fe92b869d3183e32b0204a8b730f3d365fd62f5b033e03a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_BaseRemoteTree.get_hash_BaseRemoteTree.get_hash.return.hash_": {"doc_hash": "221aba8cc935324a1689d10b8f7f6b7060e86d1fc8bd414244a542db88dffa74"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_BaseRemoteTree.get_file_hash_BaseRemoteTree.save_info.return._": {"doc_hash": "baffae4ae22566bb5e6464a101ce5f8f1c5bd58e3a5106b74966e4ef41a9250e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_BaseRemoteTree._calculate_hashes_BaseRemoteTree._calculate_hashes.return.hashes": {"doc_hash": "317b2fcc88e3c3b8ad2d748de901bbf53e6662901b292c595855ca5d70221cd4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_BaseRemoteTree._collect_dir_BaseRemoteTree._collect_dir.return.sorted_result_key_itemge": {"doc_hash": "657de6d1dcc0356a60b8d87a364cad147c07d870155eb2867c45a5092862c761"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_BaseRemoteTree._save_dir_info_BaseRemoteTree._save_dir_info.return.hash_": {"doc_hash": "449638222926b740e45e49ca09e47e8d70ccc3356dea7d5917870a37c628e5ca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_BaseRemoteTree._get_dir_info_hash_BaseRemoteTree._get_dir_info_hash.return.hash__to_info": {"doc_hash": "a1a550962b6ce4c6ec893e835f5dec0c8e2130819ab962893eccb9bff7d13394"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_BaseRemoteTree.upload_BaseRemoteTree.upload.self__upload_noqa_py": {"doc_hash": "cab7081b84fbc56afb0d393f3aa80c03924641b3b91f712b1e8e1e403986536e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_BaseRemoteTree.download_BaseRemoteTree.download.return.self__download_file_": {"doc_hash": "8b03b5f5e90d60b270f6bc4db69a0909ecabd51c07b5a23413967a5b3224cc11"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_BaseRemoteTree._download_dir_BaseRemoteTree._download_dir.with_Tqdm_.with_ThreadPoolExecutor_m.for_future_in_as_complete.if_exc_.raise_exc": {"doc_hash": "433313c8b6525ecd3dc1a9cc97b1bac37fdb7eb19874db121ab603a8981f556b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_BaseRemoteTree._download_file_BaseRemoteTree._download_file.move_tmp_file_to_info_m": {"doc_hash": "537ec3a9c0ada0874cef2c0e02ee3bc19a3dacdec0e62cc1627c41fed54f55e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_BaseRemoteTree.list_paths_BaseRemoteTree.list_hashes.for_path_in_self_list_pat.try_.except_ValueError_.logger_debug_": {"doc_hash": "c56aebee0de53843c95a1782de091dd16836604f50d5f8cb9f6d61c10f8ddc6a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_BaseRemoteTree.all_BaseRemoteTree.all.return.self_list_hashes_traverse": {"doc_hash": "52e3f275a059b8f1216d68ca879a0b74d2b41a7fa259217593f05122cbd3ad5b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_BaseRemoteTree._hashes_with_limit_BaseRemoteTree._max_estimation_size.return.max_": {"doc_hash": "a754da1a9e7a54d74e09a3578dbcadca36aec08de649a2d451ef4fba35449208"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_BaseRemoteTree.estimate_remote_size_BaseRemoteTree.estimate_remote_size.return.remote_size_remote_hashe": {"doc_hash": "ebad5a663bdd4b1af93ef2b08d4fe9c94a1694f322e9435cd8c7c9a5df280d34"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_BaseRemoteTree.list_hashes_traverse_BaseRemoteTree.list_hashes_traverse.with_Tqdm_.with_ThreadPoolExecutor_m.yield_from_itertools_chai": {"doc_hash": "f19219e315174340dde3983183b9f1ceefc7984375e5577d3006bfd915d76317"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_BaseRemoteTree.list_hashes_exists_BaseRemoteTree._remove_unpacked_dir.pass": {"doc_hash": "16274689ad52215d33cbb323971cb2bbc876aeefd0bb563829aa749d9ca69839"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_Remote_Remote.open.return.self_tree_open_args_k": {"doc_hash": "2798427471a865a12c8ba5bc13e8fb97bca4cd3816dc8536a16593af7502b158"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_CloudCache.save_CloudCache._save.return.self__save_file_path_info": {"doc_hash": "c0a53c106417a77387f06f701aa0044afb3b44f8b951233aa964b32f0586d8b6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_io_FOLDER_MIME_TYPE._application_vnd_google_a": {"doc_hash": "9764f448fa5759c51f817180dd2c0a290b0b4117e29c312b2580b29d2fe86feb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_GDriveAuthError_GDriveAuthError.__init__.super___init___message_": {"doc_hash": "9c1bd79e873398032613257d44c446a52dfa189cd1af02db00d0141ec3bdf522"}, "/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": "7531ca34eb086f88479c092fa3c589b5533703d2a900ed24c4b1b2604c81f1bd"}, "/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/remote/gdrive.py_GDriveRemoteTree_GDriveRemoteTree.__init__.self._gdrive_user_credentials_path._": {"doc_hash": "85742701dbadb22c071544057269f4cec5308fcf815d3e10a093350110b8706f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_GDriveRemoteTree._validate_config_GDriveRemoteTree._validate_config.if_not_self__use_service_.if_bool_self__client_id_.raise_DvcException_": {"doc_hash": "dc773ba5677f7b3d73c52c0f545a80f484e04a8c3c8962f555f357f936ba4eb5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_GDriveRemoteTree.credentials_location_GDriveRemoteTree.credentials_location.return.None": {"doc_hash": "f3bf808a619585d44ba2b84a6b41b7fb0f177aa215b31c75e771aa2b5868da32"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_GDriveRemoteTree._validate_credentials_GDriveRemoteTree._validate_credentials.if_not_os_getenv_GDriveRe.if_.logger_warning_": {"doc_hash": "43611b0c39cacd15897341f3b7023128653210963bfb12c253fbbdea4516db40"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_GDriveRemoteTree._drive_GDriveRemoteTree._drive.return.GoogleDrive_gauth_": {"doc_hash": "d4caf5b31857878fb5f53315297a442177302644c75fb83e5349953f602c7460"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_GDriveRemoteTree._ids_cache_GDriveRemoteTree._ids_cache.return.cache": {"doc_hash": "878d0f29d79be35debeae3381d15a6bd0eacabcb7c3acc611dc28bd1a09be24d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_GDriveRemoteTree._cache_path_id_GDriveRemoteTree._list_params.return.params": {"doc_hash": "90153644573a9aeed48f8daaffd2bf9e2f3c16b3db2a7eab84fb5b9d5c34c9e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_GDriveRemoteTree._gdrive_shared_drive_id_GDriveRemoteTree._gdrive_shared_drive_id.return.item_get_driveId_None_": {"doc_hash": "a3d3170f610485e9d2b8bb02038bd64345c15dfe69311529ffadc7763e1bef82"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_GDriveRemoteTree._gdrive_upload_file_GDriveRemoteTree._gdrive_upload_file.return.item": {"doc_hash": "f6c7ea42db433cc8e4fe4c18868c9f9f546d647e686e6115fb7c2b5f18810f58"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_GDriveRemoteTree._gdrive_download_file_GDriveRemoteTree._gdrive_download_file.with_Tqdm_.gdrive_file_GetContentFil": {"doc_hash": "9b187166777beff5aa63e5d3cd3e94426abd35bda00686cfe0adbef72a0c1f40"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_GDriveRemoteTree.open_GDriveRemoteTree.open.yield_stream": {"doc_hash": "f8637bc3548bff2e47716c01fbb89088fb3a7a86a52d218b8c704d9a1d42106b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_GDriveRemoteTree.gdrive_delete_file_GDriveRemoteTree.gdrive_delete_file.try_.except_ApiRequestError_as.raise": {"doc_hash": "3e4049dea4d6851aa3a32f354c9b85788394472fc1b2803abf66251bf122d4d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_GDriveRemoteTree._gdrive_list_GDriveRemoteTree._create_dir.return.item_id_": {"doc_hash": "9a6ce7eabd0d2f14ab6d9179af3ab2cae0bad7c2edffdc5b81f8ab6c81c29918"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_GDriveRemoteTree._get_remote_item_ids_GDriveRemoteTree._get_remote_item_ids.return._": {"doc_hash": "afc5c49d1f17f44e66c402fde8d37d87aa460a48fde11b36114ee7416781eb57"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_GDriveRemoteTree._get_cached_item_ids_GDriveRemoteTree._path_to_item_ids.return._": {"doc_hash": "03cc41c43a9ca629e7c7e8abbe721c5026b6b3dd31d3c45a9a3fd041f3033fcc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_GDriveRemoteTree._get_item_id_GDriveRemoteTree._list_paths.for_item_in_self__gdrive_.yield_posixpath_join_": {"doc_hash": "645ef6ebded0e4beadb3e21b6484089ba90b11e9b9e53f0ebe4a996d7a8d1e44"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_GDriveRemoteTree.walk_files_": {"doc_hash": "68bbd30992daaef20c24cbebfc3ebfc245bb4a53aa3466d3f7636b2d3663ee26"}, "/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": "9c7169bdd02fc79467f072a7b267c42699681cba24dde8067de3b20f516a6587"}, "/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_open_from_file_mode.with_Tqdm_wrapattr_.blob_upload_from_file_wra": {"doc_hash": "528c54b0a37bf19476183b646d20a0b4bb89bcf61231043d54353c87713c0707"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gs.py_GSRemoteTree_GSRemoteTree.gs.return._": {"doc_hash": "de154f53fbb6e2aa4b66f07bb9b43295a7d36956754f91e1d319f3dd5f23503f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gs.py_GSRemoteTree._generate_download_url_GSRemoteTree._generate_download_url.return.signing_credentials_signe": {"doc_hash": "5e202c5e8d8b30cdb80458612c54b9ce71db3d5d4df2063f155c1683337b27d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gs.py_GSRemoteTree.exists_": {"doc_hash": "ecb5626e0472e74699669860232e5edfb81fc7068d15c03115ec2b11b3c894cd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_io_HDFSRemoteTree.hdfs.return.get_connection_": {"doc_hash": "ce60208595ac7bab2bce5e70de4cdbb89e235afe850abcd3823266ec07241f47"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_HDFSRemoteTree.open_HDFSRemoteTree.exists.with_self_hdfs_path_info_.return.hdfs_exists_path_info_pat": {"doc_hash": "8191ffaa2de8c637ccc7d314873aa5df618e482f47cf1bcc5b14b2728c397c37"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_HDFSRemoteTree.walk_files_HDFSRemoteTree.walk_files.with_self_hdfs_self_path_.while_dirs_.try_.except_OSError_.pass": {"doc_hash": "086ff790d05248f011c8fa57dd1b4782c8cd14b04781188a8a40a4fc0ebc2ec8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_HDFSRemoteTree.remove_HDFSRemoteTree.copy.with_self_hdfs_to_info_a.with_hdfs_open_from_info_.try_.except_Exception_.raise": {"doc_hash": "f187461a9e932e5ad69417588c3f14aeb21d767410f10101205ad4850afa2a7c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_HDFSRemoteTree.hadoop_fs_HDFSRemoteTree.hadoop_fs.return.out_decode_utf_8_": {"doc_hash": "3efe1ab3f9c2f0a2b4ee58fcb0316ced7a72363a0fbda43482169fae314e0051"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_HDFSRemoteTree._group_": {"doc_hash": "935c3cb05124cefc3a59cb3864e077db68d2853787659c20732051f03433c3d2"}, "/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": "7a0be9ebe6fce69bf4d0e791432ab01e912295f616c8ed13a9de8bd440bece4e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_HTTPRemoteTree_HTTPRemoteTree.__init__.self.headers._": {"doc_hash": "59f90d1db873323037fa4690d970e641472e49dde184ca53406a8acad9a8c1c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_HTTPRemoteTree._auth_method_HTTPRemoteTree._session.return.session": {"doc_hash": "a3db31343c5d9178a9f28806dc204bee9c1de0cdad489b8f31642c4d6754ac47"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_HTTPRemoteTree.request_HTTPRemoteTree.request.try_.except_requests_exception.raise_DvcException_f_coul": {"doc_hash": "3e1eabc5fb37cb4f9d2aab56ac371e7436e1915b919173ba75502f52722c7e47"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_HTTPRemoteTree.exists_HTTPRemoteTree.get_file_hash.return.etag": {"doc_hash": "1b8344490f4e05b4ef82f35b47ec0c54a4927306e351c75f49555845ef10a6cb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_HTTPRemoteTree._download_HTTPRemoteTree._download.with_open_to_file_wb_.with_Tqdm_wrapattr_.for_chunk_in_response_ite.fd_wrapped_write_chunk_": {"doc_hash": "43887b79d249b2f6169c76eaee33bc274b837c29790472e456e9670da3f17135"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_HTTPRemoteTree._upload_": {"doc_hash": "d4831de789b301dafc557e360799e243230960230fdec75f399ca2eab305a917"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/https.py__": {"doc_hash": "48d504983c7a051fba8e852a961eda3c778bbe1c4bd8bf4e6de3475e169ace4b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_LocalRemoteTree_LocalRemoteTree.symlink.System_symlink_from_info_": {"doc_hash": "6c343973dadb85290bb3edb00b721b2831d68db51406319070d12134b6afb535"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_LocalRemoteTree.is_symlink_LocalRemoteTree.hardlink.System_hardlink_from_info": {"doc_hash": "60f0ae8877a68128535b0e6bc396e662c7d7d48789baa0ea827d231d7cf3b075"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_LocalRemoteTree.is_hardlink_LocalRemoteTree._unprotect_file.os_chmod_path_self_file_": {"doc_hash": "135fced6e32c206bea916ce9f757b7bb774d5de093460cc71570f63cc36903d7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_LocalRemoteTree._unprotect_dir_LocalRemoteTree.protect.try_.except_OSError_as_exc_.if_actual_mode_.raise": {"doc_hash": "a60f989c34d6095532ead35898fbd84f04f8a9a8bd6a2e5be42ded8fbae5e677"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_LocalRemoteTree.is_protected_LocalRemoteTree._remove_unpacked_dir.self_remove_path_info_": {"doc_hash": "0b1f707c02465a02dcf78e210ffb910f97260b66c611819a56f53c2e90bd7fbb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/oss.py_logging_OSSRemoteTree.__init__.self.key_secret._": {"doc_hash": "11051c3e57d5371cb01c9bea5e5a1eaf8222d64bcdda8a94bc2c90d01c99dd2e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/oss.py_OSSRemoteTree.oss_service_OSSRemoteTree.oss_service.return.bucket": {"doc_hash": "36ee87701827ea1feb39669f5a412c4fe0865baa0b111e12aa89bfe647cd90a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/oss.py_OSSRemoteTree._generate_download_url_": {"doc_hash": "1367ade70c980dae3c471c78aec772ba786300e7fd5ecd426a0f17d24d0758a0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/pool.py_threading_close_pools.get_pool_memory_clear_": {"doc_hash": "cbb3b6b87d6c8a1aa7b1b6cc1633a58367d49dbe157cf151fcd7bc2affcbf57e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/pool.py_Pool_": {"doc_hash": "2541fd566740ffb9782fe2a73ccb813860bb0c03cda3b3c174ee731a0af6fe63"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_logging_S3RemoteTree.get_head_object.return.obj": {"doc_hash": "4e42b9460a5fd33092ee0d0dc9b208983dbe144a473650a6c42c375316cb6aa4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_S3RemoteTree._append_aws_grants_to_extra_args_S3RemoteTree._append_aws_grants_to_extra_args.for_grant_option_extra_a.if_config_get_grant_optio.self_extra_args_extra_arg": {"doc_hash": "81d8db4fbeb830011d9432784078f0b17852e0e39a95cccc7546b11e94bcea65"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_S3RemoteTree._generate_download_url_S3RemoteTree.exists.return.self_isfile_path_info_or": {"doc_hash": "8fcdbcfa92d7a7417a3c70728d9d97a673921cf9ce822abf77f10123e037a429"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_S3RemoteTree.isdir_S3RemoteTree.isdir.return.bool_list_self__list_path": {"doc_hash": "e1fdba02b97b2fe1e78e6a92e81e825375944df9539412d16a8e2ac5ec6112c5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_S3RemoteTree.isfile_S3RemoteTree.copy.self__copy_self_s3_from_": {"doc_hash": "dc2a884e8942c94e5a8c535edb511d2b31c565e37254f8d07b2d3515badfcb7c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_S3RemoteTree._copy_multipart_S3RemoteTree._copy_multipart.s3_complete_multipart_upl": {"doc_hash": "47a168d4c851f936e4788af68a6dab4b7c2f0613d9e95fd9a25c1350b0e259f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_S3RemoteTree._copy_S3RemoteTree._copy.if_etag_cached_etag_.raise_ETagMismatchError_e": {"doc_hash": "1cecba9dda51aac453cc48e5626b6d31a27f5a9125003ff2911ca7622637dc91"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_S3RemoteTree.get_file_hash_S3RemoteTree._upload.with_Tqdm_.self_s3_upload_file_": {"doc_hash": "970f2c7b8195a95a06df81fcde119eae8d31ad81600b6a1cee587b4d3fb7b817"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_S3RemoteTree._download_": {"doc_hash": "eb56abdd164bf2bb60f2e247e2e80eb7a35f1c360861137270d86194787d61c6"}, "/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": "9408160b0431274e9fb18752a7d4ad3b952e9b634121967954d73d9fb94f012f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_SSHRemoteTree_SSHRemoteTree.ssh.return.get_connection_": {"doc_hash": "f08df5cf04bd204b89eba1410105f4e56b5b94ebd9ce153e1a67c88e130f2fb9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_SSHRemoteTree.open_SSHRemoteTree.symlink.with_self_ssh_from_info_.ssh_symlink_from_info_pat": {"doc_hash": "4889767e83107aabfe70dd057fa8211db55c9a013a7b5d1cd4484038d344ef4e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_SSHRemoteTree.hardlink_SSHRemoteTree.hardlink.with_self_ssh_from_info_.ssh_hardlink_from_info_pa": {"doc_hash": "c9493bbcf98e1e9581cdc678274ac1d793b279897aaf1bdc54bb23473503208a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_SSHRemoteTree.reflink_SSHRemoteTree.list_paths.with_self_ssh_self_path_i.if_progress_callback_.else_.yield_from_ssh_walk_files": {"doc_hash": "1114175c2f73666834d438134c30a5842bc8c18d70f4b785c0e950f3d4ffe2f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_SSHRemote_SSHRemote.batch_exists.with_self_tree_ssh_path_i.return.results": {"doc_hash": "e0a483f2ef369e798fcab07e58905ce0f3240c4d090fa4fe6b95c46c007d2721"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_SSHRemote.hashes_exist_": {"doc_hash": "03c8983ba0362f2d161e00be53d858afc8ba657e7caddc6adb789d5849828dd3"}, "/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_format_num_": {"doc_hash": "d0d7ed797d29678c4ff5c29d514a494b14bf86835b4c0f1432bb8ca5486b90f6"}, "/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": "c9232d18a36ac0f6be400a7bb691542c4ac8815d23083c18ce1a44db64f84a33"}, "/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_OSError_as_exc_.if_exc_errno_errno_EAC.raise_DvcException_": {"doc_hash": "2de9285fc461affd62fa664e54cfc554e548b9feaf10c1c8a7f16b3e835dd69f"}, "/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": "e8f804f0861d3839318b383ad38e985f1d62fc94e5385c3c2d68aa71779f614e"}, "/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": "677ce5854177dc49f1c2f745d370253cd7b97e215c6a72aef2c2a07169f113dc"}, "/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": "ec967cf898986316766dd3e5ec53befb45b01c28a7da10e326822d1c42199459"}, "/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": "279ddf16d38ca94ea2fb638a1405e30ea3031f97c18e3de52f6eae60f049466c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.copy_": {"doc_hash": "d68e27805bd7ac26c98a61da238d07c89ac0529bcd627e485d67d2f2c99426e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_logging_DvcTree._get_granular_checksum.raise_FileNotFoundError": {"doc_hash": "cbcf4c5e800e9c61f6d723e043efcdac1dbaba498ac78b5e890756283b379299"}, "/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": "de986fd5f6fca35731726c1f8106872e64986cc728c53afe299f0aded1bf8315"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/tree.py_os_BaseTree.walk_files.for_root___files_in_sel.for_file_in_files_.yield_f_root_os_sep_fi": {"doc_hash": "26f5dcba948530b5eebe6773b370033c41c09b1c9c771ff5c71eb1addb34a6e3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/tree.py_WorkingTree_": {"doc_hash": "532b4fb36f029e6f3e3ed2a623b462e85a0d3bdef111821fcfe37007aed86bcc"}, "/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": "5e134136bd4f6b91e895d4171c578a6dae0fb5b34ba83495327565454a14f8f7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ignore.py_os_test_ignore_unicode.assert__files_set_dir_": {"doc_hash": "647a4d447311956ba47e110e0d451ed5b69a70b95bbe0bc99e774ca645b2884d"}, "/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__files_set_test_ignore_external.assert_result_y_back": {"doc_hash": "ce118c55eea2b04fe18bae4a7c9a1d685ebd8c8d9f6f9826f81762fa60a7fd8a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ignore.py_test_ignore_subrepo_": {"doc_hash": "88337e6f5d900b63e4e060cc01c47489a84fb78e4149bd27d89178a2e748c03b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_granular_": {"doc_hash": "e142e21d5939f1ec5185fb2bb6a0fb1956c66823e0d3da5be96baf4d8b968f61"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_os_TestWorkingTree.test_isfile.None_2": {"doc_hash": "2e2de2a3f5df47a673c029043ab843afc953d34cd04aad148511a812dc602977"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/__init__.py_pytest_remote.yield_cloud": {"doc_hash": "e504fce2ff2d9f92273d07b38ee3c2b13cbb19d1b1e009dcc6c46235f2f0c5fc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/__init__.py_workspace_": {"doc_hash": "5e025122d51d5fa37d5aa7748b97a0d4a39fe0f979d4b536edc6d5dbe2a79598"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/azure.py__pylint_disable_abstract_": {"doc_hash": "f983cb2377209e271ba4a64647369d3ee8f0f099464f1e38259a4a5a891f5a8e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/hdfs.py_getpass_HDFS.should_test.return.True": {"doc_hash": "5ef30182130bbd7e6e9e227dde96ffb380354839b1b08d7c9633523130963812"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/hdfs.py_HDFS.get_url_": {"doc_hash": "8675ddab8c004a1e631404ac067d5ade89d9a5807e13bacf865858d133808da4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/ssh.py_getpass_SSH.get_url.return._ssh_127_0_0_1_22_": {"doc_hash": "7fad96abc94076567ecd172b5b88e92e3c17e8c8bf9f96c621f385889097d726"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/ssh.py_SSHMocked_SSHMocked.get_url.return.url": {"doc_hash": "5c0639c18d3a479a7c6f4ed99d93e5e307c16234dafd5f4d7fa90bb806eab7ee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_params.py_test_params_error_": {"doc_hash": "eadd6b299021e35230dfd42106409a5dd66ad6b5acbf737f6008257b7875ff11"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_azure.py_pytest_": {"doc_hash": "a05b0f8760bf3009a7d662978909219e3fc37a65001d6e255c40d985ce542ee7"}, "/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": "322bd61d47891d96e9a2393edb718b2456f86e4a835084e3f3843208c70411b5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_tree.py_test_walk_files_test_walk_files.assert_list_remote_tree_w": {"doc_hash": "9950fa27e8afdca44ddf83aa142033df67ed530b9d50c10d62645ec16fa6dcf4"}, "/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": "64ad4d2241fa6c296c43f9a96a34b10e7605b59bcb4464e4f177f8639f7c43c0"}, "/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": "426963b8f2fba44a32bf87e59b8efc72a72fae86fd6a25bbb4248ebbf64d56e8"}, "/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": "f8823b23dca80fef2676d763914c035360aceb6fdc4c10667adcb3a9e57b67fc"}, "/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": "e422710c757270739b0c6a92320d5b4d9fa833348c9e2f981087056bc322cb6a"}}, "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/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": 58, "span_ids": ["CmdBase.default_targets", "CmdBaseNoRepo.__init__", "CmdBase", "CmdBase.__init__", "CmdBase.run", "CmdBaseNoRepo"], "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 CmdBase(ABC):\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.tmp_dir, hardlink_lock=hardlink_lock)\n updater.check()\n\n @property\n def default_targets(self):\n \"\"\"Default targets for `dvc repro`.\"\"\"\n from dvc.dvcfile import PIPELINE_FILE\n\n logger.debug(f\"assuming default target '{PIPELINE_FILE}'.\")\n return [PIPELINE_FILE]\n\n @abstractmethod\n def run(self):\n pass\n\n\nclass CmdBaseNoRepo(CmdBase):\n def __init__(self, args): # pylint: disable=super-init-not-called\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": 34, "end_line": 72, "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 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 ).complete = completion.DVC_FILE\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": 36, "end_line": 72, "span_ids": ["add_parser"], "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 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(\n \"target\", help=\"Analytics file.\",\n ).complete = completion.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/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": 62, "end_line": 141, "span_ids": ["add_parser"], "tokens": 488}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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.\",\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": 30, "end_line": 63, "span_ids": ["add_parser"], "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": "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 ).complete = completion.FILE\n import_parser.add_argument(\n \"-o\",\n \"--out\",\n nargs=\"?\",\n help=\"Destination path to download files to\",\n metavar=\"\",\n ).complete = completion.DIR\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/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": 60, "end_line": 170, "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 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=f\"Stages to reproduce. '{PIPELINE_FILE}' by default.\",\n ).complete = completion.DVC_FILE\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 \"--no-run-cache\",\n action=\"store_true\",\n default=False,\n help=(\n \"Execute stage commands even if they have already been run with \"\n \"the same command/dependencies/outputs/etc before.\"\n ),\n )\n repro_parser.add_argument(\n \"--force-downstream\",\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/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": 33, "span_ids": ["_spawn_windows", "docstring"], "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": "\"\"\"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, is_binary\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": 36, "end_line": 64, "span_ids": ["_spawn_posix"], "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": "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\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": 103, "end_line": 120, "span_ids": ["AsciiCanvas.point"], "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 AsciiCanvas:\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": 122, "end_line": 162, "span_ids": ["AsciiCanvas.line"], "tokens": 394}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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:\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": 164, "end_line": 201, "span_ids": ["AsciiCanvas.text", "AsciiCanvas.box"], "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 AsciiCanvas:\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": 204, "end_line": 242, "span_ids": ["_build_sugiyama_layout"], "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 _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(f\" {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": 245, "end_line": 319, "span_ids": ["draw"], "tokens": 636}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 return 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", "GSDependency"], "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 BaseDependency\nfrom dvc.output.gs import GSOutput\n\n\nclass GSDependency(BaseDependency, GSOutput):\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", "HDFSDependency"], "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.dependency.base import BaseDependency\nfrom dvc.output.hdfs import HDFSOutput\n\n\nclass HDFSDependency(BaseDependency, HDFSOutput):\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", "LocalDependency"], "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 dvc.dependency.base import BaseDependency\nfrom dvc.output.local import LocalOutput\n\n\nclass LocalDependency(BaseDependency, LocalOutput):\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", "S3Dependency"], "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.dependency.base import BaseDependency\nfrom dvc.output.s3 import S3Output\n\n\nclass S3Dependency(BaseDependency, S3Output):\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", "SSHDependency"], "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 BaseDependency\nfrom dvc.output.ssh import SSHOutput\n\n\nclass SSHDependency(BaseDependency, SSHOutput):\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/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": ["GSOutput", "imports"], "tokens": 36}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 S3Output\nfrom dvc.remote.gs import GSRemoteTree\n\n\nclass GSOutput(S3Output):\n TREE_CLS = GSRemoteTree", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": 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": "\"\"\"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 = f\"{statement} [y/n]\"\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(f\"{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/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": 330, "end_line": 391, "span_ids": ["Repo.used_cache"], "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 Repo:\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 used_run_cache=None,\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 = f\"({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 if used_run_cache:\n used_cache = self.stage_cache.get_used_cache(\n used_run_cache, remote=remote, force=force, jobs=jobs,\n )\n cache.update(used_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/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": 18, "span_ids": ["_destroy_stages", "imports", "destroy"], "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": "from dvc.utils.fs import remove\n\nfrom . import locked\n\n\n@locked\ndef _destroy_stages(repo):\n for stage in repo.stages:\n stage.unprotect_outs()\n stage.dvcfile.remove(force=True)\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": 27, "end_line": 98, "span_ids": ["gc"], "tokens": 447}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 if not repos:\n 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 # treat caches as remotes for garbage collection\n _do_gc(\"local\", self.cache.local, used, jobs)\n\n if self.cache.s3:\n _do_gc(\"s3\", self.cache.s3, used, jobs)\n\n if self.cache.gs:\n _do_gc(\"gs\", self.cache.gs, used, jobs)\n\n if self.cache.ssh:\n _do_gc(\"ssh\", self.cache.ssh, used, jobs)\n\n if self.cache.hdfs:\n _do_gc(\"hdfs\", self.cache.hdfs, used, jobs)\n\n if self.cache.azure:\n _do_gc(\"azure\", self.cache.azure, used, jobs)\n\n if cloud:\n _do_gc(\"remote\", self.cloud.get_remote(remote, \"gc -c\"), 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": 46, "end_line": 113, "span_ids": ["init"], "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": "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\"], proj.plot_templates.templates_dir])\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/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": 74, "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 dvc.exceptions import MoveNotDataSourceError\nfrom dvc.repo.scm_context import scm_context\n\nfrom . import locked\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.addressing)\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": 18, "span_ids": ["imports", "remove"], "tokens": 76}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 ..utils import parse_target\nfrom . import locked\n\nlogger = logging.getLogger(__name__)\n\n\n@locked\ndef remove(self, target, outs=False):\n path, name = parse_target(target)\n stages = self.get_stages(path, name)\n\n for stage in stages:\n stage.remove(remove_outs=outs, force=outs)\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/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": 98, "end_line": 188, "span_ids": ["_reproduce_stages"], "tokens": 710}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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, stages, downstream=False, single_item=False, **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 reverse post-ordered search using the given stage as a starting\n 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 nodes = nx.dfs_postorder_nodes(\n G.copy().reverse(copy=False), stage\n )\n all_pipelines += reversed(list(nodes))\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 force_downstream = kwargs.pop(\"force_downstream\", False)\n result = []\n # `ret` is used to add a cosmetic newline.\n ret = []\n for stage in pipeline:\n if ret:\n logger.info(\"\")\n\n try:\n ret = _reproduce_stage(stage, **kwargs)\n\n if len(ret) != 0 and force_downstream:\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": 40, "end_line": 103, "span_ids": ["_cloud_status"], "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": "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 recursive=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 recursive=recursive,\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": 106, "end_line": 148, "span_ids": ["status"], "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": "@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 recursive=False,\n):\n if isinstance(targets, str):\n targets = [targets]\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 recursive=True,\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(\n self, targets, with_deps=with_deps, recursive=recursive\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/__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": 158, "end_line": 203, "span_ids": ["State._prepare_db"], "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:\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": 205, "end_line": 241, "span_ids": ["State.load", "State._vacuum"], "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 State:\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": 243, "end_line": 290, "span_ids": ["State.dump"], "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 State:\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": 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 System:\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.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": 160, "end_line": 186, "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:\n\n @staticmethod\n def inode(path):\n path = os.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/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": 12, "span_ids": ["imports"], "tokens": 85}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 ( # pylint:disable=import-error\n copy_metadata,\n)\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": 7, "span_ids": ["imports"], "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 PyInstaller.utils.hooks import ( # pylint:disable=import-error\n copy_metadata,\n)\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/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": 92, "end_line": 115, "span_ids": ["StaticFileServer.__exit__", "StaticFileServer", "StaticFileServer.__init__", "StaticFileServer.__enter__"], "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 StaticFileServer:\n _lock = threading.Lock()\n\n def __init__(self, directory):\n from functools import partial\n\n self._lock.acquire()\n self._httpd = HTTPServer(\n (\"localhost\", 0), partial(TestRequestHandler, directory=directory),\n )\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/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": 31, "end_line": 69, "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 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 \"--external\",\n action=\"store_true\",\n default=False,\n help=\"Allow targets that are outside of the DVC repository.\",\n )\n parser.add_argument(\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 ).complete = completion.FILE\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/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": 80, "end_line": 117, "span_ids": ["show"], "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 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 workspace 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(\"workspace\") == res.get(active_branch):\n res.pop(\"workspace\", 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/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": 37, "end_line": 168, "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": 849}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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:\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/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": ["imports", "TestGSDependency", "TestGSDependency._get_cls"], "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.gs import GSDependency\nfrom tests.unit.dependency.test_local import TestLocalDependency\n\n\nclass TestGSDependency(TestLocalDependency):\n def _get_cls(self):\n return GSDependency", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": ["TestHDFSDependency", "imports", "TestHDFSDependency._get_cls"], "tokens": 46}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 HDFSDependency\nfrom tests.unit.dependency.test_local import TestLocalDependency\n\n\nclass TestHDFSDependency(TestLocalDependency):\n def _get_cls(self):\n return HDFSDependency", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": ["imports", "TestHTTPDependency._get_cls", "TestHTTPDependency"], "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 HTTPDependency\nfrom tests.unit.dependency.test_local import TestLocalDependency\n\n\nclass TestHTTPDependency(TestLocalDependency):\n def _get_cls(self):\n return HTTPDependency", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": ["imports", "TestLocalDependency.test_save_missing", "TestLocalDependency._get_dependency", "TestLocalDependency", "TestLocalDependency._get_cls"], "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": "import mock\n\nfrom dvc.dependency import LocalDependency\nfrom dvc.stage import Stage\nfrom tests.basic_env import TestDvc\n\n\nclass TestLocalDependency(TestDvc):\n def _get_cls(self):\n return LocalDependency\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.tree, \"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": ["imports", "TestS3Dependency", "TestS3Dependency._get_cls"], "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 S3Dependency\nfrom tests.unit.dependency.test_local import TestLocalDependency\n\n\nclass TestS3Dependency(TestLocalDependency):\n def _get_cls(self):\n return S3Dependency", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": ["TestSSHDependency", "imports", "TestSSHDependency._get_cls"], "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 SSHDependency\nfrom tests.unit.dependency.test_local import TestLocalDependency\n\n\nclass TestSSHDependency(TestLocalDependency):\n def _get_cls(self):\n return SSHDependency", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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", "TestGSOutput._get_cls", "TestGSOutput"], "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 GSOutput\nfrom tests.unit.output.test_local import TestLocalOutput\n\n\nclass TestGSOutput(TestLocalOutput):\n def _get_cls(self):\n return GSOutput", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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", "TestHDFSOutput._get_cls", "TestHDFSOutput"], "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 HDFSOutput\nfrom tests.unit.output.test_local import TestLocalOutput\n\n\nclass TestHDFSOutput(TestLocalOutput):\n def _get_cls(self):\n return HDFSOutput", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": 70, "end_line": 97, "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": 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 TestGetFilesNumber(TestDvc):\n def _get_output(self):\n stage = Stage(self.dvc)\n return LocalOutput(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(LocalOutput, \"checksum\", \"12345678.dir\")\n @patch.object(\n LocalCache,\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(LocalOutput, \"checksum\", \"12345678\")\n @patch.object(LocalOutput, \"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", "TestS3Output._get_cls", "TestS3Output"], "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 S3Output\nfrom tests.unit.output.test_local import TestLocalOutput\n\n\nclass TestS3Output(TestLocalOutput):\n def _get_cls(self):\n return S3Output", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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", "TestSSHOutput", "TestSSHOutput._get_cls"], "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 SSHOutput\nfrom tests.unit.output.test_local import TestLocalOutput\n\n\nclass TestSSHOutput(TestLocalOutput):\n def _get_cls(self):\n return SSHOutput", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": 132, "end_line": 174, "span_ids": ["add_parser"], "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 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.add_argument(\n \"--show-md\",\n help=\"Show tabulated output in the Markdown format (GFM).\",\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/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": 67, "end_line": 101, "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(f\"Trying to spawn '{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(f\"Spawned '{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": 182, "end_line": 238, "span_ids": ["setup"], "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": "def setup(level=logging.INFO):\n colorama.init()\n\n addLoggingLevel(\"TRACE\", logging.DEBUG - 5)\n logging.config.dictConfig(\n {\n \"version\": 1,\n \"filters\": {\n \"exclude_errors\": {\"()\": excludeFilter(logging.WARNING)},\n \"exclude_info\": {\"()\": excludeFilter(logging.INFO)},\n \"exclude_debug\": {\"()\": excludeFilter(logging.DEBUG)},\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_trace\": {\n \"class\": \"dvc.logger.LoggerHandler\",\n \"level\": \"TRACE\",\n \"formatter\": \"color\",\n \"stream\": \"ext://sys.stdout\",\n \"filters\": [\"exclude_debug\"],\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_trace\",\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/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": 292, "end_line": 322, "span_ids": ["State._update_state_record_timestamp_for_inode", "State._file_metadata_changed", "State._update_state_for_path_changed"], "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 State:\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": 324, "end_line": 356, "span_ids": ["State.get_state_record_for_inode", "State._insert_new_state_record"], "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 State:\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": 358, "end_line": 381, "span_ids": ["State.save"], "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 State:\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 isinstance(path_info, str) or path_info.scheme == \"local\"\n assert checksum is not None\n assert os.path.exists(path_info)\n\n actual_mtime, actual_size = get_mtime_and_size(path_info, self.tree)\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": 383, "end_line": 415, "span_ids": ["State.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": "class State:\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 isinstance(path_info, str) or path_info.scheme == \"local\"\n path = os.fspath(path_info)\n\n # NOTE: use os.path.exists instead of WorkingTree.exists\n # WorkingTree.exists uses lexists() and will return True for broken\n # symlinks that we cannot stat() in get_mtime_and_size\n if not os.path.exists(path):\n return None\n\n actual_mtime, actual_size = get_mtime_and_size(path, self.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": 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": "class Updater:\n\n def _notify(self, latest):\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=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": 26, "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_BASE_VERSION = \"1.1.7\"\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_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": 211, "end_line": 236, "span_ids": ["TestAddLocalRemoteFile.test", "TestAddLocalRemoteFile"], "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 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 = f\"remote://{remote}/{self.FOO}\"\n ret = main([\"add\", foo])\n self.assertEqual(ret, 0)\n\n d = load_yaml(\"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_yaml(\"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": 355, "end_line": 382, "span_ids": ["SymlinkAddTestBase._test", "SymlinkAddTestBase", "SymlinkAddTestBase._prepare_external_data", "SymlinkAddTestBase._get_data_dir"], "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 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 data_file_name = \"data_file\"\n external_data_path = os.path.join(data_dir, data_file_name)\n with open(external_data_path, \"w+\") as f:\n f.write(\"data\")\n\n link_name = \"data_link\"\n System.symlink(data_dir, link_name)\n return data_file_name, link_name\n\n def _test(self):\n data_file_name, link_name = self._prepare_external_data()\n\n ret = main([\"add\", os.path.join(link_name, data_file_name)])\n self.assertEqual(0, ret)\n\n stage_file = data_file_name + DVC_FILE_SUFFIX\n self.assertTrue(os.path.exists(stage_file))\n\n d = load_yaml(stage_file)\n relative_data_path = posixpath.join(link_name, data_file_name)\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": 427, "end_line": 447, "span_ids": ["TestShouldThrowProperExceptionOnCorruptedStageFile", "TestShouldThrowProperExceptionOnCorruptedStageFile.test"], "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 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 f\"unable to read: '{foo_stage}', YAML file structure is corrupted\"\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": 450, "end_line": 475, "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, \"--file\", \"error.dvc\"])\n self.assertNotEqual(0, ret)\n\n ret = main([\"add\", \"-R\", self.DATA_DIR, \"--file\", \"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, \"--file\", \"data_directory.dvc\"])\n self.assertEqual(0, ret)\n self.assertTrue(os.path.exists(\"data_directory.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\"))\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_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": 61, "end_line": 87, "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": 88, "end_line": 113, "span_ids": ["TestCheckoutCorruptedCacheDir.test", "TestCheckoutCorruptedCacheDir"], "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 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 entry_hash = entry[self.dvc.cache.local.tree.PARAM_CHECKSUM]\n cache = os.fspath(self.dvc.cache.local.hash_to_path_info(entry_hash))\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": 215, "end_line": 241, "span_ids": ["TestCheckoutSelectiveRemove.test", "TestCheckoutSelectiveRemove"], "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": "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_yaml(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": 244, "end_line": 271, "span_ids": ["TestGitIgnoreBasic.test", "TestGitIgnoreBasic"], "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": "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 single_stage=True,\n cmd=f\"python {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": 306, "end_line": 335, "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_yaml(self.file1_stage)\n del d[Stage.PARAM_OUTS][0][LocalRemoteTree.PARAM_CHECKSUM]\n del d[Stage.PARAM_DEPS][0][LocalRemoteTree.PARAM_CHECKSUM]\n dump_yaml(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": 339, "end_line": 381, "span_ids": ["TestCheckoutWithDeps", "TestCheckoutNotCachedFile.test", "TestCheckoutNotCachedFile", "TestCheckoutDirectory", "TestCheckoutDirectory.test", "TestCheckoutWithDeps.test"], "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": "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,\n deps=[self.FOO, self.CODE],\n outs_no_cache=[\"out\"],\n single_stage=True,\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": 385, "end_line": 400, "span_ids": ["TestCheckoutHook", "TestCheckoutHook.test"], "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 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": 22, "span_ids": ["imports", "TestArgParse", "TestArgParse.test"], "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 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, 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, DvcParserError\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": 25, "end_line": 69, "span_ids": ["TestRun.test", "TestRun"], "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 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 \"--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": 72, "end_line": 209, "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", "test_unknown_command_help", "TestRepro.test", "TestGC.test", "test_unknown_subcommand_help", "TestCheckout.test", "TestAdd.test"], "tokens": 781}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 Cmd(CmdBase):\n def run(self):\n pass\n\n class A:\n quiet = False\n verbose = True\n\n args = A()\n with self.assertRaises(DvcException):\n Cmd(args)\n\n\ndef test_unknown_command_help(capsys):\n try:\n _ = parse_args([\"unknown\"])\n except DvcParserError:\n pass\n captured = capsys.readouterr()\n output = captured.out\n try:\n _ = parse_args([\"--help\"])\n except SystemExit:\n pass\n captured = capsys.readouterr()\n help_output = captured.out\n assert output == help_output\n\n\ndef test_unknown_subcommand_help(capsys):\n sample_subcommand = \"push\"\n try:\n _ = parse_args([sample_subcommand, \"--unknown\"])\n except DvcParserError:\n pass\n captured = capsys.readouterr()\n output = captured.out\n try:\n _ = parse_args([sample_subcommand, \"--help\"])\n except SystemExit:\n pass\n captured = capsys.readouterr()\n help_output = captured.out\n assert output == help_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_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": 52, "end_line": 109, "span_ids": ["TestGCBranchesTags.test", "TestGCBranchesTags", "TestGCBranchesTags._check_cache"], "tokens": 495}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 _, _, 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)\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)\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)\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": 112, "end_line": 134, "span_ids": ["TestGCMultipleDvcRepos", "TestGCMultipleDvcRepos.setUp", "TestGCMultipleDvcRepos._check_cache"], "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 TestGCMultipleDvcRepos(TestDvcGit):\n def _check_cache(self, num):\n total = 0\n for _, _, 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": 61, "span_ids": ["TestMove", "TestMoveNotDataSource", "TestMoveNonExistentFile", "imports", "TestCmdMove.test", "TestMoveNotDataSource.test", "TestMove.test", "TestMoveNonExistentFile.test", "TestMoveDirectory.test", "TestMoveDirectory", "TestCmdMove"], "tokens": 435}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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, MoveNotDataSourceError\nfrom dvc.main import main\nfrom dvc.utils.yaml import load_yaml\nfrom tests.basic_env import TestDvc, 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": 101, "end_line": 121, "span_ids": ["TestMoveFileToDirectoryWithoutSpecifiedTargetName", "TestMoveFileToDirectoryWithoutSpecifiedTargetName.test"], "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": "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_yaml(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": 124, "end_line": 148, "span_ids": ["TestMoveDirectoryShouldNotOverwriteExisting", "TestMoveDirectoryShouldNotOverwriteExisting.test"], "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 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 {\".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": 151, "end_line": 176, "span_ids": ["TestMoveFileBetweenDirectories.test", "TestMoveFileBetweenDirectories"], "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 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_yaml(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": 30, "span_ids": ["imports", "test_scheme", "_get_out"], "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": "import pytest\n\nfrom dvc.output import OUTS_MAP, _get\nfrom dvc.stage import Stage\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 # pylint: disable=unidiomatic-typecheck\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_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_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": 62, "end_line": 87, "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=f\"python {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": 90, "end_line": 114, "span_ids": ["TestReproCyclicGraph.test", "TestReproCyclicGraph"], "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 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_yaml(\"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": 117, "end_line": 155, "span_ids": ["TestReproWorkingDirectoryAsOutput.test", "TestReproWorkingDirectoryAsOutput"], "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": "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 single_stage=True,\n )\n\n faulty_stage_path = os.path.join(\"dir2\", \"something.dvc\")\n\n output = os.path.join(\"..\", \"something\")\n stage_dump = {\n \"cmd\": f\"echo something > {output}\",\n \"outs\": [{\"path\": output}],\n }\n dump_yaml(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": 204, "end_line": 228, "span_ids": ["TestReproWorkingDirectoryAsOutput.test_similar_paths"], "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 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(\n outs=[\"something\"], cmd=\"mkdir something\", single_stage=True\n )\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_yaml(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": 291, "span_ids": ["TestReproDepDirWithOutputsUnderIt", "TestReproDepDirWithOutputsUnderIt.test"], "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 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 deps = [self.DATA, self.DATA_SUB]\n stage = self.dvc.run(\n cmd=\"ls {}\".format(\" \".join(deps)),\n fname=\"dvcfile2.dvc\",\n deps=deps,\n single_stage=True,\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=f\"python {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": 294, "end_line": 313, "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=f\"python {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": 378, "end_line": 425, "span_ids": ["TestReproDryNoExec.test", "TestReproDryNoExec"], "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 TestReproDryNoExec(TestDvc):\n def test(self):\n deps = []\n for d in range(3):\n idir = f\"idir{d}\"\n odir = f\"odir{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 \"--single-stage\",\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(\n [\n \"run\",\n \"--no-exec\",\n \"--single-stage\",\n \"--file\",\n DVC_FILE,\n *deps,\n \"ls {}\".format(\n \" \".join(dep for i, dep in enumerate(deps) if i % 2)\n ),\n ]\n )\n self.assertEqual(ret, 0)\n\n ret = main([\"repro\", \"--dry\", DVC_FILE])\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": 428, "end_line": 448, "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=f\"python {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_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": 637, "end_line": 671, "span_ids": ["TestReproMetricsAddUnchanged.test", "TestReproMetricsAddUnchanged"], "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 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=f\"python {self.CODE} {self.FOO} {file1}\",\n single_stage=True,\n )\n\n stages = self.dvc.reproduce(file1_stage)\n self.assertEqual(len(stages), 0)\n\n d = load_yaml(file1_stage)\n d[\"outs\"][0][\"metric\"] = True\n dump_yaml(file1_stage, d)\n\n stages = self.dvc.reproduce(file1_stage)\n self.assertEqual(len(stages), 0)\n\n d = load_yaml(file1_stage)\n d[\"outs\"][0][\"metric\"] = False\n dump_yaml(file1_stage, d)\n\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": 657, "end_line": 685, "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": 738, "end_line": 779, "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=f\"python {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": 782, "end_line": 804, "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_yaml(self.file1_stage)\n del d[Stage.PARAM_OUTS][0][LocalRemoteTree.PARAM_CHECKSUM]\n del d[Stage.PARAM_DEPS][0][LocalRemoteTree.PARAM_CHECKSUM]\n dump_yaml(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": 807, "end_line": 843, "span_ids": ["TestCmdReproChdir.test", "TestCmdReproChdir"], "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 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 \"--single-stage\",\n \"--file\",\n f\"{dname}/Dvcfile\",\n \"-w\",\n f\"{dname}\",\n \"-d\",\n self.FOO,\n \"-o\",\n self.BAR,\n f\"python {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, DVC_FILE])\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_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": 1383, "end_line": 1407, "span_ids": ["TestReproAlreadyCached.test_force_import"], "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 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 LocalRemoteTree,\n \"download\",\n side_effect=LocalRemoteTree.download,\n autospec=True,\n )\n\n patch_checkout = patch.object(\n BaseOutput,\n \"checkout\",\n side_effect=BaseOutput.checkout,\n autospec=True,\n )\n\n with patch_download as mock_download:\n with patch_checkout as mock_checkout:\n assert main([\"unfreeze\", \"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": 1410, "end_line": 1435, "span_ids": ["TestShouldDisplayMetricsOnReproWithMetricsOption", "TestShouldDisplayMetricsOnReproWithMetricsOption.test"], "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 TestShouldDisplayMetricsOnReproWithMetricsOption(TestDvc):\n def test(self):\n metrics_file = \"metrics_file\"\n metrics_value = 0.123489015\n ret = main(\n [\n \"run\",\n \"--single-stage\",\n \"-m\",\n metrics_file,\n f\"echo {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 = f\"{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": 1584, "end_line": 1601, "span_ids": ["test_dvc_formatting_retained"], "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_dvc_formatting_retained(tmp_dir, dvc, run_copy):\n tmp_dir.dvc_gen(\"foo\", \"foo content\")\n stage = run_copy(\n \"foo\", \"foo_copy\", fname=\"foo_copy.dvc\", single_stage=True\n )\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": 78, "end_line": 117, "span_ids": ["_upload_multipart", "test_copy_multipart_preserve_etag"], "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 _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 S3RemoteTree._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": 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 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_yaml(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_yaml(stage.relpath, d)\n\n dvcfile = SingleStageFile(self.dvc, stage.relpath)\n stage = dvcfile.stage\n\n self.assertTrue(stage is not None)\n dvcfile.dump(stage)\n\n d = load_yaml(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": 114, "end_line": 137, "span_ids": ["TestExternalRemoteResolution.test_remote_output", "TestExternalRemoteResolution"], "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 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 \"--single-stage\",\n \"-O\",\n \"remote://storage/file\",\n f\"echo file > {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_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": 138, "end_line": 152, "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_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_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/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": 8, "span_ids": ["imports", "HTTPSDependency"], "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.remote.https import HTTPSRemoteTree\n\nfrom .http import HTTPDependency\n\n\nclass HTTPSDependency(HTTPDependency):\n TREE_CLS = HTTPSRemoteTree", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": 51, "end_line": 156, "span_ids": ["State.files", "State._execute", "State.__exit__", "State.__enter__", "State._fetchall", "State", "State._to_sqlite", "State.__init__", "State._from_sqlite"], "tokens": 725}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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: # 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, local_cache):\n repo = local_cache.repo\n self.repo = repo\n self.root_dir = repo.root_dir\n self.tree = local_cache.tree.work_tree\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 repo.tmp_dir:\n self.state_file = None\n return\n\n self.state_file = os.path.join(repo.tmp_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.trace(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_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": 95, "end_line": 112, "span_ids": ["TestDirFixture.tearDown"], "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 TestDirFixture:\n\n def tearDown(self):\n self._popd()\n try:\n remove(self._root_dir)\n except OSError as exc:\n # pylint: disable=no-member\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_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": 75, "span_ids": ["impl:3"], "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": "parent_config_parser = argparse.ArgumentParser(add_help=False)\nlevel_group = parent_config_parser.add_mutually_exclusive_group()\nlevel_group.add_argument(\n \"--global\",\n dest=\"level\",\n action=\"store_const\",\n const=\"global\",\n help=\"Use global config.\",\n)\nlevel_group.add_argument(\n \"--system\",\n dest=\"level\",\n action=\"store_const\",\n const=\"system\",\n help=\"Use system config.\",\n)\nlevel_group.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": ["imports", "HTTPDependency"], "tokens": 46}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 BaseDependency\nfrom dvc.output.base import BaseOutput\nfrom dvc.remote.http import HTTPRemoteTree\n\n\nclass HTTPDependency(BaseDependency, BaseOutput):\n TREE_CLS = HTTPRemoteTree", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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", "HDFSOutput"], "tokens": 37}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 BaseOutput\nfrom dvc.remote.hdfs import HDFSRemoteTree\n\n\nclass HDFSOutput(BaseOutput):\n TREE_CLS = HDFSRemoteTree", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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", "S3Output"], "tokens": 37}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 BaseOutput\nfrom dvc.remote.s3 import S3RemoteTree\n\n\nclass S3Output(BaseOutput):\n TREE_CLS = S3RemoteTree", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": 8, "span_ids": ["imports", "SSHOutput"], "tokens": 46}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 BaseOutput\nfrom dvc.remote.ssh import SSHRemote, SSHRemoteTree\n\n\nclass SSHOutput(BaseOutput):\n REMOTE_CLS = SSHRemote\n TREE_CLS = SSHRemoteTree", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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.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": 216, "end_line": 245, "span_ids": ["Git.ignore_remove", "Git.add"], "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 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) 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": 102, "end_line": 177, "span_ids": ["impl:39", "impl:29"], "tokens": 652}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 \"pytest-lazy-fixture\",\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.8.2\",\n \"moto==1.3.14.dev464\",\n \"rangehttpserver==1.2.0\",\n \"beautifulsoup4==4.4.0\",\n \"flake8-bugbear\",\n \"flake8-comprehensions\",\n \"flake8-string-format\",\n \"pylint\",\n \"pylint-pytest\",\n \"pylint-plugin-utils\",\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.6\",\n classifiers=[\n \"Development Status :: 4 - Beta\",\n \"Programming Language :: Python :: 3\",\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": 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 TestConfigCLI(TestDvc):\n\n def _do_test(self, local=False):\n section = \"core\"\n field = \"analytics\"\n section_field = f\"{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_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/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/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": 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 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/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": 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 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 ).complete = completion.FILE\n get_parser.add_argument(\n \"-o\",\n \"--out\",\n nargs=\"?\",\n help=\"Destination path to download files to\",\n metavar=\"\",\n ).complete = completion.DIR\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": 31, "end_line": 75, "span_ids": ["add_parser"], "tokens": 368}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 ).complete = completion.DIR\n import_parser.add_argument(\n \"--file\",\n help=\"Specify name of the DVC-file this command will generate.\",\n metavar=\"\",\n ).complete = completion.DIR\n import_parser.add_argument(\n \"--no-exec\",\n action=\"store_true\",\n default=False,\n help=\"Only create DVC-file without actually downloading it.\",\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/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": 22, "span_ids": ["imports", "get_url"], "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": "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.save()\n dep.download(out)\n out.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/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, frozen=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": 417, "end_line": 436, "span_ids": ["State.save_link"], "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 State:\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 isinstance(path_info, str) or path_info.scheme == \"local\"\n\n if not self.tree.exists(path_info):\n return\n\n mtime, _ = get_mtime_and_size(path_info, self.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": 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 os\n\n# Increasing fd ulimit for tests\nif os.name == \"nt\":\n import win32file # pylint: disable=import-error\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": 143, "end_line": 210, "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": 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": "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 self._caplog = None\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 self._caplog = None\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": 69, "end_line": 105, "span_ids": ["test_open_external"], "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": "@pytest.mark.parametrize(\n \"cloud\",\n [\n pytest.lazy_fixture(cloud)\n for cloud in [\n \"real_s3\", # NOTE: moto's s3 fails in some tests\n \"gs\",\n \"azure\",\n \"gdrive\",\n \"oss\",\n \"ssh\",\n \"hdfs\",\n \"http\",\n ]\n ],\n)\ndef test_open_external(erepo_dir, cloud):\n erepo_dir.add_remote(config=cloud.config)\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 = f\"file://{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_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": 1272, "end_line": 1295, "span_ids": ["TestReproShell.test", "TestReproShell"], "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": "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,\n outs=[fname],\n cmd=f\"echo $SHELL > {fname}\",\n single_stage=True,\n )\n\n with open(fname) 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) 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": 36, "end_line": 53, "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(_):\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": 56, "end_line": 71, "span_ids": ["test_get_state_record_for_inode"], "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": "@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.cache.local)\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": 75, "span_ids": ["imports", "test_run"], "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": "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 \"--plots\",\n \"plots\",\n \"--plots-no-cache\",\n \"plots-no-cache\",\n \"--file\",\n \"file\",\n \"--wdir\",\n \"wdir\",\n \"--no-exec\",\n \"--force\",\n \"--no-run-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 \"--external\",\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 plots=[\"plots\"],\n plots_no_cache=[\"plots-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 force=True,\n run_cache=False,\n no_commit=True,\n always_changed=True,\n cmd=\"command\",\n name=\"nam\",\n single_stage=False,\n external=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_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": 78, "end_line": 105, "span_ids": ["test_run_args_from_cli"], "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_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 plots=[],\n plots_no_cache=[],\n outs_persist=[],\n outs_persist_no_cache=[],\n params=[],\n fname=None,\n wdir=None,\n no_exec=False,\n force=False,\n run_cache=True,\n no_commit=False,\n always_changed=False,\n cmd=\"echo foo\",\n name=None,\n single_stage=False,\n external=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/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": 108, "end_line": 136, "span_ids": ["test_run_args_with_spaces"], "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_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 plots=[],\n plots_no_cache=[],\n outs_persist=[],\n outs_persist_no_cache=[],\n params=[],\n fname=None,\n wdir=None,\n no_exec=False,\n force=False,\n run_cache=True,\n no_commit=False,\n always_changed=False,\n cmd='echo \"foo bar\"',\n name=None,\n single_stage=False,\n external=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/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": 23, "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 sys\nimport tempfile\nimport uuid\n\nimport distro\nimport requests\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\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": 140, "end_line": 174, "span_ids": ["_find_or_create_user_id"], "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": "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) 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(f\"Failed to acquire '{lockfile}'\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": 36, "end_line": 59, "span_ids": ["open"], "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 open( # noqa, pylint: disable=redefined-builtin\n path, repo=None, rev=None, remote=None, mode=\"r\", encoding=None\n):\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": 62, "end_line": 80, "span_ids": ["_OpenContextManager", "_open", "_OpenContextManager.__init__", "_OpenContextManager.__getattr__"], "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 _OpenContextManager(GCM):\n def __init__(\n self, func, args, kwds\n ): # pylint: disable=super-init-not-called\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": 42, "span_ids": ["_make_remote_property", "docstring"], "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": "\"\"\"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 get_cloud_tree\n from dvc.remote.base import CloudCache\n\n remote = self.config.get(name)\n if not remote:\n return None\n\n tree = get_cloud_tree(self.repo, name=remote)\n return CloudCache(tree)\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": 45, "end_line": 75, "span_ids": ["Cache.__init__", "Cache", "Cache:5"], "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 Cache:\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 get_cloud_tree\n from dvc.remote.local import LocalCache\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 tree = get_cloud_tree(repo, **settings)\n self.local = LocalCache(tree)\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": 108, "end_line": 172, "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": 483}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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:\n # pylint: disable=protected-access\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/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": 28, "span_ids": ["imports", "CmdAdd", "CmdAdd.run"], "tokens": 144}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 import completion\nfrom dvc.command.base import CmdBase, append_doc_link\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 external=self.args.external,\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": 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 logging\nfrom abc import ABC, abstractmethod\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": 61, "span_ids": ["imports", "CmdCacheDir.run", "CmdCacheDir", "add_parser"], "tokens": 393}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 import completion\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 ).complete = completion.DIR\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_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": 39, "end_line": 65, "span_ids": ["CmdCheckout", "CmdCheckout.run"], "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 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 default_message = \"No changes.\"\n msg = get_summary(\n sorted(stats.items(), key=operator.itemgetter(0))\n )\n logger.info(msg or default_message)\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": 69, "end_line": 119, "span_ids": ["add_parser"], "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": "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 ).complete = completion.DVC_FILE\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": 31, "span_ids": ["imports", "CmdCommit", "CmdCommit.run"], "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": "import argparse\nimport logging\n\nfrom dvc.command import completion\nfrom dvc.command.base import CmdBase, append_doc_link\nfrom dvc.exceptions import DvcException\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 CmdBaseNoRepo, append_doc_link\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/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": 44, "span_ids": ["CmdDataPull.run", "imports", "CmdDataBase.log_summary", "CmdDataPull", "CmdDataBase", "CmdDataPull.log_summary"], "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": "import argparse\nimport logging\n\nfrom dvc.command import completion\nfrom dvc.command.base import CmdBase, append_doc_link\nfrom dvc.command.checkout import log_changes\nfrom dvc.exceptions import CheckoutError, DvcException\nfrom dvc.utils.humanize import get_summary\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdDataBase(CmdBase):\n def log_summary(self, stats):\n default_msg = \"Everything is up to date.\"\n logger.info(get_summary(stats.items()) or default_msg)\n\n\nclass CmdDataPull(CmdDataBase):\n def log_summary(self, stats):\n log_changes(stats)\n super().log_summary(stats)\n\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 run_cache=self.args.run_cache,\n )\n self.log_summary(stats)\n except (CheckoutError, DvcException) as exc:\n self.log_summary(getattr(exc, \"stats\", {}))\n logger.exception(\"failed to pull data from the cloud\")\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/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": 46, "end_line": 64, "span_ids": ["CmdDataPush.run", "CmdDataPush"], "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 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 run_cache=self.args.run_cache,\n )\n self.log_summary({\"pushed\": processed_files_count})\n except DvcException:\n logger.exception(\"failed to push data to the cloud\")\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/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": 67, "end_line": 85, "span_ids": ["CmdDataFetch.run", "CmdDataFetch"], "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 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 run_cache=self.args.run_cache,\n )\n self.log_summary({\"fetched\": processed_files_count})\n except DvcException:\n logger.exception(\"failed to fetch data from the cloud\")\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/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": 31, "span_ids": ["imports", "CmdDestroy.run", "CmdDestroy"], "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 argparse\nimport logging\n\nimport dvc.prompt as prompt\nfrom dvc.command.base import CmdBase, append_doc_link\nfrom dvc.exceptions import DvcException\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: # noqa, pylint: disable=broad-except\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/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": 59, "span_ids": ["imports", "CmdGC", "CmdGC.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": "import argparse\nimport logging\nimport os\n\nimport dvc.prompt as prompt\nfrom dvc.command.base import CmdBase, append_doc_link\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 workspace\"\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": 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 argparse\nimport logging\n\nfrom dvc.exceptions import DvcException\n\nfrom . import completion\nfrom .base import CmdBaseNoRepo, append_doc_link\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": 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": "import argparse\nimport logging\n\nfrom dvc.exceptions import DvcException\n\nfrom . import completion\nfrom .base import CmdBaseNoRepo, append_doc_link\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(f\"failed to get '{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 ).complete = completion.DIR\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": 30, "span_ids": ["CmdHookBase._run", "CmdHookBase", "imports", "CmdPreCommit._run", "CmdPreCommit", "CmdHookBase.run"], "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": "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 def _run(self):\n raise NotImplementedError\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_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": 27, "span_ids": ["CmdImport.run", "imports", "CmdImport"], "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 argparse\nimport logging\n\nfrom dvc.command import completion\nfrom dvc.command.base import CmdBase, append_doc_link\nfrom dvc.exceptions import DvcException\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": 28, "span_ids": ["imports", "CmdImportUrl", "CmdImportUrl.run"], "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 argparse\nimport logging\n\nfrom dvc.command import completion\nfrom dvc.command.base import CmdBase, append_doc_link\nfrom dvc.exceptions import DvcException\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,\n out=self.args.out,\n fname=self.args.file,\n no_exec=self.args.no_exec,\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": 25, "span_ids": ["imports", "CmdInit.run", "CmdInit"], "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 argparse\nimport logging\n\nfrom dvc.command.base import CmdBaseNoRepo, append_doc_link\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": 36, "span_ids": ["imports", "CmdInstall.run", "add_parser", "CmdInstall"], "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": "import argparse\nimport logging\n\nfrom dvc.command.base import CmdBase, append_doc_link\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: # noqa, pylint:disable=broad-except\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/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": 46, "end_line": 80, "span_ids": ["add_parser"], "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": "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 \"--dvc-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 ).complete = completion.DIR\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": 344}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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:\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 f\"\\033[{val}m{text}\\033[{rs}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/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": 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": "import argparse\nimport logging\n\nfrom dvc.command import completion\nfrom dvc.command.base import CmdBase, append_doc_link, fix_subparsers\nfrom dvc.exceptions import BadMetricError, DvcException\n\nlogger = logging.getLogger(__name__)\n\n\nDEFAULT_PRECISION = 5\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(f\"{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(f\"\\t{fname}:\")\n for key, value in flatten(format_dict(metric), \".\").items():\n logger.info(f\"\\t\\t{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": 106, "end_line": 136, "span_ids": ["CmdMetricsDiff.run", "CmdMetricsDiff"], "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 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(\n diff,\n self.args.show_md,\n self.args.no_path,\n self.args.old,\n precision=self.args.precision,\n )\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": 46, "span_ids": ["imports", "CmdMove.run", "add_parser", "CmdMove"], "tokens": 296}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 import completion\nfrom dvc.command.base import CmdBase, append_doc_link\nfrom dvc.exceptions import DvcException\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 ).complete = completion.FILE\n move_parser.add_argument(\n \"dst\", help=\"Destination path.\",\n ).complete = completion.FILE\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/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": 24, "end_line": 40, "span_ids": ["CmdRemoteAdd", "CmdRemoteAdd.run"], "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 CmdRemoteAdd(CmdRemote):\n def run(self):\n if self.args.default:\n logger.info(f\"Setting '{self.args.name}' as a default remote.\")\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/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": 57, "span_ids": ["CmdRepro.run", "imports", "CmdRepro"], "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 argparse\nimport logging\nimport os\n\nfrom dvc.command import completion\nfrom dvc.command.base import CmdBase, append_doc_link\nfrom dvc.command.metrics import show_metrics\nfrom dvc.command.status import CmdDataStatus\nfrom dvc.dvcfile import PIPELINE_FILE\nfrom dvc.exceptions import DvcException\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 run_cache=not self.args.no_run_cache,\n no_commit=self.args.no_commit,\n downstream=self.args.downstream,\n recursive=self.args.recursive,\n force_downstream=self.args.force_downstream,\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": 28, "span_ids": ["imports", "CmdRoot.run", "CmdRoot", "add_parser"], "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 argparse\nimport logging\n\nfrom dvc.command.base import CmdBaseNoRepo, append_doc_link\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": 62, "span_ids": ["imports", "CmdRun", "CmdRun.run"], "tokens": 415}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\nfrom dvc.exceptions import DvcException\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdRun(CmdBase):\n def run(self):\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.plots,\n self.args.plots_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`, `--plots`, `--plots-no-cache`, \"\n \"`--outs-persist`, `--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 plots=self.args.plots,\n plots_no_cache=self.args.plots_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 force=self.args.force,\n run_cache=not self.args.no_run_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 single_stage=self.args.single_stage,\n external=self.args.external,\n )\n except DvcException:\n logger.exception(\"\")\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": 37, "span_ids": ["imports", "CmdDataStatus._normalize", "CmdDataStatus", "CmdDataStatus._show"], "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": "import logging\n\nfrom dvc.command.data_sync import CmdDataBase\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(f\"{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(f\"{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": 39, "end_line": 70, "span_ids": ["CmdDataStatus.run"], "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 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 recursive=self.args.recursive,\n )\n\n if self.args.quiet:\n return bool(st)\n\n if self.args.show_json:\n import json\n\n logger.info(json.dumps(st))\n elif st:\n self._show(st, indent)\n else:\n logger.info(self.UP_TO_DATE_MSG)\n\n except Exception: # noqa, pylint: disable=broad-except\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": 39, "span_ids": ["imports", "add_parser", "CmdUnprotect", "CmdUnprotect.run"], "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": "import argparse\nimport logging\n\nfrom dvc.command import completion\nfrom dvc.command.base import CmdBase, append_doc_link\nfrom dvc.exceptions import DvcException\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 = f\"failed to unprotect '{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 ).complete = completion.FILE\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": 52, "span_ids": ["imports", "CmdUpdate", "add_parser", "CmdUpdate.run"], "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 argparse\nimport logging\n\nfrom dvc.command import completion\nfrom dvc.command.base import CmdBase, append_doc_link\nfrom dvc.exceptions import DvcException\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdUpdate(CmdBase):\n def run(self):\n ret = 0\n try:\n self.repo.update(\n targets=self.args.targets,\n rev=self.args.rev,\n recursive=self.args.recursive,\n )\n except DvcException:\n logger.exception(\"failed update data\")\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 ).complete = completion.DVC_FILE\n update_parser.add_argument(\n \"--rev\",\n nargs=\"?\",\n help=\"Git revision (e.g. SHA, branch, tag)\",\n metavar=\"\",\n )\n update_parser.add_argument(\n \"-R\",\n \"--recursive\",\n action=\"store_true\",\n default=False,\n help=\"Update all stages in the specified directory.\",\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": 23, "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 pathlib\nimport platform\nimport uuid\n\nfrom dvc.command.base import CmdBaseNoRepo, append_doc_link\nfrom dvc.exceptions import DvcException, NotDvcRepoError\nfrom dvc.scm.base import SCMError\nfrom dvc.system import System\nfrom dvc.utils import is_binary, relpath\nfrom dvc.utils.pkg import PKG\nfrom dvc.version import __version__\n\ntry:\n import psutil\nexcept ImportError:\n psutil = None\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/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": 26, "end_line": 78, "span_ids": ["CmdVersion.run", "CmdVersion"], "tokens": 424}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 f\"DVC version: {__version__}\",\n f\"Python version: {platform.python_version()}\",\n f\"Platform: {platform.platform()}\",\n f\"Binary: {is_binary()}\",\n f\"Package: {PKG}\",\n f\"Supported remotes: {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 f\"Filesystem type (cache directory): {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(f\"Filesystem type (workspace): {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": 80, "end_line": 132, "span_ids": ["CmdVersion.get_linktype_support_info", "CmdVersion.get_supported_remotes", "CmdVersion.get_fs_type"], "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": "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(f\"{name} - {status}\")\n os.remove(src)\n\n return \", \".join(cache)\n\n @staticmethod\n def get_supported_remotes():\n from dvc.remote import TREES\n\n supported_remotes = []\n for tree_cls in TREES:\n if not tree_cls.get_missing_deps():\n supported_remotes.append(tree_cls.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/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": 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": "\"\"\"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__(f\"config file error: {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": 80, "end_line": 96, "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(f\"Unsupported URL type {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": 122, "end_line": 208, "span_ids": ["impl:14", "impl:6"], "tokens": 642}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 \"sse_kms_key_id\": 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/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": 29, "span_ids": ["make_pager", "docstring"], "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": "\"\"\"Draws DAG in ASCII.\"\"\"\n\nimport logging\nimport math\nimport os\nimport pydoc\nimport sys\n\nfrom grandalf.graphs import Edge, Graph, Vertex\nfrom grandalf.layouts import SugiyamaLayout\nfrom grandalf.routing import EdgeViewer, 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": 32, "end_line": 49, "span_ids": ["find_pager"], "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 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(f\"({DEFAULT_PAGER}) 2>{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": 52, "end_line": 75, "span_ids": ["VertexViewer.__init__", "VertexViewer.w", "VertexViewer.h", "VertexViewer"], "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 VertexViewer:\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/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": 45, "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 get_remote\n\nlogger = logging.getLogger(__name__)\n\n\nclass DataCloud:\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, name=None, command=\"\"):\n if not name:\n name = self.repo.config[\"core\"].get(\"remote\")\n\n if name:\n return self._init_remote(name)\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": 47, "end_line": 67, "span_ids": ["DataCloud.push", "DataCloud._init_remote"], "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 DataCloud:\n\n def _init_remote(self, name):\n return get_remote(self.repo, name=name)\n\n def push(\n self, cache, jobs=None, remote=None, show_checksums=False,\n ):\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.BaseRemote): 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 remote = self.get_remote(remote, \"push\")\n\n return self.repo.cache.local.push(\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/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": 91, "span_ids": ["DataCloud.pull"], "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 DataCloud:\n\n def pull(\n self, cache, jobs=None, remote=None, show_checksums=False,\n ):\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.BaseRemote): 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\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.tree.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": 30, "span_ids": ["DependencyDoesNotExistError", "DependencyDoesNotExistError.__init__", "DependencyIsNotFileOrDirError", "imports", "DependencyIsStageFileError.__init__", "BaseDependency.update", "BaseDependency", "DependencyIsStageFileError", "DependencyIsNotFileOrDirError.__init__"], "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.exceptions import DvcException\n\n\nclass DependencyDoesNotExistError(DvcException):\n def __init__(self, path):\n msg = f\"dependency '{path}' does not exist\"\n super().__init__(msg)\n\n\nclass DependencyIsNotFileOrDirError(DvcException):\n def __init__(self, path):\n msg = f\"dependency '{path}' is not a file or directory\"\n super().__init__(msg)\n\n\nclass DependencyIsStageFileError(DvcException):\n def __init__(self, path):\n super().__init__(f\"Stage file '{path}' cannot be a dependency.\")\n\n\nclass BaseDependency:\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/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": 45, "end_line": 77, "span_ids": ["StagePathAsOutputError.__init__", "StagePathAsOutputError", "OutputNotFoundError", "OutputNotFoundError.__init__"], "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 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, 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_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_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": 318, "end_line": 347, "span_ids": ["NoOutputOrStageError", "RemoteCacheRequiredError.__init__", "NoOutputOrStageError.__init__", "RemoteCacheRequiredError", "IsADirectoryError"], "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 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): # noqa,pylint:disable=redefined-builtin\n \"\"\"Raised when a file operation is requested on a directory.\"\"\"\n\n\nclass NoOutputOrStageError(DvcException):\n \"\"\"\n Raised when the target is neither an output nor a stage name in dvc.yaml\n \"\"\"\n\n def __init__(self, target, file):\n super().__init__(\n f\"'{target}' \"\n f\"does not exist as an output or a stage name in '{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/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": 26, "span_ids": ["imports"], "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 os\nimport tempfile\nimport threading\nfrom contextlib import contextmanager\nfrom distutils.dir_util import copy_tree\nfrom typing import Iterable\n\nfrom funcy import cached_property, retry, wrap_with\n\nfrom dvc.config import NoRemoteError, NotDvcRepoError\nfrom dvc.exceptions import (\n FileMissingError,\n NoOutputInExternalRepoError,\n NoRemoteInExternalRepoError,\n OutputNotFoundError,\n PathMissingError,\n)\nfrom dvc.path_info import PathInfo\nfrom dvc.repo import Repo\nfrom dvc.repo.tree import RepoTree\nfrom dvc.scm.git import Git\nfrom dvc.scm.tree import is_working_tree\nfrom dvc.utils.fs import remove\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_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": 174, "end_line": 194, "span_ids": ["ExternalRepo._fix_upstream"], "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 ExternalRepo(Repo, BaseExternalRepo):\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": 196, "end_line": 210, "span_ids": ["ExternalRepo._add_upstream", "ExternalRepo._fix_local_remote"], "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 ExternalRepo(Repo, BaseExternalRepo):\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": 213, "end_line": 240, "span_ids": ["ExternalGitRepo.open_by_relpath", "ExternalGitRepo", "ExternalGitRepo.__init__", "ExternalGitRepo.find_out_by_relpath", "ExternalGitRepo.close", "ExternalGitRepo.scm"], "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 ExternalGitRepo(BaseExternalRepo):\n def __init__(self, root_dir, url, rev):\n self.root_dir = os.path.realpath(root_dir)\n self.url = url\n self.tree = self.scm.get_tree(rev)\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 @contextmanager\n def open_by_relpath(self, path, mode=\"r\", encoding=None, **kwargs):\n \"\"\"Opens a specified resource as a file object.\"\"\"\n tree = RepoTree(self)\n try:\n with tree.open(\n path, mode=mode, encoding=encoding, **kwargs\n ) as fobj:\n yield fobj\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": 243, "end_line": 267, "span_ids": ["_cached_clone"], "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": "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 # even if we have already cloned this repo, we may need to\n # fetch/fast-forward to get specified rev\n clone_path = _clone_default_branch(url, rev)\n\n if not for_write and (url) in CLONES:\n return CLONES[url]\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 for_write:\n _git_checkout(repo_path, rev)\n else:\n CLONES[url] = 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/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": 35, "span_ids": ["istextfile", "docstring"], "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": "\"\"\"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, tree=None):\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 if tree:\n open_func = tree.open\n else:\n open_func = open\n with open_func(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": 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": "\"\"\"Manages dvc lock file.\"\"\"\n\nimport hashlib\nimport os\nimport time\nfrom datetime import timedelta\n\nimport flufl.lock\nimport zc.lockfile\n\nfrom dvc.exceptions import DvcException\nfrom dvc.progress import Tqdm\nfrom dvc.utils import format_link\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/tmp/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": 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": "class Lock:\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(\"https://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": 151, "span_ids": ["HardlinkLock.__del__", "make_lock", "HardlinkLock.lockfile", "HardlinkLock._set_claimfile", "HardlinkLock.lock", "HardlinkLock", "HardlinkLock.__init__"], "tokens": 621}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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__(\n self, lockfile, tmp_dir=None, **kwargs\n ): # pylint: disable=super-init-not-called\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): # pylint: disable=arguments-differ\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_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/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": 21, "span_ids": ["docstring"], "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": "\"\"\"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 DvcException, DvcParserError, NotDvcRepoError\nfrom dvc.external_repo import clean_repos\nfrom dvc.logger import FOOTER, disable_other_loggers\nfrom dvc.remote.pool import close_pools\nfrom dvc.utils import format_link\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\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": 24, "end_line": 103, "span_ids": ["main"], "tokens": 483}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 verbosity = args.verbose - args.quiet\n if verbosity:\n logger.setLevel(\n {\n -2: logging.CRITICAL,\n -1: logging.ERROR,\n 1: logging.DEBUG,\n 2: logging.TRACE,\n }[max(-2, min(verbosity, 2))]\n )\n logger.trace(args)\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 DvcException:\n ret = 255\n logger.exception(\"\")\n except OSError as exc:\n if 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 except Exception: # noqa, pylint: disable=broad-except\n logger.exception(\"unexpected error\")\n ret = 255\n finally:\n logger.setLevel(outerLogLevel)\n\n # Closing pools by-hand to prevent weird 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/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": 105, "end_line": 126, "span_ids": ["URLInfo.__init__", "URLInfo.from_parts", "URLInfo"], "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 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(f\"{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": 143, "end_line": 232, "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": 589}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 f\"{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 = f\"'{self}' has incompatible class with '{other}'\"\n raise ValueError(msg)\n if self._base_parts != other._base_parts:\n msg = f\"'{self}' does not start with '{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": 239, "end_line": 288, "span_ids": ["HTTPURLInfo", "HTTPURLInfo.from_parts", "CloudURLInfo.path", "HTTPURLInfo.__init__", "CloudURLInfo"], "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 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 ): # pylint: disable=arguments-differ\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_msg", "Tqdm.update_to", "Tqdm.__init__", "Tqdm", "docstring"], "tokens": 827}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 \"{postfix[info]}{n_fmt}/{total_fmt}\"\n \" [{elapsed}<{remaining}, {rate_fmt:>11}]\"\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 \"{postfix[info]}{n_fmt}/{total_fmt}\"\n \" [{elapsed}<{remaining}, {rate_fmt:>11}]\"\n )\n BAR_FMT_NOTOTAL = (\n \"{desc}{bar:b}|{postfix[info]}{n_fmt} [{elapsed}, {rate_fmt:>11}]\"\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 postfix=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 # 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 self.postfix = postfix or {\"info\": \"\"}\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_msg(self, msg, n=1):\n \"\"\"\n Sets `msg` as a postfix and calls `update(n)`.\n \"\"\"\n self.postfix[\"info\"] = \" %s |\" % msg\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/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": 38, "span_ids": ["imports"], "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 errno\nimport logging\nimport os\nimport stat\nfrom concurrent.futures import ThreadPoolExecutor, as_completed\nfrom functools import partial, wraps\n\nfrom funcy import cached_property, concat\nfrom shortuuid import uuid\n\nfrom dvc.exceptions import DownloadError, DvcException, UploadError\nfrom dvc.path_info import PathInfo\nfrom dvc.progress import Tqdm\nfrom dvc.remote.base import (\n STATUS_DELETED,\n STATUS_MAP,\n STATUS_MISSING,\n STATUS_NEW,\n BaseRemoteTree,\n CloudCache,\n Remote,\n index_locked,\n)\nfrom dvc.remote.index import RemoteIndexNoop\nfrom dvc.scheme import Schemes\nfrom dvc.scm.tree import WorkingTree, is_working_tree\nfrom dvc.system import System\nfrom dvc.utils import file_md5, relpath, tmp_fname\nfrom dvc.utils.fs import (\n copy_fobj_to_file,\n copyfile,\n makedirs,\n move,\n remove,\n walk_files,\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/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": 22, "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\nfrom functools import wraps\n\nimport colorama\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/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": 151, "end_line": 175, "span_ids": ["Repo.find_root"], "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": "class Repo:\n\n @classmethod\n def find_root(cls, root=None, tree=None):\n root_dir = os.path.realpath(root or os.curdir)\n\n if tree:\n if tree.isdir(os.path.join(root_dir, cls.DVC_DIR)):\n return root_dir\n raise NotDvcRepoError(f\"'{root}' does not contain DVC directory\")\n\n if not os.path.isdir(root_dir):\n raise NotDvcRepoError(f\"directory '{root}' does not exist\")\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_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": 393, "end_line": 495, "span_ids": ["Repo._collect_graph"], "tokens": 724}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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:\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): # bug? not using it later\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.addressing,\n str(overlapping),\n overlapping.stage.addressing,\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 = [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": 541, "end_line": 571, "span_ids": ["Repo.is_dvc_internal", "Repo.find_outs_by_path", "Repo.find_out_by_relpath"], "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 Repo:\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.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": 594, "end_line": 610, "span_ids": ["Repo.checkout", "Repo._reset", "Repo.fetch", "Repo.close"], "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 Repo:\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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": 106, "span_ids": ["add", "imports"], "tokens": 707}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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.dvcfile import Dvcfile, is_dvc_file\n\nfrom ..exceptions import (\n OutputDuplicationError,\n OverlappingOutputPathsError,\n RecursiveAddingWhileUsingFilename,\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\nfrom . import locked\n\nlogger = logging.getLogger(__name__)\n\n\n@locked\n@scm_context\ndef add(\n repo, targets, recursive=False, no_commit=False, fname=None, external=False\n):\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(\n repo, sub_targets, fname, pbar=pbar, external=external\n )\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.addressing,\n )\n raise OverlappingOutputPathsError(\n exc.parent, exc.overlapping_out, msg\n )\n except OutputDuplicationError as exc:\n raise OutputDuplicationError(\n exc.output, set(exc.stages) - set(stages)\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": 109, "end_line": 124, "span_ids": ["_find_all_targets"], "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 _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 is_dvc_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": 127, "end_line": 162, "span_ids": ["_create_stages"], "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 _create_stages(repo, targets, fname, pbar=None, external=False):\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(\n Stage,\n repo,\n fname or path,\n wdir=wdir,\n outs=[out],\n external=external,\n )\n if stage:\n Dvcfile(repo, stage.path).remove()\n\n repo._reset() # pylint: disable=protected-access\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_msg(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": 57, "span_ids": ["brancher", "imports"], "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": "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 - \"workspace\" 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.copy() if revs else []\n\n scm = self.scm\n\n self.tree = WorkingTree(self.root_dir)\n yield \"workspace\"\n\n if revs and \"workspace\" in revs:\n revs.remove(\"workspace\")\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 # ignore revs that don't contain repo root\n # (i.e. revs from before a subdir=True repo was init'ed)\n if self.tree.exists(self.root_dir):\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": 36, "span_ids": ["imports", "_get_unused_links", "_fspath_dir", "get_all_files_numbers"], "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\nimport os\n\nfrom dvc.exceptions import (\n CheckoutError,\n CheckoutErrorSuggestGit,\n NoOutputOrStageError,\n)\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):\n if not os.path.exists(str(path)):\n return str(path)\n\n path = relpath(path)\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": 39, "end_line": 105, "span_ids": ["_checkout"], "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": "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) for u in unused]\n self.state.remove_links(unused)\n\n if isinstance(targets, str):\n targets = [targets]\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 (\n StageFileDoesNotExistError,\n StageFileBadNameError,\n NoOutputOrStageError,\n ) 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_msg,\n relink=relink,\n filter_info=filter_info,\n )\n for key, items in result.items():\n stats[key].extend(_fspath_dir(path) for path in items)\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": 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": "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 workspace 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_hash(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/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": 24, "span_ids": ["imports", "_raise_error_if_all_disabled", "_do_gc"], "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.cache import NamedCache\nfrom dvc.exceptions import InvalidArgumentError\n\nfrom . import locked\n\nlogger = logging.getLogger(__name__)\n\n\ndef _do_gc(typ, remote, clist, jobs=None):\n from dvc.remote.base import Remote\n\n removed = Remote.gc(clist, remote, jobs=jobs)\n if not removed:\n logger.info(f\"No unused '{typ}' cache to remove.\")\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": 56, "span_ids": ["imports", "get", "GetDVCFileError.__init__", "GetDVCFileError"], "tokens": 428}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\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 is_valid_filename\n\n out = resolve_output(path, out)\n\n if 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 repo.get_external(path, 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": 43, "span_ids": ["imports", "_welcome_message"], "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": "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, 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": 42, "span_ids": ["imports", "pull"], "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": "import logging\n\nfrom dvc.repo import locked\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 run_cache=False,\n):\n if isinstance(targets, str):\n targets = [targets]\n\n processed_files_count = self._fetch( # pylint: disable=protected-access\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 run_cache=run_cache,\n )\n stats = self._checkout( # pylint: disable=protected-access\n targets=targets, with_deps=with_deps, force=force, recursive=recursive\n )\n\n stats[\"fetched\"] = 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": 36, "span_ids": ["imports", "push"], "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 . 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 run_cache=False,\n):\n used_run_cache = self.stage_cache.push(remote) if run_cache else []\n\n if isinstance(targets, str):\n targets = [targets]\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 used_run_cache=used_run_cache,\n )\n\n return len(used_run_cache) + 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": 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\n\nfrom dvc.exceptions import InvalidArgumentError, ReproductionError\nfrom dvc.repo.scm_context import scm_context\n\nfrom . import locked\nfrom .graph import get_pipeline, get_pipelines\n\nlogger = logging.getLogger(__name__)\n\n\ndef _reproduce_stage(stage, **kwargs):\n if stage.frozen and not stage.is_import:\n logger.warning(\n \"{} is frozen. Its dependencies are\"\n \" not going to be reproduced.\".format(stage)\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": 32, "end_line": 51, "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.frozen:\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": 37, "span_ids": ["imports", "_local_status", "_joint_status"], "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 logging\nfrom itertools import compress\n\nfrom funcy.py3 import cat\n\nfrom dvc.exceptions import InvalidArgumentError\n\nfrom . import locked\n\nlogger = logging.getLogger(__name__)\n\n\ndef _joint_status(stages):\n status_info = {}\n\n for stage in stages:\n if stage.frozen and not stage.is_repo_import:\n logger.warning(\n \"{} is frozen. Its dependencies are\"\n \" not going to be shown in the status output.\".format(stage)\n )\n\n status_info.update(stage.status(check_updates=True))\n\n return status_info\n\n\ndef _local_status(self, targets=None, with_deps=False, recursive=False):\n if targets:\n stages = cat(\n self.collect(t, with_deps=with_deps, recursive=recursive)\n for t in targets\n )\n else:\n stages = self.collect(None, with_deps=with_deps, recursive=recursive)\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/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": 37, "end_line": 59, "span_ids": ["_edit_rwlock", "_infos_to_str"], "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": "@contextmanager\ndef _edit_rwlock(lock_dir):\n path = os.path.join(lock_dir, \"rwlock\")\n try:\n with open(path) 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\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": 24, "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 shlex\n\nimport yaml\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 (\n Base,\n CloneError,\n FileNotInRepoError,\n RevError,\n SCMError,\n)\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": 95, "end_line": 138, "span_ids": ["Git.clone"], "tokens": 371}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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: # pylint: disable=no-member\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: # pylint: disable=no-member\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": 247, "end_line": 301, "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": 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": "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(f\"pull failed: {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(f\"push failed: {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 return bool(self.repo.git.ls_files(path))\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(f\"#!/bin/sh\\nexec dvc git-hook {name} $@\\n\")\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": 303, "end_line": 346, "span_ids": ["Git.install"], "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": "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) 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": 346, "end_line": 382, "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.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": 417, "end_line": 446, "span_ids": ["Git._verify_dvc_hooks", "Git.no_commits", "Git.has_rev", "Git._hook_path", "Git.close", "Git._verify_hook", "Git._hooks_home"], "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 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\")\n\n @property\n def no_commits(self):\n return not self.list_all_commits()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": 438, "end_line": 474, "span_ids": ["State.get_unused_links", "State.remove_links"], "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 State:\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(f\"SELECT * FROM {self.LINK_STATE_TABLE}\")\n for row in self.cursor:\n relative_path, inode, mtime = row\n inode = self._from_sqlite(inode)\n path = os.path.join(self.root_dir, relative_path)\n\n if path in used or not self.tree.exists(path):\n continue\n\n actual_inode = get_inode(path)\n actual_mtime, _ = get_mtime_and_size(path, self.tree)\n\n if (inode, mtime) == (actual_inode, actual_mtime):\n logger.debug(\"Removing '%s' as unused link.\", path)\n unused.append(relative_path)\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": 46, "span_ids": ["System", "imports", "System.is_unix", "System.hardlink", "System.symlink", "System.copy"], "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 errno\nimport logging\nimport os\nimport platform\nimport shutil\nimport sys\n\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:\n @staticmethod\n def is_unix():\n return os.name != \"nt\"\n\n @staticmethod\n def copy(src, dest):\n return shutil.copyfile(src, dest)\n\n @staticmethod\n def hardlink(source, 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 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": 119, "end_line": 157, "span_ids": ["System._getdirinfo"], "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 System:\n\n @staticmethod\n def _getdirinfo(path):\n from collections import namedtuple\n from win32file import ( # pylint: disable=import-error\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": 187, "end_line": 214, "span_ids": ["System.is_hardlink", "System.is_symlink"], "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 System:\n\n @staticmethod\n def is_symlink(path):\n path = os.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 ( # pylint: disable=import-error\n FILE_ATTRIBUTE_REPARSE_POINT,\n )\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 = os.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_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": 121, "end_line": 150, "span_ids": ["Updater._get_update_instructions"], "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": "class Updater:\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": 46, "end_line": 85, "span_ids": ["file_md5"], "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 file_md5(fname, tree=None):\n \"\"\" get the (md5 hexdigest, md5 digest) of a file \"\"\"\n from dvc.progress import Tqdm\n from dvc.istextfile import istextfile\n\n if tree:\n exists_func = tree.exists\n stat_func = tree.stat\n open_func = tree.open\n else:\n exists_func = os.path.exists\n stat_func = os.stat\n open_func = open\n\n if exists_func(fname):\n hash_md5 = hashlib.md5()\n binary = not istextfile(fname, tree=tree)\n size = stat_func(fname).st_size\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_func(fname, \"rb\") as fobj:\n _fobj_md5(fobj, hash_md5, binary, pbar.update)\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_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": 231, "end_line": 266, "span_ids": ["from_yaml_string", "current_timestamp", "tmp_fname", "colorize", "to_yaml_string"], "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": "def tmp_fname(fname):\n \"\"\" Temporary name for a partial download \"\"\"\n return os.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": 33, "end_line": 60, "span_ids": ["get_mtime_and_size"], "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": "def get_mtime_and_size(path, tree):\n\n if tree.isdir(path):\n size = 0\n files_mtimes = {}\n for file_path in tree.walk_files(path):\n try:\n stats = tree.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 += stats.st_size\n files_mtimes[file_path] = stats.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 = tree.stat(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": 63, "end_line": 84, "span_ids": ["BasePathNotInCheckedPathException.__init__", "BasePathNotInCheckedPathException", "contains_symlink_up_to"], "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": "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 = os.fspath(base_path)\n path = os.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": 87, "end_line": 108, "span_ids": ["move"], "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 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 dst = os.path.abspath(dst)\n tmp = f\"{dst}.{uuid()}\"\n\n if os.path.islink(src):\n # readlink does not accept path-like obj for Windows in Python <3.8\n shutil.copy(os.readlink(os.fspath(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": 111, "end_line": 153, "span_ids": ["_chmod", "path_isin", "_unlink", "remove"], "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 _chmod(func, p, excinfo): # pylint: disable=unused-argument\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 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(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": 156, "end_line": 168, "span_ids": ["makedirs"], "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 makedirs(path, exist_ok=False, mode=None):\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": 171, "end_line": 210, "span_ids": ["walk_files", "copyfile", "copy_fobj_to_file"], "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 copyfile(src, dest, no_progress_bar=False, name=None):\n \"\"\"Copy file with progress bar\"\"\"\n from dvc.progress import Tqdm\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 copy_fobj_to_file(fsrc, dest):\n \"\"\"Copy contents of open file object to destination path.\"\"\"\n with open(dest, \"wb+\") as fdest:\n shutil.copyfileobj(fsrc, fdest)\n\n\ndef walk_files(directory):\n for root, _, files in os.walk(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": 23, "span_ids": ["imports", "open_url"], "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 io\nfrom contextlib import contextmanager\n\nfrom dvc.utils.stream import IterStream\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/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": 6, "span_ids": ["impl"], "tokens": 37}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 # file is created during dvc build\n from .build import PKG # noqa, pylint:disable=unused-import\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/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": 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": "@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,protected-access\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": 123, "span_ids": ["main"], "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 main():\n import os\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": 416}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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, pylint: disable=unused-import\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": 101, "span_ids": ["impl:29", "impl:15"], "tokens": 630}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 \"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 \"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,<4\",\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 \"tabulate>=0.8.7\",\n \"pygtrie==2.3.2\",\n \"dpath>=2.0.1,<3\",\n \"shtab>=1.1.0,<2\",\n]\n\n\n# Extra dependencies for remote integrations\n\ngs = [\"google-cloud-storage==1.19.0\"]\ngdrive = [\"pydrive2>=1.4.14\"]\ns3 = [\"boto3>=1.9.201\"]\nazure = [\"azure-storage-blob==2.1.0\", \"knack\"]\noss = [\"oss2==2.6.1\"]\nssh = [\"paramiko>=2.5.0\"]\nhdfs = [\"pyarrow>=0.17.0\"]\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": 34, "span_ids": ["reset_loglevel", "imports", "_close_pools"], "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": "import os\n\nimport pytest\n\nfrom .dir_helpers import * # noqa, pylint: disable=wildcard-import\nfrom .remotes import * # noqa, pylint: disable=wildcard-import\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\n@pytest.fixture(scope=\"session\", autouse=True)\ndef _close_pools():\n from dvc.remote.pool import close_pools\n\n yield\n close_pools()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\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": 32, "span_ids": ["imports"], "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": "import filecmp\nimport logging\nimport os\nimport posixpath\nimport shutil\nimport time\n\nimport colorama\nimport pytest\nfrom mock import call, patch\n\nimport dvc as dvc_module\nfrom dvc.cache import Cache\nfrom dvc.dvcfile import DVC_FILE_SUFFIX\nfrom dvc.exceptions import (\n DvcException,\n OutputDuplicationError,\n OverlappingOutputPathsError,\n RecursiveAddingWhileUsingFilename,\n YAMLFileCorruptedError,\n)\nfrom dvc.main import main\nfrom dvc.output.base import OutputAlreadyTrackedError, OutputIsStageFileError\nfrom dvc.remote.local import LocalRemoteTree\nfrom dvc.repo import Repo as DvcRepo\nfrom dvc.stage import Stage\nfrom dvc.system import System\nfrom dvc.utils import LARGE_DIR_SIZE, file_md5, relpath\nfrom dvc.utils.fs import path_isin\nfrom dvc.utils.yaml import load_yaml\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_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": 54, "end_line": 85, "span_ids": ["test_add_unicode", "test_add_unsupported_file", "TestAddDirectoryRecursive", "TestAddDirectoryRecursive.test", "test_add_directory"], "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_add_unicode(tmp_dir, dvc):\n with open(\"\\xe1\", \"wb\") as fd:\n fd.write(b\"something\")\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_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": 334, "end_line": 360, "span_ids": ["test_should_update_state_entry_for_file_after_add"], "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_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\", \"--single-stage\", \"-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": 363, "end_line": 395, "span_ids": ["test_should_update_state_entry_for_directory_after_add"], "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_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(\n [\"run\", \"--single-stage\", \"-d\", \"data\", \"{} {}\".format(ls, \"data\")]\n )\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_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": 478, "end_line": 502, "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(YAMLFileCorruptedError):\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": 525, "end_line": 559, "span_ids": ["temporary_windows_drive"], "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": "@pytest.fixture\ndef temporary_windows_drive(tmp_path_factory):\n import string\n import win32api # pylint: disable=import-error\n from ctypes import windll\n from win32con import DDD_REMOVE_DEFINITION # pylint: disable=import-error\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 = f\"{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, os.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, os.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": 578, "end_line": 604, "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(LocalRemoteTree, \"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.tree, \"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": 607, "end_line": 632, "span_ids": ["test_should_relink_on_repeated_add"], "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": "@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.tree, 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_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": 32, "span_ids": ["imports", "test_get_url"], "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": "import os\n\nimport pytest\n\nfrom dvc import api\nfrom dvc.api import UrlNotDvcRepoError\nfrom dvc.exceptions import FileMissingError\nfrom dvc.path_info import URLInfo\nfrom dvc.utils.fs import remove\n\ncloud_names = [\n \"s3\",\n \"gs\",\n \"azure\",\n \"gdrive\",\n \"oss\",\n \"ssh\",\n \"hdfs\",\n \"http\",\n]\nclouds = [pytest.lazy_fixture(cloud) for cloud in cloud_names]\nall_clouds = [pytest.lazy_fixture(\"local_cloud\")] + clouds\n\n# `lazy_fixture` is confusing pylint, pylint: disable=unused-argument\n\n\n@pytest.mark.parametrize(\"remote\", clouds, indirect=True)\ndef test_get_url(tmp_dir, dvc, remote):\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": 35, "end_line": 44, "span_ids": ["test_get_url_external"], "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": "@pytest.mark.parametrize(\"cloud\", clouds)\ndef test_get_url_external(erepo_dir, cloud):\n erepo_dir.add_remote(config=cloud.config)\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 = f\"file://{erepo_dir}\"\n expected_url = URLInfo(cloud.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": 47, "end_line": 66, "span_ids": ["test_open", "test_get_url_requires_dvc"], "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_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=os.fspath(tmp_dir))\n\n with pytest.raises(UrlNotDvcRepoError):\n api.get_url(\"foo\", repo=f\"file://{tmp_dir}\")\n\n\n@pytest.mark.parametrize(\"remote\", all_clouds, indirect=True)\ndef test_open(tmp_dir, dvc, remote):\n tmp_dir.dvc_gen(\"foo\", \"foo-text\")\n 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_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": 43, "end_line": 58, "span_ids": ["TestCacheLoadBadDirCache._do_test", "TestCacheLoadBadDirCache.test", "TestCacheLoadBadDirCache"], "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 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 dir_hash = \"123.dir\"\n fname = os.fspath(self.dvc.cache.local.hash_to_path_info(dir_hash))\n self.create(fname, \"not,json\")\n with pytest.raises(DirCacheError):\n self.dvc.cache.local.load_dir_cache(dir_hash)\n\n dir_hash = \"234.dir\"\n fname = os.fspath(self.dvc.cache.local.hash_to_path_info(dir_hash))\n self.create(fname, '{\"a\": \"b\"}')\n self._do_test(self.dvc.cache.local.load_dir_cache(dir_hash))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\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": 33, "span_ids": ["imports"], "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": "import collections\nimport filecmp\nimport logging\nimport os\nimport shutil\n\nimport pytest\nfrom mock import patch\n\nfrom dvc.dvcfile import DVC_FILE_SUFFIX, PIPELINE_FILE, Dvcfile\nfrom dvc.exceptions import (\n CheckoutError,\n CheckoutErrorSuggestGit,\n ConfirmRemoveError,\n DvcException,\n NoOutputOrStageError,\n)\nfrom dvc.main import main\nfrom dvc.remote.base import CloudCache, Remote\nfrom dvc.remote.local import LocalRemoteTree\nfrom dvc.remote.s3 import S3RemoteTree\nfrom dvc.repo import Repo as DvcRepo\nfrom dvc.stage import Stage\nfrom dvc.stage.exceptions import StageFileDoesNotExistError\nfrom dvc.system import System\nfrom dvc.utils import relpath\nfrom dvc.utils.fs import walk_files\nfrom dvc.utils.yaml import dump_yaml, load_yaml\nfrom tests.basic_env import TestDvc, TestDvcGit\nfrom tests.func.test_repro import TestRepro\nfrom tests.remotes import S3\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_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": 485, "end_line": 510, "span_ids": ["test_checkout_no_checksum", "test_checkout_relink"], "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_checkout_no_checksum(tmp_dir, dvc):\n tmp_dir.gen(\"file\", \"file content\")\n stage = dvc.run(\n outs=[\"file\"], no_exec=True, cmd=\"somecmd\", single_stage=True\n )\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": 685, "end_line": 709, "span_ids": ["test_stats_does_not_show_changes_by_default", "test_checkout_with_relink_existing"], "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": "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 files 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": 712, "end_line": 730, "span_ids": ["test_checkout_with_deps"], "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": "def test_checkout_with_deps(tmp_dir, dvc):\n tmp_dir.dvc_gen({\"foo\": \"foo\"})\n dvc.run(\n fname=\"copy_file.dvc\",\n cmd=\"echo foo > bar\",\n outs=[\"bar\"],\n deps=[\"foo\"],\n single_stage=True,\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_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_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": 22, "span_ids": ["_get_dep", "imports", "test_scheme"], "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 copy\n\nimport pytest\n\nfrom dvc.dependency import DEP_MAP, _get\nfrom dvc.stage import Stage\nfrom tests.func.test_output import TESTS as OUT_TESTS\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 # pylint: disable=unidiomatic-typecheck\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": 31, "span_ids": ["imports", "digest", "test_no_scm", "test_added"], "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 hashlib\nimport os\n\nimport pytest\nfrom funcy import first\n\nfrom dvc.exceptions import DvcException\nfrom dvc.utils.fs import remove\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": 34, "end_line": 54, "span_ids": ["test_no_cache_entry"], "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": "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(tmp_dir / \".dvc\" / \"cache\")\n (tmp_dir / \".dvc\" / \"tmp\" / \"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": 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\n\nfrom mock import patch\n\nfrom dvc.external_repo import external_repo\nfrom dvc.path_info import PathInfo\nfrom dvc.remote.local import LocalRemoteTree\nfrom dvc.scm.git import Git\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 = os.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": 64, "span_ids": ["test_cache_reused", "test_source_change"], "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 test_source_change(erepo_dir):\n url = os.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, local_cloud):\n erepo_dir.add_remote(config=local_cloud.config)\n with erepo_dir.chdir():\n erepo_dir.dvc_gen(\"file\", \"text\", commit=\"add file\")\n erepo_dir.dvc.push()\n\n download_spy = mocker.spy(LocalRemoteTree, \"download\")\n\n # Use URL to prevent any fishy optimizations\n url = f\"file://{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_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": 102, "end_line": 124, "span_ids": ["test_relative_remote"], "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": "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 erepo_dir.add_remote(url=upstream_url)\n\n erepo_dir.dvc.push()\n\n (erepo_dir / \"file\").unlink()\n remove(erepo_dir.dvc.cache.local.cache_dir)\n\n url = os.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 copyfile, makedirs\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": 49, "span_ids": ["TestGC.test_cli", "imports", "TestGC", "TestGC.setUp", "TestGC.test_api", "TestGC._test_gc"], "tokens": 309}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 shutil\n\nimport configobj\nimport pytest\nfrom git import Repo\n\nfrom dvc.exceptions import CollectCacheError\nfrom dvc.main import main\nfrom dvc.remote.local import LocalRemoteTree\nfrom dvc.repo import Repo as DvcRepo\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.hash_to_path_info(md5)\n for md5 in self.dvc.cache.local.tree.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": 136, "end_line": 180, "span_ids": ["TestGCMultipleDvcRepos.test"], "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": "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 = \"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 = \"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_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": 64, "end_line": 78, "span_ids": ["test_cache_type_is_properly_overridden"], "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_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(os.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__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": 101, "end_line": 114, "span_ids": ["test_get_full_dvc_path", "test_get_a_dvc_file"], "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": "# 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(os.fspath(external_data), external=True)\n erepo_dir.scm_add(\"ext_data.dvc\", commit=\"add external data\")\n\n Repo.get(\n os.fspath(erepo_dir), os.fspath(external_data), \"ext_data_imported\"\n )\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": 117, "end_line": 133, "span_ids": ["test_non_cached_output"], "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_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],\n cmd=\"echo hello > non_cached_file\",\n single_stage=True,\n )\n erepo_dir.scm_add([src, src + \".dvc\"], commit=\"add non-cached output\")\n\n Repo.get(os.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_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": 175, "end_line": 201, "span_ids": ["test_get_file_from_dir"], "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_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(os.fspath(erepo_dir), os.path.join(\"dir\", \"1\"))\n assert (tmp_dir / \"1\").read_text() == \"1\"\n\n Repo.get(os.fspath(erepo_dir), os.path.join(\"dir\", \"2\"), out=\"file\")\n assert (tmp_dir / \"file\").read_text() == \"2\"\n\n Repo.get(os.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(\n os.fspath(erepo_dir), os.path.join(\"dir\", \"subdir\", \"foo\"), out=\"X\"\n )\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_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": 29, "span_ids": ["imports", "test_get_file", "test_get_url_nonexistent", "test_get_url_to_dir"], "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 pytest\n\nfrom dvc.dependency.base import DependencyDoesNotExistError\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\"\n\n\ndef test_get_url_nonexistent(tmp_dir):\n with pytest.raises(DependencyDoesNotExistError):\n Repo.get_url(\"nonexistent\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\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": 38, "end_line": 47, "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_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": 89, "end_line": 109, "span_ids": ["test_ignore_collecting_dvcignores"], "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": "@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(\n os.fspath(top_ignore_file), WorkingTree(dvc.root_dir)\n )\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_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": 28, "span_ids": ["imports", "test_import"], "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 filecmp\nimport os\n\nimport pytest\nfrom mock import patch\n\nimport dvc.data_cloud as cloud\nfrom dvc.cache import Cache\nfrom dvc.config import NoRemoteError\nfrom dvc.dvcfile import Dvcfile\nfrom dvc.exceptions import DownloadError, PathMissingError\nfrom dvc.system import System\nfrom dvc.utils.fs import makedirs, remove\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(os.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\": os.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": 32, "end_line": 46, "span_ids": ["test_import_git_file"], "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": "@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(os.fspath(git_dir), \"src\", \"dst\")\n\n assert (tmp_dir / \"dst\").read_text() == \"hello\"\n assert tmp_dir.scm.repo.git.check_ignore(os.fspath(tmp_dir / \"dst\"))\n assert stage.deps[0].def_repo == {\n \"url\": os.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_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": 66, "end_line": 80, "span_ids": ["test_import_git_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": "@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(os.fspath(git_dir), \"src\", \"dst\")\n\n assert (tmp_dir / \"dst\").read_text() == {\"file.txt\": \"hello\"}\n assert tmp_dir.scm.repo.git.check_ignore(os.fspath(tmp_dir / \"dst\"))\n assert stage.deps[0].def_repo == {\n \"url\": os.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": 83, "end_line": 94, "span_ids": ["test_import_dir"], "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": "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(os.fspath(erepo_dir), \"dir\", \"dir_imported\")\n\n assert (tmp_dir / \"dir_imported\").read_text() == {\"foo\": \"foo content\"}\n assert scm.repo.git.check_ignore(\"dir_imported\")\n assert stage.deps[0].def_repo == {\n \"url\": os.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": 100, "end_line": 135, "span_ids": ["test_import_file_from_dir"], "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 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(os.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\": os.fspath(erepo_dir),\n \"rev_lock\": erepo_dir.scm.get_rev(),\n }\n\n dvc.imp(os.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(os.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(\n os.fspath(erepo_dir), os.path.join(\"dir\", \"subdir\", \"foo\"), out=\"X\"\n )\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": 138, "end_line": 159, "span_ids": ["test_import_non_cached"], "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_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=f\"echo hello > {src}\", outs_no_cache=[src], single_stage=True,\n )\n\n erepo_dir.scm_add(\n [os.fspath(erepo_dir / src)], commit=\"add a non-cached out\"\n )\n\n stage = tmp_dir.dvc.imp(os.fspath(erepo_dir), src, dst)\n\n assert (tmp_dir / dst).is_file()\n assert filecmp.cmp(erepo_dir / src, tmp_dir / dst, shallow=False)\n assert tmp_dir.scm.repo.git.check_ignore(dst)\n assert stage.deps[0].def_repo == {\n \"url\": os.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": 162, "end_line": 176, "span_ids": ["test_import_rev"], "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": "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(os.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\": os.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": 179, "end_line": 192, "span_ids": ["test_pull_imported_stage"], "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_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(os.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": 195, "end_line": 211, "span_ids": ["test_cache_type_is_properly_overridden"], "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_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(os.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_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": 229, "end_line": 243, "span_ids": ["test_download_error_pulling_imported_stage"], "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_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(os.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.local.LocalRemoteTree._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": 246, "end_line": 259, "span_ids": ["test_import_to_dir"], "tokens": 144}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(os.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": 262, "end_line": 278, "span_ids": ["test_pull_non_workspace"], "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": "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(os.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(os.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": 281, "end_line": 306, "span_ids": ["test_import_non_existing", "test_pull_no_rev_lock"], "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_import_non_existing(erepo_dir, tmp_dir, dvc):\n with pytest.raises(PathMissingError):\n tmp_dir.dvc.imp(os.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(os.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(os.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_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": 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": "import os\nfrom uuid import uuid4\n\nimport pytest\n\nfrom dvc.dependency.base import DependencyDoesNotExistError\nfrom dvc.main import main\nfrom dvc.stage import Stage\nfrom dvc.utils.fs import makedirs\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\", os.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_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_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": 86, "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": 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": "import logging\nimport os\n\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, 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(os.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 == os.fspath(tmp_dir / \"subdir\")\n assert repo.scm.root_dir == os.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": 89, "end_line": 104, "span_ids": ["test_subdir_init_no_option"], "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_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(os.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": 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": "import os\nimport pathlib\nimport sys\n\nimport pytest\n\nfrom dvc.exceptions import GitHookAlreadyExistsError\nfrom dvc.utils import file_md5\n\n\n@pytest.mark.skipif(\n sys.platform == \"win32\", reason=\"Git hooks aren't supported on Windows\"\n)\nclass TestInstall:\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": 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 sys.platform == \"win32\", reason=\"Git hooks aren't supported on Windows\"\n)\nclass TestInstall:\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\": os.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(os.fspath(git_remote))\n scm.repo.create_remote(\"origin\", os.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": 24, "span_ids": ["TestLock.test_cli", "imports", "TestLock.test_with", "TestLock"], "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 dvc.lock import Lock, 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, \"tmp\", \"lock\")\n lock = Lock(lockfile)\n with lock:\n with self.assertRaises(LockError):\n lock2 = Lock(lockfile)\n with lock2:\n pass\n\n def test_cli(self):\n lockfile = os.path.join(self.dvc.dvc_dir, \"tmp\", \"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": 29, "span_ids": ["imports", "match_files"], "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": "import os\nimport shutil\nimport textwrap\n\nimport pytest\n\nfrom dvc.exceptions import PathMissingError\nfrom dvc.repo import Repo\nfrom dvc.scm.base import CloneError\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": 32, "end_line": 53, "span_ids": ["create_dvc_pipeline"], "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 create_dvc_pipeline(tmp_dir, dvc):\n script = textwrap.dedent(\n \"\"\"\\\n import os, sys\n f = sys.argv[1]\n os.makedirs(os.path.dirname(f))\n open(f, \"w+\").close()\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 \"cmd\": \"python script.py {}\".format(os.path.join(\"out\", \"file\")),\n \"outs\": [os.path.join(\"out\", \"file\")],\n \"deps\": [\"dep\"],\n \"fname\": \"out.dvc\",\n \"single_stage\": True,\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": 56, "end_line": 71, "span_ids": ["test_ls_repo"], "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_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(os.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": 74, "end_line": 99, "span_ids": ["test_ls_repo_with_color"], "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": "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\", os.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": 102, "end_line": 126, "span_ids": ["test_ls_repo_recursive"], "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": "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(os.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_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": 171, "end_line": 185, "span_ids": ["test_ls_repo_with_path_subdir"], "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_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(os.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_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": 208, "end_line": 263, "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_dvc_only"], "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_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(os.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(os.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(os.fspath(tmp_dir), path=\"missed_path\")\n assert not exc_info.value.dvc_only\n\n\ndef test_ls_repo_with_missed_path_dvc_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 os.fspath(tmp_dir),\n path=\"missed_path\",\n recursive=True,\n dvc_only=True,\n )\n assert exc_info.value.dvc_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(os.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": 266, "end_line": 280, "span_ids": ["test_ls_repo_with_removed_dvc_dir_recursive"], "tokens": 107}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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(os.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": 283, "end_line": 296, "span_ids": ["test_ls_repo_with_removed_dvc_dir_with_path_file", "test_ls_repo_with_removed_dvc_dir_with_path_dir"], "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_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(os.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(os.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": 299, "end_line": 316, "span_ids": ["test_ls_remote_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": "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 = f\"file://{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": 319, "end_line": 345, "span_ids": ["test_ls_remote_repo_recursive"], "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": "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 = f\"file://{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": 348, "end_line": 382, "span_ids": ["test_ls_remote_git_only_repo_recursive", "test_ls_remote_repo_with_path_dir"], "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 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 = f\"file://{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 = f\"file://{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": 385, "end_line": 400, "span_ids": ["test_ls_remote_repo_with_rev"], "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_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 = f\"file://{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_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_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": 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 errno\nimport os\nimport stat\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.base import BaseRemoteTree, RemoteCacheRequiredError\nfrom dvc.remote.local import LocalRemoteTree\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": 125, "end_line": 145, "span_ids": ["TestRemoteShouldHandleUppercaseRemoteName.test", "TestRemoteShouldHandleUppercaseRemoteName", "test_show_default"], "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 test_show_default(dvc, capsys):\n assert main([\"remote\", \"add\", \"foo\", \"s3://bucket/name\"]) == 0\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": 176, "end_line": 208, "span_ids": ["test_partial_push_n_pull"], "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": "def test_partial_push_n_pull(tmp_dir, dvc, tmp_path_factory, local_remote):\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 = LocalRemoteTree._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(LocalRemoteTree, \"_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.tree.exists(remote.hash_to_path_info(foo.checksum))\n assert remote.tree.exists(remote.hash_to_path_info(bar.checksum))\n assert not remote.tree.exists(remote.hash_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(LocalRemoteTree, \"_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_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": 67, "span_ids": ["imports", "test_destroy"], "tokens": 435}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 operator import itemgetter\n\nimport pytest\n\nfrom dvc.cache import Cache\nfrom dvc.dvcfile import PIPELINE_FILE, PIPELINE_LOCK\nfrom dvc.exceptions import NoOutputOrStageError\nfrom dvc.path_info import PathInfo\nfrom dvc.repo import Repo\nfrom dvc.stage.exceptions import (\n StageFileDoesNotExistError,\n StageNameUnspecified,\n StageNotFound,\n)\nfrom dvc.system import System\nfrom dvc.utils import relpath\nfrom dvc.utils.fs import remove\n\n\ndef test_destroy(tmp_dir, dvc, run_copy):\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 run_copy(\"file\", \"file2\", single_stage=True)\n run_copy(\"file2\", \"file3\", name=\"copy-file2-file3\")\n run_copy(\"file3\", \"file4\", name=\"copy-file3-file4\")\n\n dvc.destroy()\n\n # Remove all the files related to DVC\n for path in [\n \".dvc\",\n \"file.dvc\",\n \"file2.dvc\",\n \"dir.dvc\",\n PIPELINE_FILE,\n PIPELINE_LOCK,\n ]:\n assert not (tmp_dir / path).exists()\n\n # Leave the rest of the files\n for path in [\n \"file\",\n \"file2\",\n \"file3\",\n \"file4\",\n \"dir/file\",\n \"dir/subdir/file\",\n ]:\n assert (tmp_dir / path).is_file()\n\n # Make sure that data was unprotected after `destroy`\n for path in [\n \"file\",\n \"file2\",\n \"file3\",\n \"file4\",\n \"dir\",\n \"dir/file\",\n \"dir/subdir\",\n \"dir/subdir/file\",\n ]:\n assert not System.is_symlink(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_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": 202, "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=f\"mkdir {out_dir}\",\n single_stage=True,\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\": f\"echo something > {output}\",\n \"outs\": [{\"path\": output}],\n }\n dump_yaml(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.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_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": 1438, "end_line": 1513, "span_ids": ["repro_dir"], "tokens": 621}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\", os.fspath(origin_copy), single_stage=True)\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 os.fspath(origin_copy),\n os.fspath(origin_copy_2),\n fname=os.fspath(origin_copy_2) + \".dvc\",\n single_stage=True,\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 os.fspath(dir_file_path),\n os.fspath(dir_file_copy),\n fname=os.fspath(dir_file_copy) + \".dvc\",\n single_stage=True,\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\" / DVC_FILE\n deps = [os.fspath(origin_copy_2), os.fspath(dir_file_copy)]\n stage = dvc.run(\n cmd=\"echo {}\".format(\" \".join(deps)),\n fname=os.fspath(last_stage),\n deps=deps,\n single_stage=True,\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 (\n run_copy(os.fspath(origin_copy), \"unrelated1\", single_stage=True)\n is not None\n )\n assert (\n run_copy(os.fspath(dir_file_path), \"unrelated2\", single_stage=True)\n is not None\n )\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_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": 124, "end_line": 135, "span_ids": ["test_get_gitignore_subdir"], "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_get_gitignore_subdir(tmp_dir, scm):\n tmp_dir.gen({\"dir1\": {\"file1\": \"cont\", \"dir2\": {}}})\n\n data_dir = os.fspath(tmp_dir / \"dir1\" / \"file1\")\n entry, gitignore = scm._get_gitignore(data_dir)\n assert entry == \"/file1\"\n assert gitignore == os.fspath(tmp_dir / \"dir1\" / \".gitignore\")\n\n data_dir = os.fspath(tmp_dir / \"dir1\" / \"dir2\")\n entry, gitignore = scm._get_gitignore(data_dir)\n assert entry == \"/dir2\"\n assert gitignore == os.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": 138, "end_line": 166, "span_ids": ["test_gitignore_should_end_with_newline", "test_gitignore_should_append_newline_to_gitignore"], "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_gitignore_should_end_with_newline(tmp_dir, scm):\n tmp_dir.gen({\"foo\": \"foo\", \"bar\": \"bar\"})\n\n foo = os.fspath(tmp_dir / \"foo\")\n bar = os.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 = os.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": 111, "span_ids": ["TestDefaultWorkingDirectory", "TestDefaultWorkingDirectory.test_ignored_in_checksum"], "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 TestDefaultWorkingDirectory(TestDvc):\n def test_ignored_in_checksum(self):\n stage = self.dvc.run(\n cmd=f\"echo test > {self.FOO}\",\n deps=[self.BAR],\n outs=[self.FOO],\n single_stage=True,\n )\n\n d = stage.dumpd()\n self.assertNotIn(Stage.PARAM_WDIR, d.keys())\n\n d = load_yaml(stage.relpath)\n self.assertNotIn(Stage.PARAM_WDIR, d.keys())\n\n with self.dvc.lock, self.dvc.state:\n stage = SingleStageFile(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": 156, "end_line": 180, "span_ids": ["test_meta_is_preserved", "test_md5_ignores_comments"], "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": "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 = SingleStageFile(dvc, stage.path).stage\n assert not new_stage.changed_stage()\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_yaml(stage.path)\n data[\"meta\"] = {\"custom_key\": 42}\n dump_yaml(stage.path, data)\n\n # Loading and dumping to test that it works and meta is retained\n dvcfile = SingleStageFile(dvc, stage.path)\n new_stage = dvcfile.stage\n dvcfile.dump(new_stage)\n\n new_data = load_yaml(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_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": 25, "span_ids": ["imports", "TestStatus.test_implied_cloud", "TestStatus.test_quiet", "TestStatus"], "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 os\n\nfrom mock import patch\n\nfrom dvc.main import main\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": 28, "end_line": 42, "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(os.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\": {f\"file ({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_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": 78, "span_ids": ["GitTreeTests", "GitTreeTests.test_isfile", "GitTreeTests.test_exists", "GitTreeTests.test_isdir", "GitTreeTests.test_open"], "tokens": 346}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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:\n # pylint: disable=no-member\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": 81, "end_line": 106, "span_ids": ["TestGitTree.setUp", "TestGitTree", "AssertWalkEqualMixin", "AssertWalkEqualMixin.assertWalkEqual", "TestGitSubmoduleTree", "TestGitSubmoduleTree.setUp"], "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 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:\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": 110, "end_line": 135, "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_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": 388}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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(os.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\": os.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(\n \"version\", \"updated\", commit=\"upgrade to DVC tracking\"\n )\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\": os.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": 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_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(os.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(os.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": 157, "end_line": 190, "span_ids": ["test_update_import_url"], "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": "@pytest.mark.parametrize(\n \"workspace\",\n [\n pytest.lazy_fixture(\"local_cloud\"),\n pytest.lazy_fixture(\"s3\"),\n pytest.lazy_fixture(\"gs\"),\n pytest.lazy_fixture(\"hdfs\"),\n pytest.param(\n pytest.lazy_fixture(\"ssh\"),\n marks=pytest.mark.skipif(\n os.name == \"nt\", reason=\"disabled on windows\"\n ),\n ),\n ],\n indirect=True,\n)\ndef test_update_import_url(tmp_dir, dvc, workspace):\n workspace.gen(\"file\", \"file content\")\n\n dst = tmp_dir / \"imported_file\"\n stage = dvc.imp_url(\"remote://workspace/file\", os.fspath(dst))\n\n assert dst.is_file()\n assert dst.read_text() == \"file content\"\n\n # update data\n workspace.gen(\"file\", \"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_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/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": 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": "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, dvc_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, dvc_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\", dvc_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, dvc_only=False\n )\n\n\ndef test_list_outputs_only(mocker):\n url = \"local_dir\"\n m = _test_cli(mocker, url, None, \"--dvc-only\")\n m.assert_called_once_with(\n url, None, recursive=False, rev=None, dvc_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": 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 logging\n\nfrom dvc.cli import parse_args\nfrom dvc.command.checkout import CmdCheckout, 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": 25, "span_ids": ["imports", "test_default"], "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": "import collections\nimport logging\nimport os\n\nfrom dvc.cli import parse_args\nfrom dvc.command.diff import _show_md\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_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": 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": "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\", no_exec=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/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": 47, "span_ids": ["test_import_url_no_exec", "test_failed_import_url"], "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": "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\n\n\ndef test_import_url_no_exec(mocker):\n cli_args = parse_args(\n [\"import-url\", \"--no-exec\", \"src\", \"out\", \"--file\", \"file\"]\n )\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\", no_exec=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/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": 34, "span_ids": ["test_downstream", "imports", "test_default_arguments"], "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": "from dvc.cli import parse_args\nfrom dvc.command.repro import CmdRepro\nfrom dvc.dvcfile import PIPELINE_FILE\n\ndefault_arguments = {\n \"all_pipelines\": False,\n \"downstream\": False,\n \"dry\": False,\n \"force\": False,\n \"run_cache\": True,\n \"interactive\": False,\n \"no_commit\": False,\n \"pipeline\": False,\n \"single_item\": False,\n \"recursive\": False,\n \"force_downstream\": 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(PIPELINE_FILE, **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(PIPELINE_FILE, **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/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": 67, "span_ids": ["TestLocalOutput.test_save_missing", "imports", "TestLocalOutput._get_output", "test_str_workdir_inside_repo", "TestLocalOutput", "TestLocalOutput._get_cls", "test_str_workdir_outside_repo", "test_str_on_local_absolute_path", "test_str_on_external_absolute_path"], "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 os\n\nfrom mock import patch\n\nfrom dvc.output import LocalOutput\nfrom dvc.remote.local import LocalCache\nfrom dvc.stage import Stage\nfrom dvc.utils import relpath\nfrom tests.basic_env import TestDvc\n\n\nclass TestLocalOutput(TestDvc):\n def _get_cls(self):\n return LocalOutput\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.tree, \"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 = LocalOutput(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 = LocalOutput(stage, \"path\", cache=False)\n\n assert \"path\" == str(output)\n\n stage = Stage(dvc, wdir=\"some_folder\")\n output = LocalOutput(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 = LocalOutput(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 = LocalOutput(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": 39, "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\nfrom voluptuous import MultipleInvalid, Schema\n\nfrom dvc.cache import NamedCache\nfrom dvc.output import CHECKSUM_SCHEMA, BaseOutput\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": 42, "end_line": 90, "span_ids": ["test_get_used_cache", "test_checksum_schema_fail"], "tokens": 395}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 assert Schema(CHECKSUM_SCHEMA)(value)\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: '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, \"addressing\", \"stage.dvc\")\n\n output = BaseOutput(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 BaseOutput, \"checksum\", new_callable=mocker.PropertyMock\n ).return_value = None\n mocker.patch.object(\n BaseOutput, \"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": 44, "span_ids": ["test_isfile", "test_isdir", "imports", "test_makedirs", "test_remove_dir", "test_exists"], "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": "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\nhere = os.path.abspath(os.path.dirname(__file__))\n\n\ndef test_isdir(ssh_connection):\n assert ssh_connection.isdir(here)\n assert not ssh_connection.isdir(__file__)\n\n\ndef test_exists(ssh_connection):\n assert not ssh_connection.exists(\"/path/to/non/existent/file\")\n assert ssh_connection.exists(__file__)\n\n\ndef test_isfile(ssh_connection):\n assert ssh_connection.isfile(__file__)\n assert not ssh_connection.isfile(here)\n\n\ndef test_makedirs(tmp_path, ssh_connection):\n tmp = tmp_path.absolute().as_posix()\n path = posixpath.join(tmp, \"dir\", \"subdir\")\n ssh_connection.makedirs(path)\n assert os.path.isdir(path)\n\n\ndef test_remove_dir(tmp_path, ssh_connection):\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_connection.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": 47, "end_line": 84, "span_ids": ["test_walk"], "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 test_walk(tmp_path, ssh_connection):\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 = {entry.absolute().as_posix() for entry in entries}\n\n paths = set()\n for root, dirs, files in ssh_connection.walk(\n root_path.absolute().as_posix()\n ):\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": 87, "end_line": 97, "span_ids": ["test_reflink"], "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": "@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_connection):\n tmp_dir.gen(\"foo\", \"foo content\")\n ssh_connection.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": 100, "end_line": 135, "span_ids": ["test_copy", "test_symlink", "test_hardlink", "test_move"], "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.skipif(\n platform.system() == \"Windows\",\n reason=\"sftp symlink is not supported on Windows\",\n)\ndef test_symlink(tmp_dir, ssh_connection):\n tmp_dir.gen(\"foo\", \"foo content\")\n ssh_connection.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_connection):\n tmp_dir.gen(\"foo\", \"foo content\")\n ssh_connection.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_connection):\n tmp_dir.gen(\"foo\", \"foo content\")\n ssh_connection.copy(\"foo\", \"link\")\n assert filecmp.cmp(\"foo\", \"link\")\n\n\ndef test_move(tmp_dir, ssh_connection):\n tmp_dir.gen(\"foo\", \"foo content\")\n ssh_connection.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_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": 186, "end_line": 202, "span_ids": ["test_hardlink_optimization"], "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": "def test_hardlink_optimization(dvc, tmp_dir, ssh):\n tree = SSHRemoteTree(dvc, ssh.config)\n\n from_info = tree.path_info / \"empty\"\n to_info = tree.path_info / \"link\"\n\n with tree.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 tree.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": 12, "end_line": 38, "span_ids": ["TestRemoteGDrive", "TestRemoteGDrive.test_init", "TestRemoteGDrive.test_drive"], "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 TestRemoteGDrive:\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 tree = GDriveRemoteTree(dvc, self.CONFIG)\n assert str(tree.path_info) == self.CONFIG[\"url\"]\n\n def test_drive(self, dvc):\n tree = GDriveRemoteTree(dvc, self.CONFIG)\n os.environ[\n GDriveRemoteTree.GDRIVE_CREDENTIALS_DATA\n ] = USER_CREDS_TOKEN_REFRESH_ERROR\n with pytest.raises(GDriveAuthError):\n assert tree._drive\n\n os.environ[GDriveRemoteTree.GDRIVE_CREDENTIALS_DATA] = \"\"\n tree = GDriveRemoteTree(dvc, self.CONFIG)\n os.environ[\n GDriveRemoteTree.GDRIVE_CREDENTIALS_DATA\n ] = USER_CREDS_MISSED_KEY_ERROR\n with pytest.raises(GDriveAuthError):\n assert tree._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_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": 53, "end_line": 89, "span_ids": ["test_digest_auth_method", "test_custom_auth_method"], "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_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 tree = HTTPRemoteTree(dvc, config)\n\n assert tree._auth_method() == auth\n assert isinstance(tree._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 tree = HTTPRemoteTree(dvc, config)\n\n assert tree._auth_method() is None\n assert header in tree.headers\n assert tree.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_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": 48, "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": 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 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 slow_link_detection = dvc.remote.slow_link_detection\n message = slow_link_detection.message # noqa, pylint: disable=no-member\n assert len(caplog.records) == 1\n assert caplog.records[0].message == 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\nimport pytest\nfrom funcy import raiser\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": 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": "import os\n\nimport pytest\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_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_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 = mock_windows.call_args[0]\n else:\n mock_windows.assert_not_called()\n mock_posix.assert_called()\n args = mock_posix.call_args[0]\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_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": 22, "span_ids": ["test_no_remote_imports", "imports"], "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": "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(\n [\"python\", \"-c\", code], stdout=subprocess.PIPE, check=True\n )\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": 28, "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 time\nimport traceback\nfrom datetime import datetime\n\nimport colorama\nimport pytest\n\nimport dvc.logger\nfrom dvc.exceptions import DvcException\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": 31, "end_line": 96, "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": 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 TestColorFormatter:\n # pylint: disable=broad-except\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": 224, "end_line": 250, "span_ids": ["test_logging_debug_with_datetime", "test_handlers", "test_info_with_debug_loglevel_shows_no_datetime"], "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_handlers():\n out, deb, vrb, err = logger.handlers\n\n assert out.level == logging.INFO\n assert deb.level == logging.DEBUG\n assert vrb.level == logging.TRACE\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.trace(\"TRACE\")\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": 58, "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": 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": "import copy\nimport pathlib\n\nimport pytest\n\nfrom dvc.path_info import CloudURLInfo, HTTPURLInfo, PathInfo, URLInfo\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": 32, "span_ids": ["imports", "test_rwlock"], "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": "import os\n\nimport pytest\n\nfrom dvc.lock import LockError\nfrom dvc.path_info import PathInfo\nfrom dvc.rwlock import (\n RWLockFileCorruptedError,\n RWLockFileFormatError,\n _edit_rwlock,\n rwlock,\n)\n\n\ndef test_rwlock(tmp_path):\n path = os.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": 35, "end_line": 55, "span_ids": ["test_rwlock_reentrant"], "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_rwlock_reentrant(tmp_path):\n path = os.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": 58, "end_line": 96, "span_ids": ["test_rwlock_subdirs", "test_broken_rwlock"], "tokens": 320}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 = os.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 = os.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_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": 24, "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\n\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": 44, "span_ids": ["imports", "updater", "mock_tty", "test_fetch", "mock_env"], "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": "import json\nimport logging\nimport os\nimport time\n\nimport mock\nimport pytest\n\nfrom dvc import __version__\nfrom dvc.updater import Updater\n\n\n@pytest.fixture(autouse=True)\ndef mock_env(monkeypatch):\n monkeypatch.delenv(\"CI\", None)\n monkeypatch.setenv(\"DVC_TEST\", \"False\")\n\n\n@pytest.fixture\ndef updater(tmp_path):\n return Updater(tmp_path)\n\n\n@pytest.fixture\ndef mock_tty(mocker):\n return mocker.patch(\"sys.stdout.isatty\", return_value=True)\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) 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_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": 27, "span_ids": ["imports"], "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 filecmp\nimport os\nfrom unittest import TestCase\n\nimport pytest\nfrom mock import patch\n\nimport dvc\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 (\n BasePathNotInCheckedPathException,\n contains_symlink_up_to,\n copy_fobj_to_file,\n copyfile,\n get_inode,\n get_mtime_and_size,\n makedirs,\n move,\n path_isin,\n remove,\n walk_files,\n)\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": 30, "end_line": 46, "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": 129, "end_line": 143, "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": 146, "end_line": 163, "span_ids": ["test_move"], "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_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)\n assert len(os.listdir(dest_info)) == 0\n move(src_info, dest_info)\n assert not os.path.isfile(src_info)\n assert len(os.listdir(dest_info)) == 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": 166, "end_line": 228, "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": 456}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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)\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 # pylint: disable=arguments-out-of-order\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(tmp_dir, \"directory\")\n path_info = PathInfo(os.path.join(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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": 230, "end_line": 276, "span_ids": ["test_copyfile", "test_copy_fobj_to_file", "test_walk_files"], "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": "@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):\n assert filecmp.cmp(\n src_info,\n os.path.join(dest_info, os.path.basename(src_info)),\n shallow=False,\n )\n else:\n assert filecmp.cmp(src_info, dest_info, shallow=False)\n\n\ndef test_copy_fobj_to_file(tmp_dir):\n tmp_dir.gen({\"foo\": \"foo content\"})\n src = tmp_dir / \"foo\"\n dest = \"path\"\n\n with open(src, \"rb\") as fobj:\n copy_fobj_to_file(fobj, dest)\n assert filecmp.cmp(src, dest)\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": 32, "span_ids": ["imports", "test_open_url"], "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": "import io\n\nimport requests\n\nfrom dvc.utils.http import open_url\n\n\ndef test_open_url(tmp_path, monkeypatch, http):\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 http.gen(\"sample.txt\", text * 2)\n\n with open_url((http / \"sample.txt\").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_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/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": 262, "end_line": 287, "span_ids": ["test_pull_git_imports"], "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": "@flaky(max_runs=3, min_passes=1)\n@pytest.mark.parametrize(\n \"erepo\", [pytest.lazy_fixture(\"git_dir\"), pytest.lazy_fixture(\"erepo_dir\")]\n)\ndef test_pull_git_imports(tmp_dir, dvc, scm, 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(os.fspath(erepo), \"foo\")\n dvc.imp(os.fspath(erepo), \"dir\", out=\"new_dir\", rev=\"HEAD~\")\n\n assert dvc.pull()[\"fetched\"] == 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)[\"fetched\"] == 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/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/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": 138, "span_ids": ["Tqdm.wrap_fn", "Tqdm.close"], "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 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 self.postfix[\"info\"] = \"\"\n # remove ETA (either unknown or zero); remove completed bar\n self.bar_format = self.bar_format.replace(\"<{remaining}\", \"\").replace(\n \"|{bar:10}|\", \" \"\n )\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": 140, "end_line": 157, "span_ids": ["Tqdm.format_dict"], "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 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 # assumes `bar_format` has max one of (\"ncols_desc\" & \"ncols_info\")\n ncols_left = (\n ncols - len(self.format_meter(ncols_desc=1, ncols_info=1, **d)) + 1\n )\n ncols_left = max(ncols_left, 0)\n if ncols_left:\n d[\"ncols_desc\"] = d[\"ncols_info\"] = ncols_left\n else:\n # work-around for zero-width description\n d[\"ncols_desc\"] = d[\"ncols_info\"] = 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/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": 182, "end_line": 227, "span_ids": ["test_diff_dirty", "test_no_commits", "test_no_changes"], "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": "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 }\n\n\ndef test_no_changes(tmp_dir, scm, dvc):\n tmp_dir.dvc_gen(\"file\", \"first\", commit=\"add a file\")\n assert dvc.diff() == {}\n\n\ndef test_no_commits(tmp_dir):\n from dvc.repo import Repo\n from dvc.scm.git import Git\n from tests.dir_helpers import git_init\n\n git_init(\".\")\n assert Git().no_commits\n\n assert Repo.init().diff() == {}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": 67, "end_line": 92, "span_ids": ["test_protect_ignore_erofs", "test_protect_ignore_errors"], "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(\"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 tree = LocalRemoteTree(None, {})\n\n tree.protect(foo)\n\n mock_chmod = mocker.patch(\n \"os.chmod\", side_effect=OSError(err, \"something\")\n )\n tree.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 tree = LocalRemoteTree(None, {})\n\n mock_chmod = mocker.patch(\n \"os.chmod\", side_effect=OSError(errno.EROFS, \"read-only fs\")\n )\n tree.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_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": 34, "end_line": 44, "span_ids": ["test_makedirs_not_create_for_top_level_path"], "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.parametrize(\"tree_cls\", [GSRemoteTree, S3RemoteTree])\ndef test_makedirs_not_create_for_top_level_path(tree_cls, dvc, mocker):\n url = f\"{tree_cls.scheme}://bucket/\"\n tree = tree_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(tree_cls, tree.scheme, mocked_client)\n\n tree.makedirs(tree.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": 10, "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\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": 52, "end_line": 85, "span_ids": ["send", "is_enabled"], "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": "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) 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_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": 57, "end_line": 119, "span_ids": ["add_parser"], "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": "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.add_argument(\n \"--show-md\",\n action=\"store_true\",\n default=False,\n help=\"Show tabulated output in the Markdown format (GFM).\",\n )\n params_diff_parser.add_argument(\n \"--no-path\",\n action=\"store_true\",\n default=False,\n help=\"Don't show params path.\",\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/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": 78}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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:\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": 47, "end_line": 71, "span_ids": ["show"], "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": "@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 workspace 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(\"workspace\") == res.get(active_branch):\n res.pop(\"workspace\", 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": 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_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(cmd=\"echo params.yaml\", params=[\"foo\"], single_stage=True)\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(cmd=\"echo params.yaml\", params=[\"foo\"], single_stage=True)\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": 41, "end_line": 73, "span_ids": ["test_diff_new", "test_diff_deleted_config", "test_diff_deleted"], "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": "def test_diff_new(tmp_dir, scm, dvc):\n tmp_dir.gen(\"params.yaml\", \"foo: bar\")\n dvc.run(cmd=\"echo params.yaml\", params=[\"foo\"], single_stage=True)\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(cmd=\"echo params.yaml\", params=[\"foo\"], single_stage=True)\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(cmd=\"echo params.yaml\", params=[\"foo\"], single_stage=True)\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": 76, "end_line": 88, "span_ids": ["test_diff_list"], "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_diff_list(tmp_dir, scm, dvc):\n tmp_dir.gen(\"params.yaml\", \"foo:\\n- bar\\n- baz\")\n dvc.run(cmd=\"echo params.yaml\", params=[\"foo\"], single_stage=True)\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/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": 40, "span_ids": ["imports", "test_fetch"], "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": "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 \"--run-cache\",\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, return_value=0)\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 run_cache=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": 43, "end_line": 80, "span_ids": ["test_pull"], "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": "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 \"--run-cache\",\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 run_cache=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": 83, "end_line": 119, "span_ids": ["test_push"], "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": "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 \"--run-cache\",\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, return_value=0)\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 run_cache=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": 39, "end_line": 90, "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": 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": "def test_metrics_show_json_diff():\n assert _show_diff(\n {\"metrics.json\": {\"a.b.c\": {\"old\": 1, \"new\": 2, \"diff\": 3}}}\n ) == textwrap.dedent(\n \"\"\"\\\n Path Metric Value Change\n metrics.json a.b.c 2 3\"\"\"\n )\n\n\ndef test_metrics_show_raw_diff():\n assert _show_diff(\n {\"metrics\": {\"\": {\"old\": \"1\", \"new\": \"2\"}}}\n ) == textwrap.dedent(\n \"\"\"\\\n Path Metric Value Change\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 ) == textwrap.dedent(\n \"\"\"\\\n Path Metric Value Change\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 ) == textwrap.dedent(\n \"\"\"\\\n Path Metric Value Change\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 ) == textwrap.dedent(\n \"\"\"\\\n Path Metric Value Change\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": 30, "span_ids": ["imports", "test_params_diff"], "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": "import logging\nimport textwrap\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 [\n \"params\",\n \"diff\",\n \"HEAD~10\",\n \"HEAD~1\",\n \"--all\",\n \"--show-json\",\n \"--show-md\",\n \"--no-path\",\n ]\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": 24, "end_line": 85, "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": 461}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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(\n {\"params.yaml\": {\"a.b.c\": {\"old\": 1, \"new\": 2}}}\n ) == textwrap.dedent(\n \"\"\"\\\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 ) == textwrap.dedent(\n \"\"\"\\\n Path Param Old New\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 ) == textwrap.dedent(\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 ) == textwrap.dedent(\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 ) == textwrap.dedent(\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 ) == textwrap.dedent(\n \"\"\"\\\n Path Param Old New\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/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": 30, "span_ids": ["imports", "test_url"], "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": "import getpass\nimport os\nimport sys\n\nimport pytest\nfrom mock import mock_open, patch\n\nfrom dvc.remote.ssh import SSHRemoteTree\nfrom dvc.system import System\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 = f\"ssh://{user}@{host}:{port}{path}\"\n config = {\"url\": url}\n\n tree = SSHRemoteTree(dvc, config)\n assert tree.path_info == url\n\n # SCP-like URL ssh://[user@]host.xz:/absolute/path\n url = f\"ssh://{user}@{host}:{path}\"\n config = {\"url\": url}\n\n tree = SSHRemoteTree(dvc, config)\n assert tree.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": 33, "end_line": 50, "span_ids": ["test_no_path", "impl"], "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_no_path(dvc):\n config = {\"url\": \"ssh://127.0.0.1\"}\n tree = SSHRemoteTree(dvc, config)\n assert tree.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/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": 55, "span_ids": ["test_gs_no_credspath", "test_dynamic_chunk_size", "test_init", "imports", "test_gs"], "tokens": 331}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 GSRemoteTree, dynamic_chunk_size\n\nBUCKET = \"bucket\"\nPREFIX = \"prefix\"\nURL = f\"gs://{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 tree = GSRemoteTree(dvc, CONFIG)\n assert tree.path_info == URL\n assert tree.projectname == PROJECT\n assert tree.credentialpath == CREDENTIALPATH\n\n\n@mock.patch(\"google.cloud.storage.Client.from_service_account_json\")\ndef test_gs(mock_client, dvc):\n tree = GSRemoteTree(dvc, CONFIG)\n assert tree.credentialpath\n assert tree.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 tree = GSRemoteTree(dvc, config)\n assert tree.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/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/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": 93, "end_line": 101, "span_ids": ["DataCloud._save_pulled_checksums"], "tokens": 109}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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:\n\n def _save_pulled_checksums(self, cache):\n for checksum in cache.scheme_keys(\"local\"):\n cache_file = self.repo.cache.local.hash_to_path_info(checksum)\n if self.repo.cache.local.tree.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": 103, "end_line": 119, "span_ids": ["DataCloud.status"], "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 DataCloud:\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.BaseRemote): 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/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.__iter__", "RemoteIndexNoop.load", "RemoteIndexNoop.hashes", "RemoteIndexNoop.intersection", "RemoteIndexNoop.__exit__", "RemoteIndexNoop.dir_hashes", "RemoteIndexNoop.__contains__", "RemoteIndexNoop.__enter__"], "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": "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, hash_):\n return False\n\n @staticmethod\n def hashes():\n return []\n\n @staticmethod\n def dir_hashes():\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": 117, "span_ids": ["RemoteIndex.is_dir_hash", "RemoteIndex._executemany", "RemoteIndex.dir_hashes", "RemoteIndex.__exit__", "RemoteIndex.__init__", "RemoteIndex.hashes", "RemoteIndex.__iter__", "RemoteIndex.__enter__", "RemoteIndex._execute", "RemoteIndex.__contains__", "RemoteIndex"], "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": "class RemoteIndex:\n \"\"\"Class for indexing remote hashes 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 hashes\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(repo.index_dir, f\"{name}{self.INDEX_SUFFIX}\")\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 = f\"SELECT checksum FROM {self.INDEX_TABLE}\"\n for (hash_,) in self._execute(cmd):\n yield hash_\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, hash_):\n cmd = \"SELECT checksum FROM {} WHERE checksum = (?)\".format(\n self.INDEX_TABLE\n )\n self._execute(cmd, (hash_,))\n return self.cursor.fetchone() is not None\n\n def hashes(self):\n \"\"\"Iterate over hashes stored in the index.\"\"\"\n return iter(self)\n\n def dir_hashes(self):\n \"\"\"Iterate over .dir hashes stored in the index.\"\"\"\n cmd = f\"SELECT checksum FROM {self.INDEX_TABLE} WHERE dir = 1\"\n for (hash_,) in self._execute(cmd):\n yield hash_\n\n def is_dir_hash(self, hash_):\n return hash_.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": 170, "end_line": 197, "span_ids": ["RemoteIndex.update", "RemoteIndex.clear", "RemoteIndex.dump"], "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": "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 = f\"DELETE FROM {self.INDEX_TABLE}\"\n self._execute(cmd)\n\n def update(self, dir_hashes, file_hashes):\n \"\"\"Update this index, adding the specified hashes.\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(cmd, ((hash_, True) for hash_ in dir_hashes))\n self._executemany(cmd, ((hash_, False) for hash_ in file_hashes))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": 199, "end_line": 209, "span_ids": ["RemoteIndex.intersection"], "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 RemoteIndex:\n\n def intersection(self, hashes):\n \"\"\"Iterate over values from `hashes` 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, hashes):\n cmd = \"SELECT checksum FROM {} WHERE checksum IN ({})\".format(\n self.INDEX_TABLE, \",\".join(\"?\" for hash_ in chunk)\n )\n for (hash_,) in self._execute(cmd, chunk):\n yield hash_", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": 61, "span_ids": ["imports", "imp_url"], "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": "import os\n\nfrom dvc.repo.scm_context import scm_context\nfrom dvc.utils import relpath, resolve_output, resolve_paths\nfrom dvc.utils.fs import path_isin\n\nfrom ..exceptions import OutputDuplicationError\nfrom . import locked\n\n\n@locked\n@scm_context\ndef imp_url(\n self, url, out=None, fname=None, erepo=None, frozen=True, no_exec=False\n):\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 their own repository\n if (\n erepo is None\n and os.path.exists(url)\n and path_isin(os.path.abspath(url), self.root_dir)\n ):\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()\n\n try:\n self.check_modified_graph([stage])\n except OutputDuplicationError as exc:\n raise OutputDuplicationError(exc.output, set(exc.stages) - {stage})\n\n if no_exec:\n stage.ignore_outs()\n else:\n stage.run()\n\n stage.frozen = frozen\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__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": 50, "end_line": 105, "span_ids": ["_ls"], "tokens": 394}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_only=False):\n from dvc.repo.tree import RepoTree\n\n def onerror(exc):\n raise exc\n\n # use our own RepoTree instance instead of repo.repo_tree since we want to\n # fetch directory listings, but don't want to fetch file contents.\n tree = RepoTree(repo, stream=True)\n\n ret = {}\n try:\n for root, dirs, files in tree.walk(\n path_info.fspath, onerror=onerror, dvcfiles=True\n ):\n for fname in files:\n info = PathInfo(root) / fname\n dvc = tree.isdvc(info)\n if dvc or not dvc_only:\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),\n }\n\n if not recursive:\n for dname in dirs:\n info = PathInfo(root) / dname\n if not dvc_only or (\n tree.dvctree and tree.dvctree.exists(info)\n ):\n dvc = tree.isdvc(info)\n path = str(info.relative_to(path_info))\n ret[path] = {\n \"isout\": dvc,\n \"isdir\": True,\n \"isexec\": False if dvc else tree.isexec(info),\n }\n break\n except NotADirectoryError:\n dvc = tree.isdvc(path_info)\n if dvc or not dvc_only:\n return {\n path_info.name: {\n \"isout\": dvc,\n \"isdir\": False,\n \"isexec\": False if dvc else tree.isexec(path_info),\n }\n }\n return {}\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/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": 39, "end_line": 77, "span_ids": ["_read_metrics", "_extract_metrics"], "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": "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(metric):\n continue\n\n try:\n with tree.open(metric, \"r\") as fobj:\n # NOTE this also supports JSON\n val = yaml.safe_load(fobj)\n except (FileNotFoundError, 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": 27, "span_ids": ["_get_params", "imports", "diff"], "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": "from dvc.utils.diff import diff as _diff\nfrom dvc.utils.diff import format_dict\n\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 if repo.scm.no_commits:\n return {}\n\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/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": 95, "span_ids": ["reproduce"], "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": "@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 dvc.utils import parse_target\n\n assert target is None or isinstance(target, str)\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.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 stage = self.get_stage(path, 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(target, recursive=recursive, graph=active_graph)\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_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": 76, "end_line": 139, "span_ids": ["run"], "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": "@locked\n@scm_context\ndef run(self, fname=None, no_exec=False, single_stage=False, **kwargs):\n from dvc.stage import Stage, create_stage\n from dvc.dvcfile import Dvcfile, PIPELINE_FILE\n\n if not kwargs.get(\"cmd\"):\n raise InvalidArgumentError(\"command is not specified\")\n\n stage_cls = PipelineStage\n path = PIPELINE_FILE\n stage_name = kwargs.get(\"name\")\n\n if stage_name and single_stage:\n raise InvalidArgumentError(\n \"`-n|--name` is incompatible with `--single-stage`\"\n )\n\n if stage_name and fname:\n raise InvalidArgumentError(\n \"`--file` is currently incompatible with `-n|--name` \"\n \"and requires `--single-stage`\"\n )\n\n if not stage_name and not single_stage:\n raise InvalidArgumentError(\"`-n|--name` is required\")\n\n if single_stage:\n kwargs.pop(\"name\", None)\n stage_cls = Stage\n path = fname or _get_file_path(kwargs)\n else:\n if not is_valid_name(stage_name):\n raise InvalidStageName\n\n params = parse_params(kwargs.pop(\"params\", []))\n stage = create_stage(\n stage_cls, repo=self, path=path, params=params, **kwargs\n )\n if stage is None:\n return None\n\n dvcfile = Dvcfile(self, stage.path)\n try:\n if kwargs.get(\"force\", True):\n with suppress(ValueError):\n self.stages.remove(stage)\n else:\n _check_stage_exists(dvcfile, stage)\n self.check_modified_graph([stage])\n except OutputDuplicationError as exc:\n raise OutputDuplicationError(exc.output, set(exc.stages) - {stage})\n\n if no_exec:\n stage.ignore_outs()\n else:\n stage.run(\n no_commit=kwargs.get(\"no_commit\", False),\n run_cache=kwargs.get(\"run_cache\", True),\n )\n\n dvcfile.dump(stage, update_pipeline=True, no_lock=no_exec)\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/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": 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": "\"\"\"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__(f\"Failed to clone repo '{url}' to '{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": 27, "end_line": 56, "span_ids": ["TqdmGit", "TqdmGit.code2desc", "TqdmGit.update_git"], "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 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 message = (op_code + \" | \" + message) if message else op_code\n if message:\n self.postfix[\"info\"] = f\" {message} | \"\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 = {\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 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/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": 87, "span_ids": ["create_stage"], "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 create_stage(cls, repo, path, external=False, **kwargs):\n from dvc.dvcfile import check_dvc_filename\n\n wdir = os.path.abspath(kwargs.get(\"wdir\", None) or os.curdir)\n path = os.path.abspath(path)\n check_dvc_filename(path)\n check_stage_path(repo, wdir, is_wdir=kwargs.get(\"wdir\"))\n check_stage_path(repo, os.path.dirname(path))\n\n stage = loads_from(cls, repo, path, wdir, kwargs)\n fill_stage_outputs(stage, **kwargs)\n if not external:\n check_no_externals(stage)\n fill_stage_dependencies(\n stage, **project(kwargs, [\"deps\", \"erepo\", \"params\"])\n )\n check_circular_dependency(stage)\n check_duplicated_arguments(stage)\n\n if stage and stage.dvcfile.exists():\n has_persist_outs = any(out.persist for out in stage.outs)\n ignore_run_cache = (\n not kwargs.get(\"run_cache\", True) 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_run_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.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": 340, "end_line": 364, "span_ids": ["Stage.is_cached"], "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 Stage(params.StageParams):\n # pylint:disable=no-value-for-parameter\n\n @property\n def is_cached(self):\n \"\"\"Checks if this stage has been already ran and stored\"\"\"\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 self.save_deps()\n if not stage_dump_eq(Stage, old.dumpd(), self.dumpd()):\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.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": 418, "end_line": 438, "span_ids": ["Stage.run"], "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 # pylint:disable=no-value-for-parameter\n\n @rwlocked(read=[\"deps\"], write=[\"outs\"])\n def run(self, dry=False, no_commit=False, force=False, run_cache=True):\n if (self.cmd or self.is_import) and not self.frozen and not dry:\n self.remove_outs(ignore_remove=False, force=False)\n\n if not self.frozen and self.is_import:\n sync_import(self, dry, force)\n elif not self.frozen and self.cmd:\n run_stage(self, dry, force, run_cache)\n else:\n args = (\n (\"outputs\", \"frozen \") if self.frozen else (\"data sources\", \"\")\n )\n logger.info(\"Verifying %s in %s%s\", *args, self)\n if not dry:\n check_missing_outputs(self)\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_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": 529, "end_line": 567, "span_ids": ["PipelineStage.changed_stage", "PipelineStage._changed_stage_entry", "PipelineStage.__eq__", "PipelineStage._status_stage", "PipelineStage.is_cached", "PipelineStage.addressing", "PipelineStage.__init__", "PipelineStage", "PipelineStage.__hash__", "PipelineStage.reload"], "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": "class PipelineStage(Stage):\n def __init__(self, *args, name=None, **kwargs):\n super().__init__(*args, **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 @property\n def addressing(self):\n from dvc.dvcfile import PIPELINE_FILE\n\n if self.path and self.relpath == PIPELINE_FILE:\n return self.name\n return f\"{super().addressing}:{self.name}\"\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\n\n def _status_stage(self, ret):\n if self.cmd_changed:\n ret.append(\"changed command\")\n\n def changed_stage(self):\n if self.cmd_changed:\n logger.debug(self._changed_stage_entry())\n return self.cmd_changed\n\n def _changed_stage_entry(self):\n return f\"'cmd' of {self} has 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/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": 107, "span_ids": ["StagePathOutsideError", "StagePathNotFoundError", "StageNotFound", "MissingDataSource.__init__", "StageFileDoesNotExistError.__init__", "StageNameUnspecified", "StageFileAlreadyExistsError", "StagePathNotDirectoryError", "StageNameUnspecified.__init__", "InvalidStageName", "StageFileIsNotDvcFileError", "StageNotFound.__init__", "imports", "StageFileDoesNotExistError", "MissingDataSource", "StageCommitError", "InvalidStageName.__init__", "StageFileBadNameError", "StageFileFormatError", "StageCmdFailedError", "StageUpdateError.__init__", "StageCmdFailedError.__init__", "StageFileIsNotDvcFileError.__init__", "StageExternalOutputsError", "StageUpdateError", "DuplicateStageName"], "tokens": 569}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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, cmd, status=None):\n msg = f\"failed to run: {cmd}\"\n if status is not None:\n msg += f\", exited with {status}\"\n super().__init__(msg)\n\n\nclass StageFileFormatError(DvcException):\n pass\n\n\nclass StageFileDoesNotExistError(DvcException):\n def __init__(self, fname):\n self.file = fname\n super().__init__(f\"'{self.file}' does not exist.\")\n\n\nclass StageFileAlreadyExistsError(DvcException):\n pass\n\n\nclass StageFileIsNotDvcFileError(DvcException):\n def __init__(self, fname):\n from dvc.dvcfile import DVC_FILE_SUFFIX, is_dvc_file\n\n msg = f\"'{fname}' is not a DVC-file\"\n\n sname = fname + DVC_FILE_SUFFIX\n if is_dvc_file(sname):\n msg += f\" Do you mean '{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 StageExternalOutputsError(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 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)\n\n\nclass StageNotFound(KeyError, DvcException):\n def __init__(self, file, name):\n self.file = file.relpath\n self.name = name\n super().__init__(\n f\"Stage '{self.name}' not found inside '{self.file}' file\"\n )\n\n\nclass StageNameUnspecified(DvcException):\n def __init__(self, file):\n super().__init__(\n \"Stage name not provided.\"\n \"Please specify the name as: `{}:stage_name`\".format(file.relpath)\n )\n\n\nclass DuplicateStageName(DvcException):\n pass\n\n\nclass InvalidStageName(DvcException):\n def __init__(self):\n super().__init__(\"Stage name cannot contain punctuation characters.\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": 316, "end_line": 362, "span_ids": ["_visual_width", "resolve_output", "env2bool", "relpath", "_visual_center"], "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": "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 = os.fspath(path)\n start = os.path.abspath(os.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": 391, "end_line": 428, "span_ids": ["format_link", "parse_target"], "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": "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=None):\n from dvc.dvcfile import PIPELINE_FILE, PIPELINE_LOCK, is_valid_filename\n from dvc.exceptions import DvcException\n\n if not target:\n return None, None\n\n match = TARGET_REGEX.match(target)\n if not match:\n return target, None\n\n path, name = (\n match.group(\"path\"),\n match.group(\"name\"),\n )\n if path:\n if os.path.basename(path) == PIPELINE_LOCK:\n raise DvcException(\n \"Did you mean: `{}`?\".format(\n target.replace(\".lock\", \".yaml\", 1)\n )\n )\n if not name:\n ret = (target, None)\n return ret if is_valid_filename(target) else ret[::-1]\n\n if not path:\n path = default or PIPELINE_FILE\n logger.debug(\"Assuming file to be '%s'\", path)\n\n return path, 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": 121, "span_ids": ["_flatten", "format_dict", "diff", "_diff", "table", "_diff_dicts"], "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": "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, markdown=False):\n from tabulate import tabulate\n\n if not rows and not markdown:\n return \"\"\n\n ret = tabulate(\n rows,\n header,\n tablefmt=\"github\" if markdown else \"plain\",\n disable_numparse=True,\n # None will be shown as \"\" by default, overriding\n missingval=\"None\",\n )\n\n if markdown:\n # NOTE: md table is incomplete without the trailing newline\n ret += \"\\n\"\n\n return ret\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/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": 21, "span_ids": ["imports", "test_metrics_diff_simple"], "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 json\nimport logging\n\nimport yaml\n\nfrom dvc.main import main\n\n\ndef test_metrics_diff_simple(tmp_dir, scm, dvc, run_copy_metrics):\n def _gen(val):\n tmp_dir.gen({\"m_temp.yaml\": str(val)})\n run_copy_metrics(\"m_temp.yaml\", \"m.yaml\", metrics=[\"m.yaml\"])\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": 24, "end_line": 38, "span_ids": ["test_metrics_diff_yaml"], "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_metrics_diff_yaml(tmp_dir, scm, dvc, run_copy_metrics):\n def _gen(val):\n metrics = {\"a\": {\"b\": {\"c\": val, \"d\": 1, \"e\": str(val)}}}\n tmp_dir.gen({\"m_temp.yaml\": yaml.dump(metrics)})\n run_copy_metrics(\n \"m_temp.yaml\", \"m.yaml\", metrics=[\"m.yaml\"], commit=str(val)\n )\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": 41, "end_line": 54, "span_ids": ["test_metrics_diff_json"], "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_metrics_diff_json(tmp_dir, scm, dvc, run_copy_metrics):\n def _gen(val):\n metrics = {\"a\": {\"b\": {\"c\": val, \"d\": 1, \"e\": str(val)}}}\n tmp_dir.gen({\"m_temp.json\": json.dumps(metrics)})\n run_copy_metrics(\n \"m_temp.json\", \"m.json\", metrics=[\"m.json\"], commit=str(val)\n )\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": 57, "end_line": 69, "span_ids": ["test_metrics_diff_json_unchanged"], "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_metrics_diff_json_unchanged(tmp_dir, scm, dvc, run_copy_metrics):\n def _gen(val):\n metrics = {\"a\": {\"b\": {\"c\": val, \"d\": 1, \"e\": str(val)}}}\n tmp_dir.gen({\"m_temp.json\": json.dumps(metrics)})\n run_copy_metrics(\n \"m_temp.json\", \"m.json\", metrics=[\"m.json\"], commit=str(val)\n )\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": 72, "end_line": 89, "span_ids": ["test_metrics_diff_broken_json"], "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_metrics_diff_broken_json(tmp_dir, scm, dvc, run_copy_metrics):\n metrics = {\"a\": {\"b\": {\"c\": 1, \"d\": 1, \"e\": \"3\"}}}\n tmp_dir.gen({\"m_temp.json\": json.dumps(metrics)})\n run_copy_metrics(\n \"m_temp.json\",\n \"m.json\",\n metrics_no_cache=[\"m.json\"],\n commit=\"add metrics\",\n )\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": 92, "end_line": 107, "span_ids": ["test_metrics_diff_no_metrics", "test_metrics_diff_new_metric"], "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": "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, run_copy_metrics):\n metrics = {\"a\": {\"b\": {\"c\": 1, \"d\": 1, \"e\": \"3\"}}}\n tmp_dir.gen({\"m_temp.json\": json.dumps(metrics)})\n run_copy_metrics(\"m_temp.json\", \"m.json\", 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": 110, "end_line": 127, "span_ids": ["test_metrics_diff_deleted_metric"], "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": "def test_metrics_diff_deleted_metric(tmp_dir, scm, dvc, run_copy_metrics):\n metrics = {\"a\": {\"b\": {\"c\": 1, \"d\": 1, \"e\": \"3\"}}}\n tmp_dir.gen({\"m_temp.json\": json.dumps(metrics)})\n run_copy_metrics(\n \"m_temp.json\",\n \"m.json\",\n metrics_no_cache=[\"m.json\"],\n commit=\"add metrics\",\n )\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/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": 91, "end_line": 101, "span_ids": ["test_diff_dict"], "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": "def test_diff_dict(tmp_dir, scm, dvc):\n tmp_dir.gen(\"params.yaml\", \"foo:\\n bar: baz\")\n dvc.run(cmd=\"echo params.yaml\", params=[\"foo\"], single_stage=True)\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/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": 31, "end_line": 43, "span_ids": ["test_indexed_on_status"], "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_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.hashes())\n assert [bar.checksum] == list(remote.index.dir_hashes())\n assert foo.checksum not in remote.index.hashes()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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": 46, "end_line": 55, "span_ids": ["test_indexed_on_push"], "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_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.hashes())\n assert [bar.checksum] == list(remote.index.dir_hashes())\n assert foo.checksum not in remote.index.hashes()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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": 58, "end_line": 86, "span_ids": ["test_indexed_dir_missing", "test_clear_on_gc", "test_clear_on_download_err"], "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": "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.hashes())\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(LocalRemoteTree, \"_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": 89, "end_line": 105, "span_ids": ["test_partial_upload"], "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_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 = LocalRemoteTree._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(LocalRemoteTree, \"_upload\", unreliable_upload)\n with pytest.raises(UploadError):\n dvc.push()\n with remote.index:\n assert not list(remote.index.hashes())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\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_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": 63, "end_line": 74, "span_ids": ["test_has_stage_with_name"], "tokens": 107}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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, PIPELINE_FILE)\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_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": 500, "end_line": 554, "span_ids": ["TestReproPipelines", "TestReproPipelines.setUp", "TestReproPipelines.test", "TestReproPipeline", "TestReproPipelines.test_cli", "TestReproPipeline.test_cli", "TestReproPipeline.test"], "tokens": 426}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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=f\"python {self.CODE} {self.FOO} {self.file1}\",\n single_stage=True,\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=f\"python {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": 705, "end_line": 735, "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=f\"python {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": 1309, "end_line": 1333, "span_ids": ["TestReproAlreadyCached", "TestReproAlreadyCached.test", "TestReproNoCommit.test", "TestReproNoCommit"], "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 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.assertEqual(os.listdir(self.dvc.cache.local.cache_dir), [\"runs\"])\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": 1335, "end_line": 1349, "span_ids": ["TestReproAlreadyCached.test_force_with_dependencies"], "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": "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 single_stage=True,\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_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": 329, "end_line": 348, "span_ids": ["test_repro_when_new_deps_is_added_in_dvcfile"], "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_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 name=\"copy-file\",\n )\n target = PIPELINE_FILE + \":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_yaml(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": 351, "end_line": 370, "span_ids": ["test_repro_when_new_outs_is_added_in_dvcfile"], "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_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 name=\"copy-file\",\n )\n target = \":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_yaml(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": 373, "end_line": 397, "span_ids": ["test_repro_when_new_deps_is_moved"], "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": "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 name=\"copy-file\",\n )\n target = \":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_yaml(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": 400, "end_line": 418, "span_ids": ["test_repro_when_new_out_overlaps_others_stage_outs"], "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_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_yaml(\n PIPELINE_FILE,\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": 421, "end_line": 439, "span_ids": ["test_repro_when_new_deps_added_does_not_exist"], "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_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_yaml(\n PIPELINE_FILE,\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": 442, "end_line": 460, "span_ids": ["test_repro_when_new_outs_added_does_not_exist"], "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_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_yaml(\n PIPELINE_FILE,\n {\n \"stages\": {\n \"run-copy\": {\n \"cmd\": \"python copy.py {} {}\".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_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": 22, "end_line": 33, "span_ids": ["test_run_with_multistage_and_single_stage"], "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": "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\", single_stage=True)\n stage2 = run_copy(\"foo1\", \"foo2\", name=\"copy-foo1-foo2\")\n stage3 = run_copy(\"foo2\", \"foo3\", single_stage=True)\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_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_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": 36, "span_ids": ["imports"], "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": "import filecmp\nimport logging\nimport os\nimport textwrap\nimport uuid\nfrom pathlib import Path\n\nimport mock\nimport pytest\n\nfrom dvc.dependency.base import DependencyIsStageFileError\nfrom dvc.dvcfile import DVC_FILE_SUFFIX\nfrom dvc.exceptions import (\n ArgumentDuplicationError,\n CircularDependencyError,\n CyclicGraphError,\n OutputDuplicationError,\n OverlappingOutputPathsError,\n StagePathAsOutputError,\n)\nfrom dvc.main import main\nfrom dvc.output import BaseOutput\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 StagePathNotDirectoryError,\n StagePathNotFoundError,\n StagePathOutsideError,\n)\nfrom dvc.system import System\nfrom dvc.utils import file_md5\nfrom dvc.utils.yaml import load_yaml\nfrom tests.basic_env import TestDvc, TestDvcGit", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\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": 38, "end_line": 73, "span_ids": ["TestRun.test", "TestRun"], "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": "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 single_stage=True,\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 single_stage=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_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": 173, "end_line": 202, "span_ids": ["TestRunDuplicatedArguments.test", "TestRunDuplicatedArguments.test_non_normalized_paths", "TestRunDuplicatedArguments", "TestRunDuplicatedArguments.test_outs_no_cache"], "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 TestRunDuplicatedArguments(TestDvc):\n def test(self):\n with self.assertRaises(ArgumentDuplicationError):\n self.dvc.run(\n cmd=\"command\",\n deps=[],\n outs=[self.FOO, self.FOO],\n fname=\"circular-dependency.dvc\",\n single_stage=True,\n )\n\n def test_outs_no_cache(self):\n with self.assertRaises(ArgumentDuplicationError):\n self.dvc.run(\n cmd=\"command\",\n outs=[self.FOO],\n outs_no_cache=[self.FOO],\n fname=\"circular-dependency.dvc\",\n single_stage=True,\n )\n\n def test_non_normalized_paths(self):\n with self.assertRaises(ArgumentDuplicationError):\n self.dvc.run(\n cmd=\"command\",\n deps=[],\n outs=[\"foo\", \"./foo\"],\n fname=\"circular-dependency.dvc\",\n single_stage=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_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": 277, "end_line": 303, "span_ids": ["TestRunBadName.test", "TestRunBadName", "TestRunBadName.test_not_found", "TestRunBadName.test_same_prefix"], "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 TestRunBadName(TestDvc):\n def test(self):\n with self.assertRaises(StagePathOutsideError):\n self.dvc.run(\n cmd=\"command\",\n fname=os.path.join(self.mkdtemp(), self.FOO + DVC_FILE_SUFFIX),\n single_stage=True,\n )\n\n def test_same_prefix(self):\n with self.assertRaises(StagePathOutsideError):\n path = f\"{self._root_dir}-{uuid.uuid4()}\"\n os.mkdir(path)\n self.dvc.run(\n cmd=\"command\",\n fname=os.path.join(path, self.FOO + DVC_FILE_SUFFIX),\n single_stage=True,\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=\"command\",\n fname=os.path.join(path, self.FOO + DVC_FILE_SUFFIX),\n single_stage=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_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": 306, "end_line": 320, "span_ids": ["TestRunRemoveOuts", "TestRunRemoveOuts.test"], "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 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=f\"python {self.CODE} {self.FOO}\",\n single_stage=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_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": 323, "end_line": 369, "span_ids": ["TestRunUnprotectOutsCopy.test", "TestRunUnprotectOutsCopy"], "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 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 \"--single-stage\",\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) as fd:\n self.assertEqual(fd.read(), \"foo\")\n\n ret = main(\n [\n \"run\",\n \"--force\",\n \"--no-run-cache\",\n \"--single-stage\",\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) 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": 372, "end_line": 434, "span_ids": ["TestRunUnprotectOutsSymlink", "TestRunUnprotectOutsSymlink.test"], "tokens": 404}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 \"--single-stage\",\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) as fd:\n self.assertEqual(fd.read(), \"foo\")\n\n ret = main(\n [\n \"run\",\n \"--force\",\n \"--no-run-cache\",\n \"--single-stage\",\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) 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": 437, "end_line": 487, "span_ids": ["TestRunUnprotectOutsHardlink", "TestRunUnprotectOutsHardlink.test"], "tokens": 328}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 \"--single-stage\",\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) as fd:\n self.assertEqual(fd.read(), \"foo\")\n\n ret = main(\n [\n \"run\",\n \"--force\",\n \"--no-run-cache\",\n \"--single-stage\",\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) 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": 490, "end_line": 592, "span_ids": ["TestCmdRunOverwrite.test", "TestCmdRunOverwrite"], "tokens": 539}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 \"--file\",\n \"out.dvc\",\n \"--single-stage\",\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 \"--file\",\n \"out.dvc\",\n \"--single-stage\",\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 \"--force\",\n \"--no-run-cache\",\n \"--single-stage\",\n \"-o\",\n \"out\",\n \"--file\",\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 [\n \"run\",\n \"--force\",\n \"--single-stage\",\n \"--file\",\n \"out.dvc\",\n \"-d\",\n self.BAR,\n f\"cat {self.BAR}\",\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\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\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": 595, "end_line": 622, "span_ids": ["TestCmdRunCliMetrics", "TestCmdRunCliMetrics.test_cached", "TestCmdRunCliMetrics.test_not_cached"], "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 TestCmdRunCliMetrics(TestDvc):\n def test_cached(self):\n ret = main(\n [\n \"run\",\n \"-m\",\n \"metrics.txt\",\n \"--single-stage\",\n \"echo test > metrics.txt\",\n ]\n )\n self.assertEqual(ret, 0)\n with open(\"metrics.txt\") as fd:\n self.assertEqual(fd.read().rstrip(), \"test\")\n\n def test_not_cached(self):\n ret = main(\n [\n \"run\",\n \"-M\",\n \"metrics.txt\",\n \"--single-stage\",\n \"echo test > metrics.txt\",\n ]\n )\n self.assertEqual(ret, 0)\n with open(\"metrics.txt\") 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": 625, "end_line": 640, "span_ids": ["TestCmdRunWorkingDirectory.test_default_wdir_is_not_written", "TestCmdRunWorkingDirectory"], "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 TestCmdRunWorkingDirectory(TestDvc):\n def test_default_wdir_is_not_written(self):\n stage = self.dvc.run(\n cmd=f\"echo test > {self.FOO}\",\n outs=[self.FOO],\n wdir=\".\",\n single_stage=True,\n )\n d = load_yaml(stage.relpath)\n self.assertNotIn(Stage.PARAM_WDIR, d.keys())\n\n stage = self.dvc.run(\n cmd=f\"echo test > {self.BAR}\", outs=[self.BAR], single_stage=True,\n )\n d = load_yaml(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": 642, "end_line": 660, "span_ids": ["TestCmdRunWorkingDirectory.test_fname_changes_path_and_wdir"], "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 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=f\"echo test > {foo}\",\n outs=[foo],\n fname=fname,\n single_stage=True,\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_yaml(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_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": 715, "end_line": 738, "span_ids": ["TestRunCommit", "TestRunCommit.test"], "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 TestRunCommit(TestDvc):\n def test(self):\n fname = \"test\"\n ret = main(\n [\n \"run\",\n \"-o\",\n fname,\n \"--no-commit\",\n \"--single-stage\",\n \"echo\",\n \"test\",\n \">\",\n fname,\n ]\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": 749, "end_line": 796, "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": 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 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 \"--single-stage\",\n self.outs_command,\n file,\n f\"echo {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_yaml(stage_file)\n self.assertEqual(\n True, stage_file_content[\"outs\"][0][BaseOutput.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) 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, \"--outs\"])\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": 799, "end_line": 842, "span_ids": ["TestRunPersistOutsNoCache.test", "TestRunPersistOuts.outs_command", "TestShouldRaiseOnOverlappingOutputPaths", "TestShouldRaiseOnOverlappingOutputPaths.test", "TestRunPersistOuts.test", "TestRunPersistOuts", "TestRunPersistOutsNoCache", "TestRunPersistOutsNoCache.outs_command"], "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": "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],\n cmd=f\"echo data >> {self.DATA}\",\n single_stage=True,\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 f\"\\n'{self.DATA_DIR}'('{data_dir_stage}')\\n\", error_output,\n )\n self.assertIn(f\"\\n'{self.DATA}'('{data_stage}')\\n\", error_output)\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": 845, "end_line": 879, "span_ids": ["TestRerunWithSameOutputs", "TestRerunWithSameOutputs._read_content_only", "TestRerunWithSameOutputs._outs_command", "TestRerunWithSameOutputs._run_twice_with_same_outputs"], "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 TestRerunWithSameOutputs(TestDvc):\n def _read_content_only(self, path):\n with open(path) 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 \"--single-stage\",\n \"--outs\",\n self.FOO,\n f\"echo {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 \"--force\",\n \"--single-stage\",\n f\"echo {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": 908, "end_line": 938, "span_ids": ["TestShouldNotCheckoutUponCorruptedLocalHardlinkCache", "TestShouldNotCheckoutUponCorruptedLocalHardlinkCache.setUp", "TestShouldNotCheckoutUponCorruptedLocalHardlinkCache.test"], "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": "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 = f\"python {self.CODE} {self.FOO} {self.BAR}\"\n stage = self.dvc.run(\n deps=[self.FOO], outs=[self.BAR], cmd=cmd, single_stage=True\n )\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 from dvc.stage.run import cmd_run\n\n patch_run = mock.patch(\"dvc.stage.run.cmd_run\", wraps=cmd_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_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": 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 os\nimport tempfile\n\nimport pytest\n\nfrom dvc.dvcfile import SingleStageFile\nfrom dvc.main import main\nfrom dvc.output.local import LocalOutput\nfrom dvc.remote.local import LocalRemoteTree\nfrom dvc.repo import Repo\nfrom dvc.stage import PipelineStage, Stage\nfrom dvc.stage.exceptions import StageFileFormatError\nfrom dvc.utils.yaml import dump_yaml, load_yaml\nfrom tests.basic_env import TestDvc\n\n\ndef test_cmd_obj():\n with pytest.raises(StageFileFormatError):\n SingleStageFile.validate({Stage.PARAM_CMD: {}})\n\n\ndef test_cmd_none():\n SingleStageFile.validate({Stage.PARAM_CMD: None})\n\n\ndef test_no_cmd():\n SingleStageFile.validate({})\n\n\ndef test_cmd_str():\n SingleStageFile.validate({Stage.PARAM_CMD: \"cmd\"})\n\n\ndef test_object():\n with pytest.raises(StageFileFormatError):\n SingleStageFile.validate({Stage.PARAM_DEPS: {}})\n\n with pytest.raises(StageFileFormatError):\n SingleStageFile.validate({Stage.PARAM_OUTS: {}})\n\n\ndef test_none():\n SingleStageFile.validate({Stage.PARAM_DEPS: None})\n SingleStageFile.validate({Stage.PARAM_OUTS: None})\n\n\ndef test_empty_list():\n d = {Stage.PARAM_DEPS: []}\n SingleStageFile.validate(d)\n\n d = {Stage.PARAM_OUTS: []}\n SingleStageFile.validate(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": 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_list():\n lst = [\n {LocalOutput.PARAM_PATH: \"foo\", LocalRemoteTree.PARAM_CHECKSUM: \"123\"},\n {LocalOutput.PARAM_PATH: \"bar\", LocalRemoteTree.PARAM_CHECKSUM: None},\n {LocalOutput.PARAM_PATH: \"baz\"},\n ]\n d = {Stage.PARAM_DEPS: lst}\n SingleStageFile.validate(d)\n\n lst[0][LocalOutput.PARAM_CACHE] = True\n lst[1][LocalOutput.PARAM_CACHE] = False\n d = {Stage.PARAM_OUTS: lst}\n SingleStageFile.validate(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/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_roundtrip", "test_intersection", "test_is_dir_hash", "test_update", "test_clear", "index"], "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": "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 idx = RemoteIndex(dvc, \"foo\")\n idx.load()\n yield idx\n idx.dump()\n os.unlink(idx.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_hash(dvc, index):\n assert index.is_dir_hash(\"foo.dir\")\n assert not index.is_dir_hash(\"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_hashes()) == expected_dir\n assert set(index.hashes()) == 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.hashes()) 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_hashes()) == expected_dir\n assert set(index.hashes()) == expected_dir | expected_file\n\n\ndef test_intersection(dvc, index):\n hashes = (str(i) for i in range(2000))\n expected = {str(i) for i in range(1000)}\n index.update([], hashes)\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/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": 33, "span_ids": ["imports", "test_get_active_graph"], "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 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(\n single_stage=True, deps=[\"pre-foo\"], outs=[\"foo\"], cmd=\"echo foo > foo\"\n )\n bar_stage = dvc.run(\n single_stage=True, deps=[\"foo\"], outs=[\"bar\"], cmd=\"echo bar > bar\"\n )\n baz_stage = dvc.run(\n single_stage=True, deps=[\"foo\"], outs=[\"baz\"], cmd=\"echo baz > baz\"\n )\n\n dvc.freeze(\"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.freeze(\"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": 36, "end_line": 58, "span_ids": ["test_number_reproduces"], "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": "@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(\n single_stage=True, deps=[\"pre-foo\"], outs=[\"foo\"], cmd=\"echo foo > foo\"\n )\n dvc.run(\n single_stage=True, deps=[\"foo\"], outs=[\"bar\"], cmd=\"echo bar > bar\"\n )\n dvc.run(\n single_stage=True, deps=[\"foo\"], outs=[\"baz\"], cmd=\"echo baz > baz\"\n )\n dvc.run(\n single_stage=True, deps=[\"bar\"], outs=[\"boop\"], cmd=\"echo boop > boop\"\n )\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_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": 48, "end_line": 65, "span_ids": ["test_open_in_history"], "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_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 == \"workspace\":\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": 68, "end_line": 94, "span_ids": ["test_isdir_isfile", "test_isdir_mixed"], "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": "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(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/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": 63, "end_line": 86, "span_ids": ["test_load_when_lockfile_is_corrupted"], "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": "@pytest.mark.parametrize(\n \"corrupt_data\",\n [\n {\"s1\": {\"outs\": []}},\n {\"s1\": {}},\n {\n \"s1\": {\n \"cmd\": \"command\",\n \"outs\": [\n {\"md5\": \"checksum\", \"path\": \"path\", \"random\": \"value\"}\n ],\n }\n },\n {\"s1\": {\"cmd\": \"command\", \"deps\": [{\"md5\": \"checksum\"}]}},\n ],\n)\ndef test_load_when_lockfile_is_corrupted(tmp_dir, dvc, corrupt_data):\n with open(\"Dvcfile.lock\", \"w+\") as f:\n yaml.dump(corrupt_data, f)\n lockfile = Lockfile(dvc, \"Dvcfile.lock\")\n with pytest.raises(LockfileCorruptedError) as exc_info:\n lockfile.load()\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/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": 19, "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\n\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"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/checkout.py_argparse_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_argparse_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": 1, "end_line": 37, "span_ids": ["log_changes", "imports"], "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\nimport operator\n\nimport colorama\n\nfrom dvc.command import completion\nfrom dvc.command.base import CmdBase, append_doc_link\nfrom dvc.exceptions import CheckoutError\nfrom dvc.utils.humanize import get_summary\n\nlogger = logging.getLogger(__name__)\n\n\ndef 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/data_sync.py_shared_parent_parser_shared_parent_parser.return.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.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": 89, "end_line": 110, "span_ids": ["shared_parent_parser"], "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": "def shared_parent_parser():\n from dvc.cli import get_parent_parser\n\n # Parent parser used in pull/push/status\n parent_parser = argparse.ArgumentParser(\n add_help=False, parents=[get_parent_parser()]\n )\n parent_parser.add_argument(\n \"-j\",\n \"--jobs\",\n type=int,\n help=\"Number of jobs to run simultaneously.\",\n metavar=\"\",\n )\n 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 ).complete = completion.DVC_FILE\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/command/data_sync.py_add_parser_add_parser.FETCH_HELP._": {"__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_HELP._", "embedding": null, "metadata": {"file_path": "dvc/command/data_sync.py", "file_name": "data_sync.py", "file_type": "text/x-python", "category": "implementation", "start_line": 115, "end_line": 239, "span_ids": ["add_parser"], "tokens": 746}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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.add_argument(\n \"--run-cache\",\n action=\"store_true\",\n default=False,\n help=\"Fetch run history for all stages.\",\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.add_argument(\n \"--run-cache\",\n action=\"store_true\",\n default=False,\n help=\"Push run history for all stages.\",\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 # ... 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.fetch_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_add_parser.fetch_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": 241, "end_line": 377, "span_ids": ["add_parser"], "tokens": 805}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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\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 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.add_argument(\n \"--run-cache\",\n action=\"store_true\",\n default=False,\n help=\"Fetch run history for all stages.\",\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.add_argument(\n \"-R\",\n \"--recursive\",\n action=\"store_true\",\n default=False,\n help=\"Show status of all stages in the specified directory.\",\n )\n status_parser.add_argument(\n \"--show-json\",\n action=\"store_true\",\n default=False,\n help=\"Show status in JSON format.\",\n )\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/diff.py_argparse__show_md.return.table_Status_Path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/diff.py_argparse__show_md.return.table_Status_Path_", "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": 26, "span_ids": ["imports", "_show_md"], "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": "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\nlogger = logging.getLogger(__name__)\n\n\ndef _show_md(diff):\n from dvc.utils.diff import table\n\n rows = []\n for status in [\"added\", \"deleted\", \"modified\"]:\n entries = diff.get(status, [])\n if not entries:\n continue\n paths = sorted(entry[\"path\"] for entry in entries)\n for path in paths:\n rows.append([status, path])\n\n return table([\"Status\", \"Path\"], rows, 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/diff.py_CmdDiff_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_CmdDiff_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": 29, "end_line": 129, "span_ids": ["CmdDiff._format", "CmdDiff", "CmdDiff.run"], "tokens": 584}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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 isinstance(checksum, 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 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 logger.info(json.dumps(diff))\n elif self.args.show_md:\n logger.info(_show_md(diff))\n elif diff:\n logger.info(self._format(diff))\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/remote.py_CmdRemoteRemove_CmdRemoteModify.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_CmdRemoteModify.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": 43, "end_line": 70, "span_ids": ["CmdRemoteModify", "CmdRemoteRemove", "CmdRemoteModify.run", "CmdRemoteRemove.run"], "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 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\n\n\nclass CmdRemoteModify(CmdRemote):\n def run(self):\n with self.config.edit(self.args.level) as conf:\n self._check_exists(conf)\n section = conf[\"remote\"][self.args.name]\n if self.args.unset:\n section.pop(self.args.option, None)\n else:\n section[self.args.option] = self.args.value\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_CmdRemoteDefault_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_CmdRemoteDefault_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": 73, "end_line": 108, "span_ids": ["CmdRemoteList.run", "CmdRemoteList", "CmdRemoteDefault", "CmdRemoteDefault.run"], "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": "class 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 merged_conf = self.config.load_config_to_level(\n self.args.level\n )\n if (\n self.args.name in conf[\"remote\"]\n or self.args.name in merged_conf[\"remote\"]\n ):\n conf[\"core\"][\"remote\"] = self.args.name\n else:\n raise ConfigError(\n \"default remote must be present in remote list.\"\n )\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/dependency/__init__.py_from_collections_import_d_SCHEMA_update_ParamsDepen": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/__init__.py_from_collections_import_d_SCHEMA_update_ParamsDepen", "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": 51, "span_ids": ["imports"], "tokens": 405}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\nfrom urllib.parse import urlparse\n\nimport dvc.output as output\nfrom dvc.dependency.azure import AzureDependency\nfrom dvc.dependency.gs import GSDependency\nfrom dvc.dependency.hdfs import HDFSDependency\nfrom dvc.dependency.http import HTTPDependency\nfrom dvc.dependency.https import HTTPSDependency\nfrom dvc.dependency.local import LocalDependency\nfrom dvc.dependency.param import ParamsDependency\nfrom dvc.dependency.s3 import S3Dependency\nfrom dvc.dependency.ssh import SSHDependency\nfrom dvc.output.base import BaseOutput\nfrom dvc.remote import get_remote\nfrom dvc.scheme import Schemes\n\nfrom .repo import RepoDependency\n\nDEPS = [\n AzureDependency,\n GSDependency,\n HDFSDependency,\n HTTPDependency,\n HTTPSDependency,\n S3Dependency,\n SSHDependency,\n # NOTE: LocalDependency is the default choice\n]\n\nDEP_MAP = {\n Schemes.LOCAL: LocalDependency,\n Schemes.SSH: SSHDependency,\n Schemes.S3: S3Dependency,\n Schemes.AZURE: AzureDependency,\n Schemes.GS: GSDependency,\n Schemes.HDFS: HDFSDependency,\n Schemes.HTTP: HTTPDependency,\n Schemes.HTTPS: HTTPSDependency,\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[BaseOutput.PARAM_CACHE]\ndel SCHEMA[BaseOutput.PARAM_METRIC]\nSCHEMA.update(RepoDependency.REPO_SCHEMA)\nSCHEMA.update(ParamsDependency.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/dvcfile.py_FileMixin_FileMixin.exists.return.self_repo_tree_exists_sel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dvcfile.py_FileMixin_FileMixin.exists.return.self_repo_tree_exists_sel", "embedding": null, "metadata": {"file_path": "dvc/dvcfile.py", "file_name": "dvcfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 55, "end_line": 83, "span_ids": ["FileMixin.__init__", "FileMixin", "FileMixin.__repr__", "FileMixin.exists", "FileMixin.__hash__", "FileMixin.relpath", "FileMixin.__eq__", "FileMixin.__str__"], "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": "class FileMixin:\n SCHEMA = None\n\n def __init__(self, repo, path, **kwargs):\n self.repo = repo\n self.path = path\n\n def __repr__(self):\n return \"{}: {}\".format(\n self.__class__.__name__, relpath(self.path, self.repo.root_dir)\n )\n\n def __hash__(self):\n return hash(self.path)\n\n def __eq__(self, other):\n return self.repo == other.repo and os.path.abspath(\n self.path\n ) == os.path.abspath(other.path)\n\n def __str__(self):\n return f\"{self.__class__.__name__}: {self.relpath}\"\n\n @property\n def relpath(self):\n return relpath(self.path)\n\n def exists(self):\n return self.repo.tree.exists(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_PipelineFile_PipelineFile._dump_lockfile.self__lockfile_dump_stage": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dvcfile.py_PipelineFile_PipelineFile._dump_lockfile.self__lockfile_dump_stage", "embedding": null, "metadata": {"file_path": "dvc/dvcfile.py", "file_name": "dvcfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 148, "end_line": 173, "span_ids": ["PipelineFile._dump_lockfile", "PipelineFile._lockfile", "PipelineFile.dump", "PipelineFile"], "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 PipelineFile(FileMixin):\n \"\"\"Abstraction for pipelines file, .yaml + .lock combined.\"\"\"\n\n from dvc.schema import COMPILED_MULTI_STAGE_SCHEMA as SCHEMA\n\n @property\n def _lockfile(self):\n return Lockfile(self.repo, os.path.splitext(self.path)[0] + \".lock\")\n\n def dump(\n self, stage, update_pipeline=False, no_lock=False, **kwargs\n ): # pylint: disable=arguments-differ\n \"\"\"Dumps given stage appropriately in the dvcfile.\"\"\"\n from dvc.stage import PipelineStage\n\n assert isinstance(stage, PipelineStage)\n check_dvc_filename(self.path)\n\n if update_pipeline and not stage.is_data_source:\n self._dump_pipeline_file(stage)\n\n if not no_lock:\n self._dump_lockfile(stage)\n\n def _dump_lockfile(self, stage):\n self._lockfile.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/dvcfile.py_PipelineFile._dump_pipeline_file_PipelineFile._dump_pipeline_file.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_PipelineFile._dump_pipeline_file_PipelineFile._dump_pipeline_file.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": 175, "end_line": 200, "span_ids": ["PipelineFile._dump_pipeline_file"], "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 PipelineFile(FileMixin):\n\n def _dump_pipeline_file(self, stage):\n data = {}\n if self.exists():\n with open(self.path) as fd:\n data = parse_yaml_for_update(fd.read(), self.path)\n else:\n logger.info(\"Creating '%s'\", self.relpath)\n open(self.path, \"w+\").close()\n\n data[\"stages\"] = data.get(\"stages\", {})\n stage_data = serialize.to_pipeline_file(stage)\n existing_entry = stage.name in data[\"stages\"]\n\n action = \"Modifying\" if existing_entry else \"Adding\"\n logger.info(\"%s stage '%s' in '%s'\", action, stage.name, self.relpath)\n\n if existing_entry:\n orig_stage_data = data[\"stages\"][stage.name]\n if \"meta\" in orig_stage_data:\n stage_data[stage.name][\"meta\"] = orig_stage_data[\"meta\"]\n apply_diff(stage_data[stage.name], orig_stage_data)\n else:\n data[\"stages\"].update(stage_data)\n\n dump_yaml(self.path, data)\n self.repo.scm.track_file(self.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/dvcfile.py_Lockfile_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dvcfile.py_Lockfile_", "embedding": null, "metadata": {"file_path": "dvc/dvcfile.py", "file_name": "dvcfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 239, "end_line": 302, "span_ids": ["Lockfile.load", "Dvcfile.__new__", "Lockfile", "Dvcfile", "Lockfile.remove_stage", "Lockfile.dump"], "tokens": 441}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Lockfile(FileMixin):\n from dvc.schema import COMPILED_LOCKFILE_SCHEMA as SCHEMA\n\n def load(self):\n if not self.exists():\n return {}\n with self.repo.tree.open(self.path) as fd:\n data = parse_yaml(fd.read(), self.path)\n try:\n self.validate(data, fname=self.relpath)\n except StageFileFormatError:\n raise LockfileCorruptedError(\n f\"Lockfile '{self.relpath}' is corrupted.\"\n )\n return data\n\n def dump(self, stage, **kwargs):\n stage_data = serialize.to_lockfile(stage)\n if not self.exists():\n modified = True\n logger.info(\"Generating lock file '%s'\", self.relpath)\n data = stage_data\n open(self.path, \"w+\").close()\n else:\n with self.repo.tree.open(self.path, \"r\") as fd:\n data = parse_yaml_for_update(fd.read(), self.path)\n modified = data.get(stage.name, {}) != stage_data.get(\n stage.name, {}\n )\n if modified:\n logger.info(\"Updating lock file '%s'\", self.relpath)\n data.update(stage_data)\n dump_yaml(self.path, data)\n if modified:\n self.repo.scm.track_file(self.relpath)\n\n def remove_stage(self, stage):\n if not self.exists():\n return\n\n with open(self.path) as f:\n d = parse_yaml_for_update(f.read(), self.path)\n self.validate(d, self.path)\n\n if stage.name not in d:\n return\n\n logger.debug(\"Removing '%s' from '%s'\", stage.name, self.path)\n del d[stage.name]\n\n dump_yaml(self.path, d)\n\n\nclass Dvcfile:\n def __new__(cls, repo, path, **kwargs):\n assert path\n assert repo\n\n _, ext = os.path.splitext(path)\n if ext in [\".yaml\", \".yml\"]:\n return PipelineFile(repo, path, **kwargs)\n # fallback to single stage file for better error messages\n return SingleStageFile(repo, path, **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/exceptions.py__Exceptions_raised_by_t_OutputDuplicationError.__init__.self.output.output": {"__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__.self.output.output", "embedding": null, "metadata": {"file_path": "dvc/exceptions.py", "file_name": "exceptions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 41, "span_ids": ["DvcException.__init__", "OutputDuplicationError", "InvalidArgumentError", "DvcException", "OutputDuplicationError.__init__", "docstring"], "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": "\"\"\"Exceptions raised by the dvc.\"\"\"\nfrom funcy import first\n\nfrom dvc.utils import format_link, relpath\n\n\nclass DvcException(Exception):\n \"\"\"Base class for all dvc exceptions.\"\"\"\n\n def __init__(self, msg, *args):\n assert msg\n super().__init__(msg, *args)\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 if len(stages) == 1:\n msg = \"output '{}' is already specified in {}.\".format(\n output, first(stages)\n )\n else:\n msg = \"output '{}' is already specified in stages:\\n{}\".format(\n output, \"\\n\".join(f\"\\t- {s.addressing}\" for s in stages),\n )\n super().__init__(msg)\n self.stages = stages\n self.output = 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/output/__init__.py__get__get.return.LocalOutput_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/__init__.py__get__get.return.LocalOutput_", "embedding": null, "metadata": {"file_path": "dvc/output/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 63, "end_line": 102, "span_ids": ["_get"], "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 _get(\n stage, p, info=None, cache=True, metric=False, plot=False, persist=False\n):\n parsed = urlparse(p)\n\n if parsed.scheme == \"remote\":\n remote = get_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 plot=plot,\n persist=persist,\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 plot=plot,\n persist=persist,\n )\n return LocalOutput(\n stage,\n p,\n info,\n cache=cache,\n remote=None,\n metric=metric,\n plot=plot,\n persist=persist,\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_BaseOutput.save_BaseOutput.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_BaseOutput.save_BaseOutput.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": 242, "end_line": 271, "span_ids": ["BaseOutput.save"], "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": "class BaseOutput:\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(f\"'{self}' is empty.\")\n\n self.ignore()\n\n if self.metric or self.plot:\n self.verify_metric()\n\n if not self.use_cache:\n self.info = self.save_info()\n if not self.IS_DEPENDENCY:\n logger.debug(\n \"Output '%s' doesn't use cache. Skipping saving.\", self\n )\n return\n\n assert not self.IS_DEPENDENCY\n\n if not self.changed():\n logger.debug(\"Output '%s' didn't change. Skipping saving.\", self)\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/output/base.py_BaseOutput.commit_BaseOutput.dumpd.return.ret": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_BaseOutput.commit_BaseOutput.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": 273, "end_line": 303, "span_ids": ["BaseOutput.commit", "BaseOutput.dumpd"], "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 BaseOutput:\n\n def commit(self):\n if self.use_cache:\n self.cache.save(self.path_info, self.cache.tree, 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 if not self.use_cache:\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 if self.metric:\n ret[self.PARAM_METRIC] = self.metric\n\n if self.plot:\n ret[self.PARAM_PLOT] = self.plot\n\n if self.persist:\n ret[self.PARAM_PERSIST] = self.persist\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/base.py_BaseOutput.get_used_cache_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_BaseOutput.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": 439, "end_line": 493, "span_ids": ["BaseOutput._validate_output_path", "BaseOutput.get_used_cache"], "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 BaseOutput:\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.addressing}` \"\n \"to associate existing '{out}' with {stage}.\".format(\n out=self, stage=self.stage\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 is_valid_filename\n\n if 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/repo/__init__.py_Repo.check_modified_graph_Repo.check_modified_graph.if_not_getattr_self__sk.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.check_modified_graph_Repo.check_modified_graph.if_not_getattr_self__sk.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": 219, "end_line": 234, "span_ids": ["Repo.check_modified_graph"], "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 Repo:\n\n def check_modified_graph(self, new_stages):\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(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/ls.py_from_dvc_exceptions_impor_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_exceptions_impor_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": 47, "span_ids": ["imports", "ls"], "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": "from dvc.exceptions import PathMissingError\nfrom dvc.path_info import PathInfo\n\n\n@staticmethod\ndef ls(\n url, path=None, rev=None, recursive=None, dvc_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 dvc_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\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 = _ls(repo, path_info, recursive, dvc_only)\n\n if path and not ret:\n raise PathMissingError(path, repo, dvc_only=dvc_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/metrics/diff.py_from_dvc_exceptions_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_exceptions_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": 28, "span_ids": ["imports", "_get_metrics", "diff"], "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": "from dvc.exceptions import NoMetricsError\nfrom dvc.utils.diff import diff as _diff\nfrom dvc.utils.diff import format_dict\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 if repo.scm.no_commits:\n return {}\n\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/show.py_logging__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_logging__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": 36, "span_ids": ["imports", "_collect_metrics"], "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 logging\nimport os\n\nimport yaml\n\nfrom dvc.exceptions import NoMetricsError\nfrom dvc.path_info import PathInfo\nfrom dvc.repo import locked\nfrom dvc.repo.tree import RepoTree\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/params/show.py_logging__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_logging__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": 44, "span_ids": ["NoParamsError", "imports", "_collect_configs", "_read_params"], "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": "import logging\n\nimport yaml\n\nfrom dvc.dependency.param import ParamsDependency\nfrom dvc.exceptions import DvcException\nfrom dvc.path_info import PathInfo\nfrom dvc.repo import locked\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) / ParamsDependency.DEFAULT_PARAMS_FILE)\n for stage in repo.stages:\n for dep in stage.deps:\n if not isinstance(dep, ParamsDependency):\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(config):\n continue\n\n with repo.tree.open(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/update.py_Dvcfile_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/update.py_Dvcfile_", "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": 24, "span_ids": ["imports", "update"], "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": "from ..dvcfile import Dvcfile\nfrom . import locked\n\n\n@locked\ndef update(self, targets, rev=None, recursive=False):\n if not targets:\n targets = [None]\n\n if isinstance(targets, str):\n targets = [targets]\n\n stages = set()\n for target in targets:\n stages.update(self.collect(target, recursive=recursive))\n\n for stage in stages:\n stage.update(rev)\n dvcfile = Dvcfile(self, stage.path)\n dvcfile.dump(stage)\n stages.add(stage)\n\n return list(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/rwlock.py_json_RWLockFileFormatError.__init__.super___init___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/rwlock.py_json_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": 34, "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 json\nimport os\nfrom collections import defaultdict\nfrom contextlib import contextmanager\n\nfrom voluptuous import Invalid, Optional, Required, Schema\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/schema.py_from_voluptuous_import_An_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/schema.py_from_voluptuous_import_An_", "embedding": null, "metadata": {"file_path": "dvc/schema.py", "file_name": "schema.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 76, "span_ids": ["imports", "impl:23"], "tokens": 663}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 voluptuous import Any, Optional, Required, Schema\n\nfrom dvc import dependency, output\nfrom dvc.output import CHECKSUMS_SCHEMA, BaseOutput\nfrom dvc.stage.params import StageParams\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, # backard compatibility\n StageParams.PARAM_FROZEN: bool,\n StageParams.PARAM_META: object,\n StageParams.PARAM_ALWAYS_CHANGED: bool,\n}\n\nDATA_SCHEMA = {**CHECKSUMS_SCHEMA, Required(\"path\"): str}\nLOCK_FILE_STAGE_SCHEMA = {\n Required(StageParams.PARAM_CMD): str,\n StageParams.PARAM_DEPS: [DATA_SCHEMA],\n StageParams.PARAM_PARAMS: {str: {str: object}},\n StageParams.PARAM_OUTS: [DATA_SCHEMA],\n}\nLOCKFILE_SCHEMA = {str: LOCK_FILE_STAGE_SCHEMA}\n\nOUT_PSTAGE_DETAILED_SCHEMA = {\n str: {BaseOutput.PARAM_CACHE: bool, BaseOutput.PARAM_PERSIST: bool}\n}\n\nPLOT_PROPS = {\n BaseOutput.PARAM_PLOT_TEMPLATE: str,\n BaseOutput.PARAM_PLOT_X: str,\n BaseOutput.PARAM_PLOT_Y: str,\n BaseOutput.PARAM_PLOT_X_LABEL: str,\n BaseOutput.PARAM_PLOT_Y_LABEL: str,\n BaseOutput.PARAM_PLOT_TITLE: str,\n BaseOutput.PARAM_PLOT_HEADER: bool,\n}\nPLOT_PROPS_SCHEMA = {\n **OUT_PSTAGE_DETAILED_SCHEMA[str],\n **PLOT_PROPS,\n}\nPLOT_PSTAGE_SCHEMA = {str: Any(PLOT_PROPS_SCHEMA, [PLOT_PROPS_SCHEMA])}\n\nPARAM_PSTAGE_NON_DEFAULT_SCHEMA = {str: [str]}\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_PARAMS): [\n Any(str, PARAM_PSTAGE_NON_DEFAULT_SCHEMA)\n ],\n Optional(StageParams.PARAM_FROZEN): bool,\n Optional(StageParams.PARAM_META): object,\n Optional(StageParams.PARAM_ALWAYS_CHANGED): bool,\n Optional(StageParams.PARAM_OUTS): [\n Any(str, OUT_PSTAGE_DETAILED_SCHEMA)\n ],\n Optional(StageParams.PARAM_METRICS): [\n Any(str, OUT_PSTAGE_DETAILED_SCHEMA)\n ],\n Optional(StageParams.PARAM_PLOTS): [Any(str, PLOT_PSTAGE_SCHEMA)],\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_LOCK_FILE_STAGE_SCHEMA = Schema(LOCK_FILE_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/git/tree.py_errno__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_errno__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": 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 errno\nimport io\nimport os\nimport stat\n\nfrom dvc.exceptions import DvcException\nfrom dvc.scm.tree import BaseTree\nfrom dvc.utils import relpath\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/stage/__init__.py_logging_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_logging_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": 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": "import logging\nimport os\nimport string\nfrom collections import defaultdict\n\nfrom funcy import cached_property, project\n\nimport dvc.dependency as dependency\nimport dvc.prompt as prompt\nfrom dvc.exceptions import CheckoutError, DvcException\nfrom dvc.utils import relpath\n\nfrom . import params\nfrom .decorators import rwlocked\nfrom .exceptions import StageUpdateError\nfrom .imports import sync_import, update_import\nfrom .run import run_stage\nfrom .utils import (\n check_circular_dependency,\n check_duplicated_arguments,\n check_missing_outputs,\n check_no_externals,\n check_stage_path,\n compute_md5,\n fill_stage_dependencies,\n fill_stage_outputs,\n get_dump,\n stage_dump_eq,\n)\n\nlogger = logging.getLogger(__name__)\n# Disallow all punctuation characters except hyphen and underscore\nINVALID_STAGENAME_CHARS = set(string.punctuation) - {\"_\", \"-\"}\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_FROZEN,\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/cache.py_logging__get_stage_hash.return._get_cache_hash_to_single": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/cache.py_logging__get_stage_hash.return._get_cache_hash_to_single", "embedding": null, "metadata": {"file_path": "dvc/stage/cache.py", "file_name": "cache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 39, "span_ids": ["_get_cache_hash", "imports", "_get_stage_hash"], "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": "import logging\nimport os\nfrom contextlib import contextmanager\n\nimport yaml\nfrom funcy import first\nfrom voluptuous import Invalid\n\nfrom dvc.remote.local import _log_exceptions\nfrom dvc.schema import COMPILED_LOCK_FILE_STAGE_SCHEMA\nfrom dvc.utils import dict_sha256, relpath\nfrom dvc.utils.fs import makedirs\nfrom dvc.utils.yaml import dump_yaml\n\nfrom .loader import StageLoader\nfrom .serialize import to_single_stage_lockfile\n\nlogger = logging.getLogger(__name__)\n\n\ndef _get_cache_hash(cache, key=False):\n if key:\n cache[\"outs\"] = [out[\"path\"] for out in cache.get(\"outs\", [])]\n return dict_sha256(cache)\n\n\ndef _get_stage_hash(stage):\n if not (stage.cmd and stage.deps and stage.outs):\n return None\n\n for dep in stage.deps:\n if not (dep.scheme == \"local\" and dep.def_path and dep.get_checksum()):\n return None\n\n for out in stage.outs:\n if out.scheme != \"local\" or not out.def_path or out.persist:\n return None\n\n return _get_cache_hash(to_single_stage_lockfile(stage), key=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/cache.py_StageCache_StageCache._cache_type_copy.try_.finally_.self.repo.cache.local.cache_types.cache_types": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/cache.py_StageCache_StageCache._cache_type_copy.try_.finally_.self.repo.cache.local.cache_types.cache_types", "embedding": null, "metadata": {"file_path": "dvc/stage/cache.py", "file_name": "cache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 42, "end_line": 104, "span_ids": ["StageCache.__init__", "StageCache._create_stage", "StageCache._cache_type_copy", "StageCache._load_cache", "StageCache._get_cache_dir", "StageCache._load", "StageCache._get_cache_path", "StageCache"], "tokens": 410}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StageCache:\n def __init__(self, repo):\n self.repo = repo\n self.cache_dir = os.path.join(repo.cache.local.cache_dir, \"runs\")\n\n def _get_cache_dir(self, key):\n return os.path.join(self.cache_dir, key[:2], key)\n\n def _get_cache_path(self, key, value):\n return os.path.join(self._get_cache_dir(key), value)\n\n def _load_cache(self, key, value):\n path = self._get_cache_path(key, value)\n\n try:\n with open(path) as fobj:\n return COMPILED_LOCK_FILE_STAGE_SCHEMA(yaml.safe_load(fobj))\n except FileNotFoundError:\n return None\n except (yaml.error.YAMLError, Invalid):\n logger.warning(\"corrupted cache file '%s'.\", relpath(path))\n os.unlink(path)\n return None\n\n def _load(self, stage):\n key = _get_stage_hash(stage)\n if not key:\n return None\n\n cache_dir = self._get_cache_dir(key)\n if not os.path.exists(cache_dir):\n return None\n\n for value in os.listdir(cache_dir):\n cache = self._load_cache(key, value)\n if cache:\n return cache\n\n return None\n\n def _create_stage(self, cache, wdir=None):\n from . import create_stage, PipelineStage\n\n stage = create_stage(\n PipelineStage,\n repo=self.repo,\n path=\"dvc.yaml\",\n cmd=cache[\"cmd\"],\n wdir=wdir,\n outs=[out[\"path\"] for out in cache[\"outs\"]],\n external=True,\n )\n StageLoader.fill_from_lock(stage, cache)\n return stage\n\n @contextmanager\n def _cache_type_copy(self):\n cache_types = self.repo.cache.local.cache_types\n self.repo.cache.local.cache_types = [\"copy\"]\n try:\n yield\n finally:\n self.repo.cache.local.cache_types = cache_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/stage/cache.py_StageCache._uncached_outs_StageCache._uncached_outs.with_self__cache_type_cop.for_out_in_cached_stage_o.if_out_def_path_in_outs_n.yield_out": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/cache.py_StageCache._uncached_outs_StageCache._uncached_outs.with_self__cache_type_cop.for_out_in_cached_stage_o.if_out_def_path_in_outs_n.yield_out", "embedding": null, "metadata": {"file_path": "dvc/stage/cache.py", "file_name": "cache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 106, "end_line": 120, "span_ids": ["StageCache._uncached_outs"], "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 StageCache:\n\n def _uncached_outs(self, stage, cache):\n # NOTE: using temporary stage to avoid accidentally modifying original\n # stage and to workaround `commit/checkout` not working for uncached\n # outputs.\n cached_stage = self._create_stage(cache, wdir=stage.wdir)\n\n outs_no_cache = [\n out.def_path for out in stage.outs if not out.use_cache\n ]\n\n # NOTE: using copy link to make it look like a git-tracked file\n with self._cache_type_copy():\n for out in cached_stage.outs:\n if out.def_path in outs_no_cache:\n yield 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/stage/cache.py_StageCache.is_cached_StageCache._transfer.return.ret": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/cache.py_StageCache.is_cached_StageCache._transfer.return.ret", "embedding": null, "metadata": {"file_path": "dvc/stage/cache.py", "file_name": "cache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 144, "end_line": 174, "span_ids": ["StageCache.restore", "StageCache._transfer", "StageCache.is_cached"], "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 StageCache:\n\n def is_cached(self, stage):\n return bool(self._load(stage))\n\n def restore(self, stage):\n cache = self._load(stage)\n if not cache:\n return\n StageLoader.fill_from_lock(stage, cache)\n\n for out in self._uncached_outs(stage, cache):\n out.checkout()\n\n @staticmethod\n def _transfer(func, from_remote, to_remote):\n ret = []\n\n runs = from_remote.path_info / \"runs\"\n if not from_remote.exists(runs):\n return []\n\n for src in from_remote.walk_files(runs):\n rel = src.relative_to(from_remote.path_info)\n dst = to_remote.path_info / rel\n key = dst.parent\n # check if any build cache already exists for this key\n if to_remote.exists(key) and first(to_remote.walk_files(key)):\n continue\n func(src, dst)\n ret.append((src.parent.name, src.name))\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/stage/cache.py_StageCache.push_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/cache.py_StageCache.push_", "embedding": null, "metadata": {"file_path": "dvc/stage/cache.py", "file_name": "cache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 179, "end_line": 207, "span_ids": ["StageCache.pull", "StageCache.get_used_cache", "StageCache.push"], "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 StageCache:\n\n def push(self, remote):\n remote = self.repo.cloud.get_remote(remote)\n return self._transfer(\n _log_exceptions(remote.tree.upload, \"upload\"),\n self.repo.cache.local.tree,\n remote.tree,\n )\n\n def pull(self, remote):\n remote = self.repo.cloud.get_remote(remote)\n return self._transfer(\n _log_exceptions(remote.tree.download, \"download\"),\n remote.tree,\n self.repo.cache.local.tree,\n )\n\n def get_used_cache(self, used_run_cache, *args, **kwargs):\n from dvc.cache import NamedCache\n\n cache = NamedCache()\n\n for key, value in used_run_cache:\n entry = self._load_cache(key, value)\n if not entry:\n continue\n stage = self._create_stage(entry)\n cache.update(stage.get_used_cache(*args, **kwargs))\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/decorators.py_from_functools_import_wra_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/decorators.py_from_functools_import_wra_", "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": 52, "span_ids": ["imports", "rwlocked", "unlocked_repo"], "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": "from functools import wraps\n\nfrom funcy import decorator\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 RepoDependency\n\n if read is None:\n read = []\n\n if write is None:\n write = []\n\n stage = call._args[0] # pylint: disable=protected-access\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 RepoDependency deps, as there is no\n # corresponding OutputREPO, so we can't even write it.\n if not isinstance(item, RepoDependency)\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() # pylint: disable=protected-access\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/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/stage/loader.py_StageLoader.load_stage_StageLoader.load_stage.return.stage", "embedding": null, "metadata": {"file_path": "dvc/stage/loader.py", "file_name": "loader.py", "file_type": "text/x-python", "category": "implementation", "start_line": 47, "end_line": 74, "span_ids": ["StageLoader.load_stage"], "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 StageLoader(Mapping):\n\n @classmethod\n def load_stage(cls, dvcfile, name, stage_data, lock_data=None):\n assert all([name, dvcfile, dvcfile.repo, dvcfile.path])\n assert stage_data and isinstance(stage_data, dict)\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\n deps = project(stage_data, [stage.PARAM_DEPS, stage.PARAM_PARAMS])\n fill_stage_dependencies(stage, **deps)\n\n outs = project(\n stage_data,\n [stage.PARAM_OUTS, stage.PARAM_METRICS, stage.PARAM_PLOTS],\n )\n stage.outs = lcat(\n output.load_from_pipeline(stage, data, typ=key)\n for key, data in outs.items()\n )\n\n if lock_data:\n stage.cmd_changed = lock_data.get(Stage.PARAM_CMD) != stage.cmd\n\n cls.fill_from_lock(stage, lock_data)\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/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/stage/loader.py_StageLoader.__getitem___StageLoader.__contains__.return.name_in_self_stages_data", "embedding": null, "metadata": {"file_path": "dvc/stage/loader.py", "file_name": "loader.py", "file_type": "text/x-python", "category": "implementation", "start_line": 141, "end_line": 167, "span_ids": ["StageLoader.__iter__", "StageLoader.__contains__", "StageLoader.__getitem__", "StageLoader.__len__"], "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 StageLoader(Mapping):\n\n def __getitem__(self, name):\n if not name:\n raise StageNameUnspecified(self.dvcfile)\n\n if name not in self:\n raise StageNotFound(self.dvcfile, name)\n\n if not self.lockfile_data.get(name):\n logger.debug(\n \"No lock entry found for '%s:%s'\", self.dvcfile.relpath, name,\n )\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/stage/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/stage/loader.py_SingleStageLoader_SingleStageLoader.__getitem__.return.self_load_stage_", "embedding": null, "metadata": {"file_path": "dvc/stage/loader.py", "file_name": "loader.py", "file_type": "text/x-python", "category": "implementation", "start_line": 105, "end_line": 122, "span_ids": ["SingleStageLoader.__getitem__", "SingleStageLoader", "SingleStageLoader.__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 SingleStageLoader(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/stage/loader.py_SingleStageLoader.load_stage_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/loader.py_SingleStageLoader.load_stage_", "embedding": null, "metadata": {"file_path": "dvc/stage/loader.py", "file_name": "loader.py", "file_type": "text/x-python", "category": "implementation", "start_line": 124, "end_line": 143, "span_ids": ["SingleStageLoader.__len__", "SingleStageLoader.load_stage", "SingleStageLoader.__iter__", "SingleStageLoader.__contains__"], "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 SingleStageLoader(Mapping):\n\n @classmethod\n def load_stage(cls, dvcfile, d, stage_text):\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_text # noqa, pylint:disable=protected-access\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/state.py__Manages_state_database_StateNoop.__exit__.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py__Manages_state_database_StateNoop.__exit__.pass", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 48, "span_ids": ["StateNoop.get", "docstring", "StateNoop.__enter__", "StateNoop.save", "StateVersionTooNewError.__init__", "StateNoop", "StateNoop.save_link", "StateVersionTooNewError", "StateNoop.__exit__"], "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": "\"\"\"Manages state database used for checksum caching.\"\"\"\n\nimport logging\nimport os\nimport re\nimport sqlite3\nfrom urllib.parse import urlencode, urlunparse\n\nfrom dvc.exceptions import DvcException\nfrom dvc.utils import current_timestamp, relpath, to_chunks\nfrom dvc.utils.fs import get_inode, get_mtime_and_size, remove\n\nSQLITE_MAX_VARIABLES_NUMBER = 999\n\nlogger = logging.getLogger(__name__)\n\n\nclass 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:\n files = []\n\n def save(self, path_info, checksum):\n pass\n\n def get(self, path_info): # pylint: disable=unused-argument\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/utils/__init__.py_bytes_hash_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_hash_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": 148, "span_ids": ["to_chunks", "is_binary", "dict_filter", "_split", "_to_chunks_by_chunks_number", "dict_sha256", "bytes_hash", "dict_md5", "dict_hash"], "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": "def bytes_hash(byts, typ):\n hasher = getattr(hashlib, typ)()\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_hash(d, typ, exclude=()):\n filtered = dict_filter(d, exclude)\n byts = json.dumps(filtered, sort_keys=True).encode(\"utf-8\")\n return bytes_hash(byts, typ)\n\n\ndef dict_md5(d, **kwargs):\n return dict_hash(d, \"md5\", **kwargs)\n\n\ndef dict_sha256(d, **kwargs):\n return dict_hash(d, \"sha256\", **kwargs)\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/fs.py_errno_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_errno_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": 30, "span_ids": ["imports", "get_inode", "fs_copy"], "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": "import errno\nimport logging\nimport os\nimport shutil\nimport stat\nimport sys\n\nimport nanotime\nfrom shortuuid import uuid\n\nfrom dvc.exceptions import DvcException\nfrom dvc.system import System\nfrom dvc.utils import dict_md5\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/dvc/utils/humanize.py_from_funcy_import_is_seq_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/humanize.py_from_funcy_import_is_seq_", "embedding": null, "metadata": {"file_path": "dvc/utils/humanize.py", "file_name": "humanize.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 28, "span_ids": ["join", "imports", "get_summary"], "tokens": 144}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 is_seq\n\n\ndef 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 get_summary(stats):\n status = (\n (state, len(data) if is_seq(data) else data)\n for state, data in stats\n if data\n )\n return join(\n \"{} file{} {}\".format(num, \"s\" if num > 1 else \"\", state)\n for state, num in status\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_test_diff_with_unchanged.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_with_unchanged_test_diff_with_unchanged.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": 104, "end_line": 118, "span_ids": ["test_diff_with_unchanged"], "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": "def test_diff_with_unchanged(tmp_dir, scm, dvc):\n tmp_dir.gen(\"params.yaml\", \"foo: bar\\nxyz: val\")\n dvc.run(cmd=\"echo params.yaml\", params=[\"foo,xyz\"], single_stage=True)\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/params/test_diff.py_test_pipeline_tracked_params_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/params/test_diff.py_test_pipeline_tracked_params_", "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": 121, "end_line": 147, "span_ids": ["test_pipeline_tracked_params", "test_no_commits"], "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_pipeline_tracked_params(tmp_dir, scm, dvc, run_copy):\n from dvc.dvcfile import PIPELINE_FILE\n\n tmp_dir.gen({\"foo\": \"foo\", \"params.yaml\": \"foo: bar\\nxyz: val\"})\n run_copy(\"foo\", \"bar\", name=\"copy-foo-bar\", params=[\"foo,xyz\"])\n\n scm.add([\"params.yaml\", PIPELINE_FILE])\n scm.commit(\"add stage\")\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\") == {\n \"params.yaml\": {\"foo\": {\"old\": \"bar\", \"new\": \"qux\"}}\n }\n\n\ndef test_no_commits(tmp_dir):\n from dvc.repo import Repo\n from dvc.scm.git import Git\n from tests.dir_helpers import git_init\n\n git_init(\".\")\n assert Git().no_commits\n\n assert Repo.init().params.diff() == {}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_pipeline_tracked_params_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/params/test_show.py_test_pipeline_tracked_params_", "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": 47, "end_line": 61, "span_ids": ["test_pipeline_tracked_params"], "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_pipeline_tracked_params(tmp_dir, scm, dvc, run_copy):\n from dvc.dvcfile import PIPELINE_FILE\n\n tmp_dir.gen({\"foo\": \"foo\", \"params.yaml\": \"foo: bar\\nxyz: val\"})\n run_copy(\"foo\", \"bar\", name=\"copy-foo-bar\", params=[\"foo,xyz\"])\n scm.add([\"params.yaml\", PIPELINE_FILE])\n scm.commit(\"add stage\")\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.show(revs=[\"master\"]) == {\n \"master\": {\"params.yaml\": {\"foo\": \"qux\", \"xyz\": \"val\"}}\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_gdrive.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_gdrive.py_os_", "embedding": null, "metadata": {"file_path": "tests/func/remote/test_gdrive.py", "file_name": "test_gdrive.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 56, "span_ids": ["imports", "test_relative_user_credentials_file_config_setting"], "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": "import os\nimport posixpath\n\nimport configobj\n\nfrom dvc.main import main\nfrom dvc.remote.gdrive import GDriveRemoteTree\nfrom dvc.repo import Repo\n\n\ndef test_relative_user_credentials_file_config_setting(tmp_dir, dvc):\n # CI sets it to test GDrive, here we want to test the work with file system\n # based, regular credentials\n if os.getenv(GDriveRemoteTree.GDRIVE_CREDENTIALS_DATA):\n del os.environ[GDriveRemoteTree.GDRIVE_CREDENTIALS_DATA]\n\n credentials = os.path.join(\"secrets\", \"credentials.json\")\n\n # GDriveRemoteTree.credentials_location helper checks for file existence,\n # create the file\n tmp_dir.gen(credentials, \"{'token': 'test'}\")\n\n remote_name = \"gdrive\"\n assert (\n main([\"remote\", \"add\", \"-d\", remote_name, \"gdrive://root/test\"]) == 0\n )\n assert (\n main(\n [\n \"remote\",\n \"modify\",\n remote_name,\n \"gdrive_user_credentials_file\",\n credentials,\n ]\n )\n == 0\n )\n\n # We need to load repo again to test updates to the config\n str_path = os.fspath(tmp_dir)\n repo = Repo(str_path)\n\n # Check that in config we got the path relative to the config file itself\n # Also, we store posix path even on Windows\n config = configobj.ConfigObj(repo.config.files[\"repo\"])\n assert config[f'remote \"{remote_name}\"'][\n \"gdrive_user_credentials_file\"\n ] == posixpath.join(\"..\", \"secrets\", \"credentials.json\")\n\n # Check that in the remote itself we got an absolute path\n remote = repo.cloud.get_remote(remote_name)\n assert os.path.normpath(remote.tree.credentials_location) == os.path.join(\n str_path, credentials\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_add.py_test_add_optimization_for_hardlink_on_empty_files_test_add_optimization_for_hardlink_on_empty_files.for_stage_in_stages_.None_1": {"__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_test_add_optimization_for_hardlink_on_empty_files.for_stage_in_stages_.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": 703, "end_line": 722, "span_ids": ["test_add_optimization_for_hardlink_on_empty_files"], "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": "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(LocalRemoteTree, \"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_add.py_test_output_duplication_for_pipeline_tracked_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_output_duplication_for_pipeline_tracked_", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 712, "end_line": 727, "span_ids": ["test_add_pipeline_file", "test_output_duplication_for_pipeline_tracked"], "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_output_duplication_for_pipeline_tracked(tmp_dir, dvc, run_copy):\n tmp_dir.dvc_gen(\"foo\", \"foo\")\n run_copy(\"foo\", \"bar\", name=\"copy-foo-bar\")\n with pytest.raises(OutputDuplicationError):\n dvc.add(\"bar\")\n\n\ndef test_add_pipeline_file(tmp_dir, dvc, run_copy):\n from dvc.dvcfile import PIPELINE_FILE\n\n tmp_dir.dvc_gen(\"foo\", \"foo\")\n run_copy(\"foo\", \"bar\", name=\"copy-foo-bar\")\n\n with pytest.raises(OutputIsStageFileError):\n dvc.add(PIPELINE_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_checkout.py_test_checkout_for_external_outputs_test_checkout_for_external_outputs.None_2": {"__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_test_checkout_for_external_outputs.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": 756, "end_line": 779, "span_ids": ["test_checkout_for_external_outputs"], "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": "@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 = CloudCache(S3RemoteTree(dvc, {\"url\": S3.get_url()}))\n\n remote = Remote(S3RemoteTree(dvc, {\"url\": S3.get_url()}))\n file_path = remote.path_info / \"foo\"\n remote.tree.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\"), external=True)\n\n remote.tree.remove(file_path)\n stats = dvc.checkout(force=True)\n assert stats == {**empty_checkout, \"added\": [str(file_path)]}\n assert remote.tree.exists(file_path)\n\n remote.tree.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_checkout.py_test_checkouts_for_pipeline_tracked_outs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_checkouts_for_pipeline_tracked_outs_", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 825, "end_line": 847, "span_ids": ["test_checkouts_for_pipeline_tracked_outs"], "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": "def test_checkouts_for_pipeline_tracked_outs(tmp_dir, dvc, scm, run_copy):\n tmp_dir.gen(\"foo\", \"foo\")\n stage1 = run_copy(\"foo\", \"bar\", name=\"copy-foo-bar\")\n tmp_dir.gen(\"lorem\", \"lorem\")\n stage2 = run_copy(\"lorem\", \"ipsum\", name=\"copy-lorem-ipsum\")\n\n for out in [\"bar\", \"ipsum\"]:\n (tmp_dir / out).unlink()\n assert dvc.checkout([\"bar\"])[\"added\"] == [\"bar\"]\n\n (tmp_dir / \"bar\").unlink()\n assert set(dvc.checkout([PIPELINE_FILE])[\"added\"]) == {\"bar\", \"ipsum\"}\n\n for out in [\"bar\", \"ipsum\"]:\n (tmp_dir / out).unlink()\n assert set(dvc.checkout([stage1.addressing])[\"added\"]) == {\"bar\"}\n\n (tmp_dir / \"bar\").unlink()\n assert set(dvc.checkout([stage2.addressing])[\"added\"]) == {\"ipsum\"}\n\n (tmp_dir / \"ipsum\").unlink()\n assert set(dvc.checkout()[\"added\"]) == {\"bar\", \"ipsum\"}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\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_configobj_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_configobj_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 configobj\nimport pytest\n\nfrom dvc.config import Config, ConfigError\nfrom dvc.main import main\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_test_pull_external_dvc_imports_recurse_list_dir.return._": {"__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_recurse_list_dir.return._", "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": 314, "end_line": 352, "span_ids": ["recurse_list_dir", "clean", "test_pull_external_dvc_imports"], "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 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(os.fspath(erepo_dir), \"foo\")\n dvc.imp(os.fspath(erepo_dir), \"dir\", out=\"new_dir\", rev=\"HEAD~\")\n\n assert dvc.pull()[\"fetched\"] == 0\n\n clean([\"foo\", \"new_dir\"], dvc)\n\n assert dvc.pull(force=True)[\"fetched\"] == 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\"\n\n\ndef clean(outs, dvc=None):\n if dvc:\n outs = outs + [dvc.cache.local.cache_dir]\n for path in outs:\n print(path)\n remove(path)\n if dvc:\n os.makedirs(dvc.cache.local.cache_dir, exist_ok=True)\n clean_repos()\n\n\ndef recurse_list_dir(d):\n return [\n os.path.join(d, f) for _, _, filenames in os.walk(d) for f in filenames\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_test_dvc_pull_pipeline_stages_test_dvc_pull_pipeline_stages.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_dvc_pull_pipeline_stages_test_dvc_pull_pipeline_stages.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": 355, "end_line": 383, "span_ids": ["test_dvc_pull_pipeline_stages"], "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": "def test_dvc_pull_pipeline_stages(tmp_dir, dvc, run_copy, local_remote):\n (stage0,) = tmp_dir.dvc_gen(\"foo\", \"foo\")\n stage1 = run_copy(\"foo\", \"bar\", single_stage=True)\n stage2 = run_copy(\"bar\", \"foobar\", name=\"copy-bar-foobar\")\n dvc.push()\n\n outs = [\"foo\", \"bar\", \"foobar\"]\n\n clean(outs, dvc)\n dvc.pull()\n assert all((tmp_dir / file).exists() for file in outs)\n\n for out, stage in zip(outs, [stage0, stage1, stage2]):\n for target in [stage.addressing, out]:\n clean(outs, dvc)\n stats = dvc.pull([target])\n assert stats[\"fetched\"] == 1\n assert stats[\"added\"] == [out]\n assert os.path.exists(out)\n assert not any(os.path.exists(out) for out in set(outs) - {out})\n\n clean(outs, dvc)\n stats = dvc.pull([stage2.addressing], with_deps=True)\n assert len(stats[\"added\"]) == 3\n assert set(stats[\"added\"]) == set(outs)\n\n clean(outs, dvc)\n stats = dvc.pull([os.curdir], recursive=True)\n assert set(stats[\"added\"]) == set(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/tests/func/test_data_cloud.py_test_pipeline_file_target_ops_test_pipeline_file_target_ops.None_1.dvc_pull_dvc_yaml_Stage": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_test_pipeline_file_target_ops_test_pipeline_file_target_ops.None_1.dvc_pull_dvc_yaml_Stage", "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": 386, "end_line": 429, "span_ids": ["test_pipeline_file_target_ops"], "tokens": 397}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_file_target_ops(tmp_dir, dvc, run_copy, local_remote):\n path = local_remote.url\n tmp_dir.dvc_gen(\"foo\", \"foo\")\n run_copy(\"foo\", \"bar\", single_stage=True)\n\n tmp_dir.dvc_gen(\"lorem\", \"lorem\")\n run_copy(\"lorem\", \"lorem2\", name=\"copy-lorem-lorem2\")\n\n tmp_dir.dvc_gen(\"ipsum\", \"ipsum\")\n run_copy(\"ipsum\", \"baz\", name=\"copy-ipsum-baz\")\n\n outs = [\"foo\", \"bar\", \"lorem\", \"ipsum\", \"baz\", \"lorem2\"]\n\n remove(dvc.stage_cache.cache_dir)\n\n dvc.push()\n\n outs = [\"foo\", \"bar\", \"lorem\", \"ipsum\", \"baz\", \"lorem2\"]\n\n # each one's a copy of other, hence 3\n assert len(recurse_list_dir(path)) == 3\n\n clean(outs, dvc)\n assert set(dvc.pull([\"dvc.yaml\"])[\"added\"]) == {\"lorem2\", \"baz\"}\n\n clean(outs, dvc)\n assert set(dvc.pull()[\"added\"]) == set(outs)\n\n # clean everything in remote and push\n from tests.dir_helpers import TmpDir\n\n clean(TmpDir(path).iterdir())\n dvc.push([\"dvc.yaml:copy-ipsum-baz\"])\n assert len(recurse_list_dir(path)) == 1\n\n clean(TmpDir(path).iterdir())\n dvc.push([\"dvc.yaml\"])\n assert len(recurse_list_dir(path)) == 2\n\n with pytest.raises(StageNotFound):\n dvc.push([\"dvc.yaml:StageThatDoesNotExist\"])\n\n with pytest.raises(StageNotFound):\n dvc.pull([\"dvc.yaml:StageThatDoesNotExist\"])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\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_push_stats_test_push_stats.assert_msg_in_caplog_text": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_test_push_stats_test_push_stats.assert_msg_in_caplog_text", "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": 432, "end_line": 446, "span_ids": ["test_push_stats"], "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": "@pytest.mark.parametrize(\n \"fs, msg\",\n [\n ({\"foo\": \"foo\", \"bar\": \"bar\"}, \"2 files pushed\"),\n ({\"foo\": \"foo\"}, \"1 file pushed\"),\n ({}, \"Everything is up to date\"),\n ],\n)\ndef test_push_stats(tmp_dir, dvc, fs, msg, caplog, local_remote):\n tmp_dir.dvc_gen(fs)\n\n caplog.clear()\n with caplog.at_level(level=logging.INFO, logger=\"dvc\"):\n main([\"push\"])\n assert msg 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_data_cloud.py_test_fetch_stats_test_fetch_stats.assert_msg_in_caplog_text": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_test_fetch_stats_test_fetch_stats.assert_msg_in_caplog_text", "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": 449, "end_line": 464, "span_ids": ["test_fetch_stats"], "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": "@pytest.mark.parametrize(\n \"fs, msg\",\n [\n ({\"foo\": \"foo\", \"bar\": \"bar\"}, \"2 files fetched\"),\n ({\"foo\": \"foo\"}, \"1 file fetched\"),\n ({}, \"Everything is up to date.\"),\n ],\n)\ndef test_fetch_stats(tmp_dir, dvc, fs, msg, caplog, local_remote):\n tmp_dir.dvc_gen(fs)\n dvc.push()\n clean(list(fs.keys()), dvc)\n caplog.clear()\n with caplog.at_level(level=logging.INFO, logger=\"dvc\"):\n main([\"fetch\"])\n assert msg 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_dvcfile.py_test_load_all_multistage_test_load_all_multistage.assert_set_Dvcfile_dvc_P": {"__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_P", "embedding": null, "metadata": {"file_path": "tests/func/test_dvcfile.py", "file_name": "test_dvcfile.py", "file_type": "text/x-python", "category": "test", "start_line": 77, "end_line": 98, "span_ids": ["test_load_all_multistage"], "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_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, PIPELINE_FILE).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, PIPELINE_FILE).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_try_get_single_stage_from_pipeline_file.with_pytest_raises_DvcExc.assert_Dvcfile_dvc_PIPEL": {"__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_try_get_single_stage_from_pipeline_file.with_pytest_raises_DvcExc.assert_Dvcfile_dvc_PIPEL", "embedding": null, "metadata": {"file_path": "tests/func/test_dvcfile.py", "file_name": "test_dvcfile.py", "file_type": "text/x-python", "category": "test", "start_line": 105, "end_line": 134, "span_ids": ["test_load_all_singlestage", "test_try_get_single_stage_from_pipeline_file"], "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": "def test_load_all_singlestage(tmp_dir, dvc):\n tmp_dir.gen(\"foo\", \"foo\")\n stage1 = dvc.run(\n cmd=\"cp foo foo2\",\n deps=[\"foo\"],\n metrics=[\"foo2\"],\n always_changed=True,\n single_stage=True,\n )\n dvcfile = Dvcfile(dvc, \"foo2.dvc\")\n assert isinstance(dvcfile, SingleStageFile)\n assert len(dvcfile.stages) == 1\n stages = dvcfile.stages.values()\n assert len(stages) == 1\n assert list(stages) == [stage1]\n\n\ndef test_try_get_single_stage_from_pipeline_file(tmp_dir, dvc):\n from dvc.dvcfile import DvcException\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(DvcException):\n assert Dvcfile(dvc, PIPELINE_FILE).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_gc.py_test_gc_without_workspace_on_tags_branches_commits_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_without_workspace_on_tags_branches_commits_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": 257, "end_line": 302, "span_ids": ["test_gc_without_workspace_on_tags_branches_commits", "test_gc_with_possible_args_positive", "test_gc_without_workspace", "test_gc_cloud_without_any_specifier", "test_gc_cloud_positive"], "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_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\n\n\ndef test_gc_cloud_positive(tmp_dir, dvc, tmp_path_factory, local_remote):\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_test_gc_cloud_remove_order.for_args_in_mocked_remove.assert_checksum_endswith_": {"__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_test_gc_cloud_remove_order.for_args_in_mocked_remove.assert_checksum_endswith_", "embedding": null, "metadata": {"file_path": "tests/func/test_gc.py", "file_name": "test_gc.py", "file_type": "text/x-python", "category": "test", "start_line": 305, "end_line": 332, "span_ids": ["test_gc_cloud_remove_order"], "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 test_gc_cloud_remove_order(tmp_dir, scm, dvc, tmp_path_factory, mocker):\n storage = os.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(\n LocalRemoteTree, \"remove\", autospec=True\n )\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_get.py_test_get_url_positive_test_get_url_git_only_repo.with_caplog_at_level_logg.assert_failed_to_show_UR": {"__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_test_get_url_git_only_repo.with_caplog_at_level_logg.assert_failed_to_show_UR", "embedding": null, "metadata": {"file_path": "tests/func/test_get.py", "file_name": "test_get.py", "file_type": "text/x-python", "category": "test", "start_line": 204, "end_line": 237, "span_ids": ["test_get_url_not_existing", "test_get_url_positive", "test_get_url_git_only_repo"], "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 test_get_url_positive(tmp_dir, erepo_dir, caplog, local_cloud):\n erepo_dir.add_remote(config=local_cloud.config)\n with erepo_dir.chdir():\n erepo_dir.dvc_gen(\"foo\", \"foo\")\n erepo_dir.dvc.push()\n\n caplog.clear()\n with caplog.at_level(logging.ERROR, logger=\"dvc\"):\n assert main([\"get\", os.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(\n [\n \"get\",\n os.fspath(erepo_dir),\n \"not-existing-file\",\n \"--show-url\",\n ]\n )\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\", os.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.py_test_get_pipeline_tracked_outs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_test_get_pipeline_tracked_outs_", "embedding": null, "metadata": {"file_path": "tests/func/test_get.py", "file_name": "test_get.py", "file_type": "text/x-python", "category": "test", "start_line": 240, "end_line": 255, "span_ids": ["test_get_pipeline_tracked_outs"], "tokens": 144}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_pipeline_tracked_outs(\n tmp_dir, dvc, scm, git_dir, run_copy, local_remote\n):\n from dvc.dvcfile import PIPELINE_FILE, PIPELINE_LOCK\n\n tmp_dir.gen(\"foo\", \"foo\")\n run_copy(\"foo\", \"bar\", name=\"copy-foo-bar\")\n dvc.push()\n\n dvc.scm.add([PIPELINE_FILE, PIPELINE_LOCK])\n dvc.scm.commit(\"add pipeline stage\")\n\n with git_dir.chdir():\n Repo.get(\"file:///{}\".format(os.fspath(tmp_dir)), \"bar\", out=\"baz\")\n assert (git_dir / \"baz\").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_import.py_test_import_pipeline_tracked_outs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_test_import_pipeline_tracked_outs_", "embedding": null, "metadata": {"file_path": "tests/func/test_import.py", "file_name": "test_import.py", "file_type": "text/x-python", "category": "test", "start_line": 329, "end_line": 352, "span_ids": ["test_import_pipeline_tracked_outs", "test_local_import"], "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_import_pipeline_tracked_outs(\n tmp_dir, dvc, scm, erepo_dir, run_copy, local_remote\n):\n from dvc.dvcfile import PIPELINE_FILE, PIPELINE_LOCK\n\n tmp_dir.gen(\"foo\", \"foo\")\n run_copy(\"foo\", \"bar\", name=\"copy-foo-bar\")\n dvc.push()\n\n dvc.scm.add([PIPELINE_FILE, PIPELINE_LOCK])\n dvc.scm.commit(\"add pipeline stage\")\n\n with erepo_dir.chdir():\n erepo_dir.dvc.imp(\n \"file:///{}\".format(os.fspath(tmp_dir)), \"bar\", out=\"baz\"\n )\n assert (erepo_dir / \"baz\").read_text() == \"foo\"\n\n\ndef test_local_import(tmp_dir, dvc, scm):\n tmp_dir.dvc_gen(\"foo\", \"foo\", commit=\"init\")\n (tmp_dir / \"outdir\").mkdir()\n dvc.imp(\".\", \"foo\", out=\"outdir\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_lockfile.py_test_deps_outs_are_sorted_by_path_test_deps_outs_are_sorted_by_path.assert_list_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_lockfile.py_test_deps_outs_are_sorted_by_path_test_deps_outs_are_sorted_by_path.assert_list_", "embedding": null, "metadata": {"file_path": "tests/func/test_lockfile.py", "file_name": "test_lockfile.py", "file_type": "text/x-python", "category": "test", "start_line": 64, "end_line": 85, "span_ids": ["test_deps_outs_are_sorted_by_path"], "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": "def test_deps_outs_are_sorted_by_path(tmp_dir, dvc, run_head):\n tmp_dir.gen(FS_STRUCTURE)\n deps = [\"foo\", \"bar\", \"foobar\"]\n run_head(*deps, name=\"copy-first-line\")\n\n initial_content = read_lock_file()\n lock = initial_content[\"copy-first-line\"]\n\n # lock stage key order:\n assert list(lock.keys()) == [\"cmd\", \"deps\", \"outs\"]\n\n # `path` key appear first and then the `md5`\n assert all(list(dep.keys()) == [\"path\", \"md5\"] for dep in lock[\"deps\"])\n assert all(list(out.keys()) == [\"path\", \"md5\"] for out in lock[\"outs\"])\n\n # deps are always sorted by the file path naming\n assert list(map(itemgetter(\"path\"), lock[\"deps\"])) == sorted(deps)\n\n # outs are too\n assert list(\n map(itemgetter(\"path\"), initial_content[\"copy-first-line\"][\"outs\"])\n ) == [d + \"-1\" for d in sorted(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/tests/func/test_lockfile.py_test_order_is_preserved_when_pipeline_order_changes_test_order_is_preserved_when_pipeline_order_changes.for_reverse_items_in_reve.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_lockfile.py_test_order_is_preserved_when_pipeline_order_changes_test_order_is_preserved_when_pipeline_order_changes.for_reverse_items_in_reve.None_4", "embedding": null, "metadata": {"file_path": "tests/func/test_lockfile.py", "file_name": "test_lockfile.py", "file_type": "text/x-python", "category": "test", "start_line": 88, "end_line": 112, "span_ids": ["test_order_is_preserved_when_pipeline_order_changes"], "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_order_is_preserved_when_pipeline_order_changes(\n tmp_dir, dvc, run_head\n):\n tmp_dir.gen(FS_STRUCTURE)\n deps = [\"foo\", \"bar\", \"foobar\"]\n stage = run_head(*deps, name=\"copy-first-line\")\n\n initial_content = read_lock_file()\n # reverse order of stage.outs and dump to the pipeline file\n # then, again change stage.deps and dump to the pipeline file\n reversal = stage.outs.reverse, stage.deps.reverse\n for reverse_items in reversal:\n reverse_items()\n stage.dvcfile._dump_pipeline_file(stage)\n\n # we only changed the order, should not reproduce\n assert not dvc.reproduce(stage.addressing)\n\n new_lock_content = read_lock_file()\n assert_eq_lockfile(new_lock_content, initial_content)\n\n (tmp_dir / PIPELINE_LOCK).unlink()\n assert dvc.reproduce(stage.addressing) == [stage]\n new_lock_content = read_lock_file()\n assert_eq_lockfile(new_lock_content, initial_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_lockfile.py_test_cmd_changes_other_orders_are_preserved_test_cmd_changes_other_orders_are_preserved.assert_eq_lockfile_new_lo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_lockfile.py_test_cmd_changes_other_orders_are_preserved_test_cmd_changes_other_orders_are_preserved.assert_eq_lockfile_new_lo", "embedding": null, "metadata": {"file_path": "tests/func/test_lockfile.py", "file_name": "test_lockfile.py", "file_type": "text/x-python", "category": "test", "start_line": 115, "end_line": 132, "span_ids": ["test_cmd_changes_other_orders_are_preserved"], "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_cmd_changes_other_orders_are_preserved(tmp_dir, dvc, run_head):\n tmp_dir.gen(FS_STRUCTURE)\n deps = [\"foo\", \"bar\", \"foobar\"]\n stage = run_head(*deps, name=\"copy-first-line\")\n\n initial_content = read_lock_file()\n # let's change cmd in pipeline file\n # it should only change \"cmd\", otherwise it should be\n # structurally same as cmd\n stage.cmd = \" \".join(stage.cmd.split())\n stage.dvcfile._dump_pipeline_file(stage)\n\n initial_content[\"copy-first-line\"][\"cmd\"] = stage.cmd\n\n assert dvc.reproduce(stage.addressing) == [stage]\n\n new_lock_content = read_lock_file()\n assert_eq_lockfile(new_lock_content, initial_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_lockfile.py_test_params_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_lockfile.py_test_params_dump_", "embedding": null, "metadata": {"file_path": "tests/func/test_lockfile.py", "file_name": "test_lockfile.py", "file_type": "text/x-python", "category": "test", "start_line": 107, "end_line": 156, "span_ids": ["test_params_dump"], "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": "def test_params_dump(tmp_dir, dvc, run_head):\n tmp_dir.gen(FS_STRUCTURE)\n\n stage = run_head(\n \"foo\",\n \"bar\",\n \"foobar\",\n name=\"copy-first-line\",\n params=[\n \"params2.yaml:answer,lists,name\",\n \"params.yaml:lists,floats,nested.nested1,nested.nested1.nested2\",\n ],\n )\n\n initial_content = read_lock_file()\n lock = initial_content[\"copy-first-line\"]\n\n # lock stage key order:\n assert list(lock.keys()) == [\"cmd\", \"deps\", \"params\", \"outs\"]\n assert list(lock[\"params\"].keys()) == [\"params.yaml\", \"params2.yaml\"]\n\n # # params keys are always sorted by the name\n assert list(lock[\"params\"][\"params.yaml\"].keys()) == [\n \"floats\",\n \"lists\",\n \"nested.nested1\",\n \"nested.nested1.nested2\",\n ]\n assert list(lock[\"params\"][\"params2.yaml\"]) == [\"answer\", \"lists\", \"name\"]\n\n assert not dvc.reproduce(stage.addressing)\n\n # let's change the order of params and dump them in pipeline file\n params, _ = split_params_deps(stage)\n for param in params:\n param.params.reverse()\n\n stage.dvcfile._dump_pipeline_file(stage)\n assert not dvc.reproduce(stage.addressing)\n\n (tmp_dir / PIPELINE_LOCK).unlink()\n assert dvc.reproduce(stage.addressing) == [stage]\n assert_eq_lockfile(initial_content, read_lock_file())\n\n # remove build-cache and check if the same structure is built\n for item in [dvc.stage_cache.cache_dir, PIPELINE_LOCK]:\n remove(item)\n assert dvc.reproduce(stage.addressing) == [stage]\n assert_eq_lockfile(initial_content, read_lock_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_ls.py_test_ls_remote_repo_with_rev_recursive_test_ls_remote_repo_with_rev_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_with_rev_recursive_test_ls_remote_repo_with_rev_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": 403, "end_line": 427, "span_ids": ["test_ls_remote_repo_with_rev_recursive"], "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_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 = f\"file://{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 )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\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_modify_missing_remote.assert_main_remote_m": {"__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_modify_missing_remote.assert_main_remote_m", "embedding": null, "metadata": {"file_path": "tests/func/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 211, "end_line": 228, "span_ids": ["test_modify_missing_remote", "test_raise_on_too_many_open_files"], "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_raise_on_too_many_open_files(\n tmp_dir, dvc, tmp_path_factory, mocker, local_remote\n):\n tmp_dir.dvc_gen({\"file\": \"file content\"})\n\n mocker.patch.object(\n LocalRemoteTree,\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\n\n\ndef test_modify_missing_remote(tmp_dir, dvc):\n assert main([\"remote\", \"modify\", \"myremote\", \"user\", \"xxx\"]) == 251", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\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_downstream_test_downstream.assert_evaluation_4_relp": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_downstream_test_downstream.assert_evaluation_4_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": 1620, "end_line": 1698, "span_ids": ["test_downstream"], "tokens": 576}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_downstream(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\", \"--single-stage\", \"-o\", \"A\", \"echo A>A\"]) == 0\n assert (\n main([\"run\", \"--single-stage\", \"-d\", \"A\", \"-o\", \"B\", \"echo B>B\"]) == 0\n )\n assert (\n main([\"run\", \"--single-stage\", \"-d\", \"A\", \"-o\", \"C\", \"echo C>C\"]) == 0\n )\n assert (\n main(\n [\n \"run\",\n \"--single-stage\",\n \"-d\",\n \"B\",\n \"-d\",\n \"C\",\n \"-o\",\n \"D\",\n \"echo D>D\",\n ]\n )\n == 0\n )\n assert main([\"run\", \"--single-stage\", \"-o\", \"G\", \"echo G>G\"]) == 0\n assert (\n main([\"run\", \"--single-stage\", \"-d\", \"G\", \"-o\", \"F\", \"echo F>F\"]) == 0\n )\n assert (\n main(\n [\n \"run\",\n \"--single-stage\",\n \"-d\",\n \"D\",\n \"-d\",\n \"F\",\n \"-o\",\n \"E\",\n \"echo E>E\",\n ]\n )\n == 0\n )\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(\"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\"\n\n # B, C should be run (in any order) before D\n # See https://github.com/iterative/dvc/issues/3602\n evaluation = dvc.reproduce(\"A.dvc\", downstream=True, force=True)\n\n assert len(evaluation) == 5\n assert evaluation[0].relpath == \"A.dvc\"\n assert {evaluation[1].relpath, evaluation[2].relpath} == {\"B.dvc\", \"C.dvc\"}\n assert evaluation[3].relpath == \"D.dvc\"\n assert evaluation[4].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_multistage.py_os_TestReproChangedDirMultiStage.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_TestReproChangedDirMultiStage.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": 153, "span_ids": ["TestReproChangedDirMultiStage", "TestReproCyclicGraphMultiStage", "TestReproFailMultiStage", "MultiStageRun", "MultiStageRun._get_stage_target", "TestReproFrozenUnchangedMultiStage", "MultiStageRun._run", "TestReproUnderDirMultiStage", "TestReproPipelineMultiStage", "TestReproAllPipelinesMultiStage", "TestReproPipelinesMultiStage", "TestNonExistingOutputMultiStage", "TestReproFrozenCallbackMultiStage", "TestReproNoDepsMultiStage", "TestReproDry", "TestReproForceMultiStage", "TestReproChangedDeepDataMultiStage", "imports", "TestReproChangedCodeMultiStage", "TestReproPhonyMultiStage", "TestReproChangedDataMultiStage", "TestCmdReproMultiStage", "TestReproAlreadyCachedMultiStage", "TestReproFrozenMultiStage", "TestReproUpToDateMultiStage", "TestReproNoCommit", "TestReproDepDirWithOutputsUnderItMultiStage"], "tokens": 808}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 copy import deepcopy\nfrom textwrap import dedent\n\nimport pytest\nimport yaml\nfrom funcy import lsplit\n\nfrom dvc.dvcfile import PIPELINE_FILE, PIPELINE_LOCK\nfrom dvc.exceptions import CyclicGraphError\nfrom dvc.main import main\nfrom dvc.stage import PipelineStage\nfrom dvc.utils.yaml import dump_yaml, parse_yaml\nfrom tests.func import test_repro\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) # noqa, pylint: disable=no-member\n\n @staticmethod\n def _get_stage_target(stage):\n return stage.addressing\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 TestReproFrozenMultiStage(MultiStageRun, test_repro.TestReproFrozen):\n pass\n\n\nclass TestReproFrozenCallbackMultiStage(\n MultiStageRun, test_repro.TestReproFrozenCallback\n):\n pass\n\n\nclass TestReproFrozenUnchangedMultiStage(\n MultiStageRun, test_repro.TestReproFrozenUnchanged\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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\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_downstream_test_downstream.None_15": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_test_downstream_test_downstream.None_15", "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": 210, "end_line": 307, "span_ids": ["test_downstream"], "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": "def 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 (\n main([\"run\", \"--single-stage\", \"-d\", \"A\", \"-o\", \"C\", \"echo C>C\"]) == 0\n )\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\", \"--single-stage\", \"-o\", \"G\", \"echo G>G\"]) == 0\n assert main([\"run\", \"-n\", \"F-gen\", \"-d\", \"G\", \"-o\", \"F\", \"echo F>F\"]) == 0\n assert (\n main(\n [\n \"run\",\n \"--single-stage\",\n \"-d\",\n \"D\",\n \"-d\",\n \"F\",\n \"-o\",\n \"E\",\n \"echo E>E\",\n ]\n )\n == 0\n )\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(\n PIPELINE_FILE + \":B-gen\", downstream=True, force=True\n )\n\n assert len(evaluation) == 3\n assert (\n isinstance(evaluation[0], PipelineStage)\n and evaluation[0].relpath == PIPELINE_FILE\n and evaluation[0].name == \"B-gen\"\n )\n assert (\n isinstance(evaluation[1], PipelineStage)\n and evaluation[1].relpath == PIPELINE_FILE\n and evaluation[1].name == \"D-gen\"\n )\n assert (\n not isinstance(evaluation[2], PipelineStage)\n and evaluation[2].relpath == \"E.dvc\"\n )\n\n # B, C should be run (in any order) before D\n # See https://github.com/iterative/dvc/issues/3602\n evaluation = dvc.reproduce(\n PIPELINE_FILE + \":A-gen\", downstream=True, force=True\n )\n\n assert len(evaluation) == 5\n assert (\n isinstance(evaluation[0], PipelineStage)\n and evaluation[0].relpath == PIPELINE_FILE\n and evaluation[0].name == \"A-gen\"\n )\n names = set()\n for stage in evaluation[1:3]:\n if isinstance(stage, PipelineStage):\n assert stage.relpath == PIPELINE_FILE\n names.add(stage.name)\n else:\n names.add(stage.relpath)\n assert names == {\"B-gen\", \"C.dvc\"}\n assert (\n isinstance(evaluation[3], PipelineStage)\n and evaluation[3].relpath == PIPELINE_FILE\n and evaluation[3].name == \"D-gen\"\n )\n assert (\n not isinstance(evaluation[4], PipelineStage)\n and evaluation[4].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_lockfile_gets_deleted_test_repro_when_lockfile_gets_deleted.assert_": {"__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.assert_", "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": 463, "end_line": 488, "span_ids": ["test_repro_when_lockfile_gets_deleted"], "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_repro_when_lockfile_gets_deleted(tmp_dir, dvc):\n tmp_dir.gen(\"copy.py\", COPY_SCRIPT)\n tmp_dir.gen(\"foo\", \"foo\")\n dump_yaml(\n PIPELINE_FILE,\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(PIPELINE_LOCK)\n\n assert not dvc.reproduce(\":run-copy\")\n os.unlink(PIPELINE_LOCK)\n stages = dvc.reproduce(\":run-copy\")\n assert (\n stages\n and stages[0].relpath == PIPELINE_FILE\n and stages[0].name == \"run-copy\"\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_cyclic_graph_error_test_cyclic_graph_error.with_pytest_raises_Cyclic.dvc_reproduce_copy_baz_": {"__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_test_cyclic_graph_error.with_pytest_raises_Cyclic.dvc_reproduce_copy_baz_", "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": 491, "end_line": 506, "span_ids": ["test_cyclic_graph_error"], "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_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 with open(PIPELINE_FILE) as f:\n data = parse_yaml(f.read(), PIPELINE_FILE)\n data[\"stages\"][\"copy-baz-foo\"] = {\n \"cmd\": \"echo baz > foo\",\n \"deps\": [\"baz\"],\n \"outs\": [\"foo\"],\n }\n dump_yaml(PIPELINE_FILE, data)\n with pytest.raises(CyclicGraphError):\n dvc.reproduce(\":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_repro_multistage.py_test_repro_multiple_params_": {"__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_multiple_params_", "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": 509, "end_line": 564, "span_ids": ["test_repro_multiple_params"], "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": "def test_repro_multiple_params(tmp_dir, dvc):\n from tests.func.test_run_multistage import supported_params\n\n from dvc.stage.utils import split_params_deps\n\n with (tmp_dir / \"params2.yaml\").open(\"w+\") as f:\n yaml.dump(supported_params, f)\n\n with (tmp_dir / \"params.yaml\").open(\"w+\") as f:\n yaml.dump(supported_params, f)\n\n (tmp_dir / \"foo\").write_text(\"foo\")\n stage = dvc.run(\n name=\"read_params\",\n deps=[\"foo\"],\n outs=[\"bar\"],\n params=[\n \"params2.yaml:lists,floats,name\",\n \"answer,floats,nested.nested1\",\n ],\n cmd=\"cat params2.yaml params.yaml > bar\",\n )\n\n params, deps = split_params_deps(stage)\n assert len(params) == 2\n assert len(deps) == 1\n assert len(stage.outs) == 1\n\n lockfile = stage.dvcfile._lockfile\n assert lockfile.load()[\"read_params\"][\"params\"] == {\n \"params2.yaml\": {\n \"lists\": [42, 42.0, \"42\"],\n \"floats\": 42.0,\n \"name\": \"Answer\",\n },\n \"params.yaml\": {\n \"answer\": 42,\n \"floats\": 42.0,\n \"nested.nested1\": {\"nested2\": \"42\", \"nested2-2\": 41.99999},\n },\n }\n data, _ = stage.dvcfile._load()\n params = data[\"stages\"][\"read_params\"][\"params\"]\n\n custom, defaults = lsplit(lambda v: isinstance(v, dict), params)\n assert set(custom[0][\"params2.yaml\"]) == {\"name\", \"lists\", \"floats\"}\n assert set(defaults) == {\"answer\", \"floats\", \"nested.nested1\"}\n\n assert not dvc.reproduce(stage.addressing)\n with (tmp_dir / \"params.yaml\").open(\"w+\") as f:\n params = deepcopy(supported_params)\n params[\"answer\"] = 43\n yaml.dump(params, f)\n\n assert dvc.reproduce(stage.addressing) == [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_run_multistage.py_os_test_run_with_name.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_multistage.py_os_test_run_with_name.None_4", "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": 23, "span_ids": ["test_run_with_name", "imports"], "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 os\nimport textwrap\n\nimport pytest\nimport yaml\n\nfrom dvc.exceptions import InvalidArgumentError\nfrom dvc.repo import Repo\nfrom dvc.stage.exceptions import DuplicateStageName, InvalidStageName\nfrom dvc.utils.yaml import parse_yaml_for_update\n\n\ndef test_run_with_name(tmp_dir, dvc, run_copy):\n from dvc.stage import PipelineStage\n from dvc.dvcfile import PIPELINE_FILE, PIPELINE_LOCK\n\n tmp_dir.dvc_gen(\"foo\", \"foo\")\n assert not os.path.exists(PIPELINE_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(PIPELINE_FILE)\n assert os.path.exists(PIPELINE_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/func/test_run_multistage.py_test_multi_stage_run_cached_test_multistage_dump_on_non_cached_outputs.dvc_run_": {"__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.dvc_run_", "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": 54, "end_line": 70, "span_ids": ["test_multistage_dump_on_non_cached_outputs", "test_multi_stage_run_cached"], "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": "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 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 )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\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_test_run_dump_on_multistage.assert_Dvcfile_dvc_PIPEL": {"__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_test_run_dump_on_multistage.assert_Dvcfile_dvc_PIPEL", "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": 146, "end_line": 203, "span_ids": ["test_run_dump_on_multistage"], "tokens": 395}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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, run_head):\n from dvc.dvcfile import Dvcfile, PIPELINE_FILE\n\n tmp_dir.gen(\n {\n \"dir\": {\n \"foo\": \"foo\\nfoo\",\n \"bar\": \"bar\\nbar\",\n \"foobar\": \"foobar\\foobar\",\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 data = Dvcfile(dvc, PIPELINE_FILE)._load()[0]\n assert data == {\n \"stages\": {\n \"copy-foo-foo2\": {\n \"cmd\": \"cp foo foo2\",\n \"deps\": [\"foo\"],\n \"outs\": [{\"foo2\": {\"persist\": True}}],\n \"always_changed\": True,\n \"wdir\": \"dir\",\n },\n }\n }\n\n run_head(\n \"foo\",\n \"bar\",\n \"foobar\",\n name=\"head-files\",\n outs=[\"bar-1\"],\n outs_persist=[\"foo-1\"],\n metrics_no_cache=[\"foobar-1\"],\n wdir=\"dir\",\n )\n assert Dvcfile(dvc, PIPELINE_FILE)._load()[0] == {\n \"stages\": {\n \"head-files\": {\n \"cmd\": \"python {} foo bar foobar\".format(\n (tmp_dir / \"head.py\").resolve()\n ),\n \"wdir\": \"dir\",\n \"deps\": [\"bar\", \"foo\", \"foobar\"],\n \"outs\": [\"bar-1\", {\"foo-1\": {\"persist\": True}}],\n \"metrics\": [{\"foobar-1\": {\"cache\": False}}],\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_multistage.py_test_run_with_invalid_stage_name_supported_params._": {"__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_invalid_stage_name_supported_params._", "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": 206, "end_line": 233, "span_ids": ["test_run_with_name_having_hyphen_underscore", "test_run_already_exists", "test_run_with_invalid_stage_name", "impl"], "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": "@pytest.mark.parametrize(\n \"char\", [\"@:\", \"#\", \"$\", \":\", \"/\", \"\\\\\", \".\", \";\", \",\"]\n)\ndef test_run_with_invalid_stage_name(run_copy, char):\n with pytest.raises(InvalidStageName):\n run_copy(\"foo\", \"bar\", name=f\"copy_name-{char}\")\n\n\ndef test_run_with_name_having_hyphen_underscore(tmp_dir, dvc, run_copy):\n tmp_dir.dvc_gen(\"foo\", \"foo\")\n run_copy(\"foo\", \"bar\", name=\"copy-foo_bar\")\n\n\ndef test_run_already_exists(tmp_dir, dvc, run_copy):\n tmp_dir.dvc_gen(\"foo\", \"foo\")\n run_copy(\"foo\", \"bar\", name=\"copy\")\n with pytest.raises(DuplicateStageName):\n run_copy(\"bar\", \"foobar\", name=\"copy\", force=False)\n run_copy(\"bar\", \"foobar\", name=\"copy\", force=True)\n\n\nsupported_params = {\n \"name\": \"Answer\",\n \"answer\": 42,\n \"floats\": 42.0,\n \"lists\": [42, 42.0, \"42\"],\n \"nested\": {\"nested1\": {\"nested2\": \"42\", \"nested2-2\": 41.99999}},\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_run_params_default_test_run_params_default.assert_data_stages_re": {"__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_params_default_test_run_params_default.assert_data_stages_re", "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": 236, "end_line": 258, "span_ids": ["test_run_params_default"], "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_run_params_default(tmp_dir, dvc):\n from dvc.dependency import ParamsDependency\n\n with (tmp_dir / \"params.yaml\").open(\"w+\") as f:\n yaml.dump(supported_params, f)\n\n stage = dvc.run(\n name=\"read_params\",\n params=[\"nested.nested1.nested2\"],\n cmd=\"cat params.yaml\",\n )\n isinstance(stage.deps[0], ParamsDependency)\n assert stage.deps[0].params == [\"nested.nested1.nested2\"]\n\n lockfile = stage.dvcfile._lockfile\n assert lockfile.load()[\"read_params\"][\"params\"] == {\n \"params.yaml\": {\"nested.nested1.nested2\": \"42\"}\n }\n\n data, _ = stage.dvcfile._load()\n assert data[\"stages\"][\"read_params\"][\"params\"] == [\n \"nested.nested1.nested2\"\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_TestRunCircularDependency_TestRunCircularDependency.test_non_normalized_paths.with_self_assertRaises_Ci.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_non_normalized_paths.with_self_assertRaises_Ci.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": 118, "end_line": 147, "span_ids": ["TestRunCircularDependency.test", "TestRunCircularDependency.test_non_normalized_paths", "TestRunCircularDependency.test_outs_no_cache", "TestRunCircularDependency"], "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 TestRunCircularDependency(TestDvc):\n def test(self):\n with self.assertRaises(CircularDependencyError):\n self.dvc.run(\n cmd=\"command\",\n deps=[self.FOO],\n outs=[self.FOO],\n fname=\"circular-dependency.dvc\",\n single_stage=True,\n )\n\n def test_outs_no_cache(self):\n with self.assertRaises(CircularDependencyError):\n self.dvc.run(\n cmd=\"command\",\n deps=[self.FOO],\n outs_no_cache=[self.FOO],\n fname=\"circular-dependency.dvc\",\n single_stage=True,\n )\n\n def test_non_normalized_paths(self):\n with self.assertRaises(CircularDependencyError):\n self.dvc.run(\n cmd=\"command\",\n deps=[\"./foo\"],\n outs=[\"foo\"],\n fname=\"circular-dependency.dvc\",\n single_stage=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_run_single_stage.py_TestRunCircularDependency.test_graph_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.test_graph_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": 148, "end_line": 169, "span_ids": ["TestRunCircularDependency.test_graph"], "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 TestRunCircularDependency(TestDvc):\n\n def test_graph(self):\n self.dvc.run(\n deps=[self.FOO],\n outs=[\"bar.txt\"],\n cmd=\"echo bar > bar.txt\",\n single_stage=True,\n )\n\n self.dvc.run(\n deps=[\"bar.txt\"],\n outs=[\"baz.txt\"],\n cmd=\"echo baz > baz.txt\",\n single_stage=True,\n )\n\n with self.assertRaises(CyclicGraphError):\n self.dvc.run(\n deps=[\"baz.txt\"],\n outs=[self.FOO],\n cmd=\"echo baz > foo\",\n single_stage=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_run_single_stage.py_TestRunBadWdir_TestRunBadWdir.test_not_dir.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_TestRunBadWdir_TestRunBadWdir.test_not_dir.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": 250, "end_line": 274, "span_ids": ["TestRunBadWdir.test_same_prefix", "TestRunBadWdir.test", "TestRunBadWdir", "TestRunBadWdir.test_not_found", "TestRunBadWdir.test_not_dir"], "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 TestRunBadWdir(TestDvc):\n def test(self):\n with self.assertRaises(StagePathOutsideError):\n self.dvc.run(cmd=\"command\", wdir=self.mkdtemp(), single_stage=True)\n\n def test_same_prefix(self):\n with self.assertRaises(StagePathOutsideError):\n path = f\"{self._root_dir}-{uuid.uuid4()}\"\n os.mkdir(path)\n self.dvc.run(cmd=\"command\", wdir=path, single_stage=True)\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=\"command\", wdir=path, single_stage=True)\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(\n cmd=\"command\", wdir=path, single_stage=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_state.py_os_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_os_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": 33, "span_ids": ["imports", "test_state"], "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 os\n\nimport mock\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.cache.local)\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_status.py_test_status_before_and_after_dvc_init_test_status_before_and_after_dvc_init.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_before_and_after_dvc_init_test_status_before_and_after_dvc_init.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": 45, "end_line": 67, "span_ids": ["test_status_before_and_after_dvc_init"], "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_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(os.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(os.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_status.py_test_status_on_pipeline_stages_test_status_on_pipeline_stages.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_status.py_test_status_on_pipeline_stages_test_status_on_pipeline_stages.None_2", "embedding": null, "metadata": {"file_path": "tests/func/test_status.py", "file_name": "test_status.py", "file_type": "text/x-python", "category": "test", "start_line": 70, "end_line": 94, "span_ids": ["test_status_on_pipeline_stages"], "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_status_on_pipeline_stages(tmp_dir, dvc, run_copy):\n tmp_dir.dvc_gen(\"foo\", \"foo\")\n stage = run_copy(\"foo\", \"bar\", name=\"copy-foo-bar\")\n\n stage.cmd = \" \".join(stage.cmd.split())\n stage.dvcfile._dump_pipeline_file(stage)\n assert dvc.status(\"copy-foo-bar\") == {\"copy-foo-bar\": [\"changed command\"]}\n\n # delete outputs\n (tmp_dir / \"bar\").unlink()\n assert dvc.status() == {\n \"copy-foo-bar\": [\n {\"changed outs\": {\"bar\": \"deleted\"}},\n \"changed command\",\n ]\n }\n (tmp_dir / \"foo\").unlink()\n assert dvc.status() == {\n \"foo.dvc\": [{\"changed outs\": {\"foo\": \"deleted\"}}],\n \"copy-foo-bar\": [\n {\"changed deps\": {\"foo\": \"deleted\"}},\n {\"changed outs\": {\"bar\": \"deleted\"}},\n \"changed command\",\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_status.py_test_status_recursive_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_status.py_test_status_recursive_", "embedding": null, "metadata": {"file_path": "tests/func/test_status.py", "file_name": "test_status.py", "file_type": "text/x-python", "category": "test", "start_line": 98, "end_line": 116, "span_ids": ["test_status_recursive"], "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_status_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\n assert dvc.status(targets=[\"dir\"], recursive=True) == {\n os.path.join(\"dir\", \"file.dvc\"): [\n {\"changed outs\": {os.path.join(\"dir\", \"file\"): \"not in cache\"}}\n ],\n os.path.join(\"dir\", \"subdir\", \"file2.dvc\"): [\n {\n \"changed outs\": {\n os.path.join(\"dir\", \"subdir\", \"file2\"): \"not in cache\"\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_update.py_test_update_rev_test_update_rev.None_4.assert_foobar_foo_f_": {"__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_test_update_rev.None_4.assert_foobar_foo_f_", "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": 167, "span_ids": ["test_update_rev"], "tokens": 320}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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(os.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\")[0]\n assert stage.deps[0].def_repo == {\n \"url\": os.fspath(git_dir),\n \"rev\": \"branch1\",\n \"rev_lock\": branch1_head,\n }\n with open(tmp_dir / \"foo\") as f:\n assert \"foobar\" == f.read()\n\n stage = dvc.update([\"foo.dvc\"], rev=\"branch2\")[0]\n assert stage.deps[0].def_repo == {\n \"url\": os.fspath(git_dir),\n \"rev\": \"branch2\",\n \"rev_lock\": branch2_head,\n }\n with open(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_update.py_test_update_recursive_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_update.py_test_update_recursive_", "embedding": null, "metadata": {"file_path": "tests/func/test_update.py", "file_name": "test_update.py", "file_type": "text/x-python", "category": "test", "start_line": 170, "end_line": 228, "span_ids": ["test_update_recursive"], "tokens": 564}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_recursive(tmp_dir, dvc, erepo_dir):\n with erepo_dir.branch(\"branch\", new=True), erepo_dir.chdir():\n erepo_dir.scm_gen(\n {\"foo1\": \"text1\", \"foo2\": \"text2\", \"foo3\": \"text3\"},\n commit=\"add foo files\",\n )\n old_rev = erepo_dir.scm.get_rev()\n\n tmp_dir.gen({\"dir\": {\"subdir\": {}}})\n stage1 = dvc.imp(\n os.fspath(erepo_dir),\n \"foo1\",\n os.path.join(\"dir\", \"foo1\"),\n rev=\"branch\",\n )\n stage2 = dvc.imp(\n os.fspath(erepo_dir),\n \"foo2\",\n os.path.join(\"dir\", \"subdir\", \"foo2\"),\n rev=\"branch\",\n )\n stage3 = dvc.imp(\n os.fspath(erepo_dir),\n \"foo3\",\n os.path.join(\"dir\", \"subdir\", \"foo3\"),\n rev=\"branch\",\n )\n\n assert (tmp_dir / os.path.join(\"dir\", \"foo1\")).read_text() == \"text1\"\n assert (\n tmp_dir / os.path.join(\"dir\", \"subdir\", \"foo2\")\n ).read_text() == \"text2\"\n assert (\n tmp_dir / os.path.join(\"dir\", \"subdir\", \"foo3\")\n ).read_text() == \"text3\"\n\n assert stage1.deps[0].def_repo[\"rev_lock\"] == old_rev\n assert stage2.deps[0].def_repo[\"rev_lock\"] == old_rev\n assert stage3.deps[0].def_repo[\"rev_lock\"] == old_rev\n\n with erepo_dir.branch(\"branch\", new=False), erepo_dir.chdir():\n erepo_dir.scm_gen(\n {\"foo1\": \"updated1\", \"foo2\": \"updated2\", \"foo3\": \"updated3\"},\n \"\",\n \"update foo content\",\n )\n new_rev = erepo_dir.scm.get_rev()\n\n assert old_rev != new_rev\n\n dvc.update([\"dir\"], recursive=True)\n\n stage1 = Dvcfile(dvc, stage1.path).stage\n stage2 = Dvcfile(dvc, stage2.path).stage\n stage3 = Dvcfile(dvc, stage3.path).stage\n assert stage1.deps[0].def_repo[\"rev_lock\"] == new_rev\n assert stage2.deps[0].def_repo[\"rev_lock\"] == new_rev\n assert stage3.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/unit/command/test_diff.py_test_show_json_and_hash_test_show_json_and_hash.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_and_hash_test_show_json_and_hash.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": 73, "end_line": 90, "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_diff.py_test_no_changes_test_show_md_empty.assert__show_md_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_diff.py_test_no_changes_test_show_md_empty.assert__show_md_", "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": 93, "end_line": 117, "span_ids": ["test_show_md_empty", "test_no_changes"], "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_no_changes(mocker, caplog):\n args = parse_args([\"diff\", \"--show-json\"])\n cmd = args.func(args)\n mocker.patch(\"dvc.repo.Repo.diff\", return_value={})\n\n def info():\n return [\n msg\n for name, level, msg in caplog.record_tuples\n if name.startswith(\"dvc\") and level == logging.INFO\n ]\n\n assert 0 == cmd.run()\n assert [\"{}\"] == info()\n\n caplog.clear()\n\n args = parse_args([\"diff\"])\n cmd = args.func(args)\n assert 0 == cmd.run()\n assert not info()\n\n\ndef test_show_md_empty():\n assert _show_md({}) == (\"| Status | 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/tests/unit/command/test_diff.py_test_show_md_": {"__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_md_", "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": 120, "end_line": 143, "span_ids": ["test_show_md"], "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": "def test_show_md():\n diff = {\n \"deleted\": [\n {\"path\": \"zoo\", \"hash\": \"22222\"},\n {\"path\": os.path.join(\"data\", \"\"), \"hash\": \"XXXXXXXX.dir\"},\n {\"path\": os.path.join(\"data\", \"foo\"), \"hash\": \"11111111\"},\n {\"path\": os.path.join(\"data\", \"bar\"), \"hash\": \"00000000\"},\n ],\n \"modified\": [\n {\"path\": \"file\", \"hash\": {\"old\": \"AAAAAAAA\", \"new\": \"BBBBBBBB\"}}\n ],\n \"added\": [{\"path\": \"file\", \"hash\": \"00000000\"}],\n }\n assert _show_md(diff) == (\n \"| Status | Path |\\n\"\n \"|----------|----------|\\n\"\n \"| added | file |\\n\"\n \"| deleted | data{sep} |\\n\"\n \"| deleted | data{sep}bar |\\n\"\n \"| deleted | data{sep}foo |\\n\"\n \"| deleted | zoo |\\n\"\n \"| modified | file |\\n\"\n ).format(sep=os.path.sep)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_textwrap_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_textwrap_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": 41, "span_ids": ["imports", "test_metrics_diff"], "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 textwrap\n\nfrom dvc.cli import parse_args\nfrom dvc.command.metrics import CmdMetricsDiff, CmdMetricsShow, _show_diff\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 \"--show-md\",\n \"--no-path\",\n \"--old\",\n \"--precision\",\n \"10\",\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_metrics.py_test_metrics_diff_sorted_test_metrics_diff_markdown_empty.assert__show_diff_mar": {"__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_test_metrics_diff_markdown_empty.assert__show_diff_mar", "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": 152, "end_line": 176, "span_ids": ["test_metrics_diff_sorted", "test_metrics_diff_markdown_empty"], "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": "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 ) == textwrap.dedent(\n \"\"\"\\\n Path Metric Value Change\n metrics.yaml a.b.c 2 1\n metrics.yaml a.d.e 4 1\n metrics.yaml x.b 6 1\"\"\"\n )\n\n\ndef test_metrics_diff_markdown_empty():\n assert _show_diff({}, markdown=True) == textwrap.dedent(\n \"\"\"\\\n | Path | Metric | Value | Change |\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/unit/command/test_params.py_test_params_diff_sorted_test_params_diff_markdown_empty.assert__show_diff_mar": {"__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_test_params_diff_markdown_empty.assert__show_diff_mar", "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": 110, "end_line": 134, "span_ids": ["test_params_diff_markdown_empty", "test_params_diff_sorted"], "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_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 ) == textwrap.dedent(\n \"\"\"\\\n Path Param Old New\n params.yaml a.b.c 1 2\n params.yaml a.d.e 3 4\n params.yaml x.b 5 6\"\"\"\n )\n\n\ndef test_params_diff_markdown_empty():\n assert _show_diff({}, markdown=True) == textwrap.dedent(\n \"\"\"\\\n | Path | Param | Old | New |\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/unit/command/test_update.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_update.py_from_dvc_cli_import_parse_", "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": 18, "span_ids": ["imports", "test_update"], "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": "from dvc.cli import parse_args\nfrom dvc.command.update import CmdUpdate\n\n\ndef test_update(dvc, mocker):\n cli_args = parse_args(\n [\"update\", \"target1\", \"target2\", \"--rev\", \"REV\", \"--recursive\"]\n )\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 m.assert_called_once_with(\n targets=[\"target1\", \"target2\"], rev=\"REV\", 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/remote/test_gdrive.py_os_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_os_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": 9, "span_ids": ["imports"], "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": "import os\n\nimport pytest\n\nfrom dvc.remote.gdrive import GDriveAuthError, GDriveRemoteTree\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_s3.py_test_grants_test_grants.None_3": {"__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_test_grants.None_3", "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": 28, "end_line": 46, "span_ids": ["test_grants"], "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_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 tree = S3RemoteTree(dvc, config)\n\n assert (\n tree.extra_args[\"GrantRead\"]\n == \"id=read-permission-id,id=other-read-permission-id\"\n )\n assert tree.extra_args[\"GrantReadACP\"] == \"id=read-acp-permission-id\"\n assert tree.extra_args[\"GrantWriteACP\"] == \"id=write-acp-permission-id\"\n assert (\n tree.extra_args[\"GrantFullControl\"] == \"id=full-control-permission-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/tests/unit/remote/test_s3.py_test_grants_mutually_exclusive_acl_error_": {"__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_mutually_exclusive_acl_error_", "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": 49, "end_line": 60, "span_ids": ["test_grants_mutually_exclusive_acl_error", "test_sse_kms_key_id"], "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": "def 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 S3RemoteTree(dvc, config)\n\n\ndef test_sse_kms_key_id(dvc):\n tree = S3RemoteTree(dvc, {\"url\": url, \"sse_kms_key_id\": \"key\"})\n assert tree.extra_args[\"SSEKMSKeyId\"] == \"key\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_test_walk_with_submodules.assert_set_files_g": {"__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_test_walk_with_submodules.assert_set_files_g", "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": 39, "span_ids": ["test_walk_with_submodules"], "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": "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=os.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_git.py_test_is_tracked_test_is_tracked.None_11": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/scm/test_git.py_test_is_tracked_test_is_tracked.None_11", "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": 41, "end_line": 65, "span_ids": ["test_is_tracked"], "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 test_is_tracked(tmp_dir, scm):\n tmp_dir.scm_gen(\n {\n \"tracked\": \"tracked\",\n \"dir\": {\"data\": \"data\", \"subdir\": {\"subdata\": \"subdata\"}},\n },\n commit=\"add dirs and files\",\n )\n tmp_dir.gen({\"untracked\": \"untracked\", \"dir\": {\"untracked\": \"untracked\"}})\n\n # sanity check\n assert (tmp_dir / \"untracked\").exists()\n assert (tmp_dir / \"tracked\").exists()\n assert (tmp_dir / \"dir\" / \"untracked\").exists()\n assert (tmp_dir / \"dir\" / \"data\").exists()\n assert (tmp_dir / \"dir\" / \"subdir\" / \"subdata\").exists()\n\n assert not scm.is_tracked(\"untracked\")\n assert not scm.is_tracked(os.path.join(\"dir\", \"untracked\"))\n\n assert scm.is_tracked(\"tracked\")\n assert scm.is_tracked(\"dir\")\n assert scm.is_tracked(os.path.join(\"dir\", \"data\"))\n assert scm.is_tracked(os.path.join(\"dir\", \"subdir\"))\n assert scm.is_tracked(os.path.join(\"dir\", \"subdir\", \"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/unit/scm/test_git.py_test_is_tracked_unicode_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/scm/test_git.py_test_is_tracked_unicode_", "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": 93, "end_line": 112, "span_ids": ["test_is_tracked_unicode", "test_no_commits"], "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": "def test_is_tracked_unicode(tmp_dir, scm):\n tmp_dir.scm_gen(\"\u1e6d\u1e5d\u1e01\u1e09\u1e35\u1e17\u1e0b\", \"tracked\", commit=\"add unicode\")\n tmp_dir.gen(\"\u1e73\u1e4b\u1e6d\u1e5d\u1e01\u1e09\u1e35\u1e17\u1e0b\", \"untracked\")\n assert scm.is_tracked(\"\u1e6d\u1e5d\u1e01\u1e09\u1e35\u1e17\u1e0b\")\n assert not scm.is_tracked(\"\u1e73\u1e4b\u1e6d\u1e5d\u1e01\u1e09\u1e35\u1e17\u1e0b\")\n\n\ndef test_no_commits(tmp_dir):\n from tests.dir_helpers import git_init\n from dvc.scm.git import Git\n\n git_init(\".\")\n assert Git().no_commits\n\n tmp_dir.gen(\"foo\", \"foo\")\n Git().add([\"foo\"])\n Git().commit(\"foo\")\n\n assert not Git().no_commits", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_json_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_json_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": 39, "span_ids": ["imports", "tmp_global_dir", "test_collect_and_send_report"], "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 json\nimport platform\n\nimport mock\nimport pytest\nfrom voluptuous import Any, Schema\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 assert not report.get(\"cmd_class\")\n assert not report.get(\"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_lockfile.py_pytest_test_stage_dump_when_already_exists.assert_lockfile_load_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_lockfile.py_pytest_test_stage_dump_when_already_exists.assert_lockfile_load_", "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": 25, "span_ids": ["imports", "test_stage_dump_when_already_exists", "test_stage_dump_no_outs_deps"], "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": "import pytest\nimport yaml\n\nfrom dvc.dvcfile import Lockfile, LockfileCorruptedError\nfrom dvc.stage import PipelineStage\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 = Lockfile(dvc, \"path.lock\")\n lockfile.dump(stage)\n assert lockfile.load() == {\"s1\": {\"cmd\": \"command\"}}\n\n\ndef 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 yaml.dump(data, f)\n stage = PipelineStage(name=\"s2\", repo=dvc, path=\"path\", cmd=\"command2\")\n lockfile = Lockfile(dvc, \"path.lock\")\n lockfile.dump(stage)\n assert lockfile.load() == {\n **data,\n \"s2\": {\"cmd\": \"command2\"},\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_": {"__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_", "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": 45, "span_ids": ["test_stage_dump_with_deps_and_outs"], "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_dump_with_deps_and_outs(tmp_dir, dvc):\n data = {\n \"s1\": {\n \"cmd\": \"command\",\n \"deps\": [{\"md5\": \"1.txt\", \"path\": \"checksum\"}],\n \"outs\": [{\"md5\": \"2.txt\", \"path\": \"checksum\"}],\n }\n }\n with open(\"path.lock\", \"w+\") as f:\n yaml.dump(data, f)\n\n lockfile = Lockfile(dvc, \"path.lock\")\n stage = PipelineStage(name=\"s2\", repo=dvc, path=\"path\", cmd=\"command2\")\n lockfile.dump(stage)\n assert lockfile.load() == {\n **data,\n \"s2\": {\"cmd\": \"command2\"},\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_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_overwrites_if_already_exists_test_load_when_lockfile_does_not_exist.assert_Lockfile_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": 48, "end_line": 60, "span_ids": ["test_load_when_lockfile_does_not_exist", "test_stage_overwrites_if_already_exists"], "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": "def test_stage_overwrites_if_already_exists(tmp_dir, dvc):\n lockfile = Lockfile(dvc, \"path.lock\",)\n stage = PipelineStage(name=\"s2\", repo=dvc, path=\"path\", cmd=\"command2\")\n lockfile.dump(stage)\n stage = PipelineStage(name=\"s2\", repo=dvc, path=\"path\", cmd=\"command3\")\n lockfile.dump(stage)\n assert lockfile.load() == {\n \"s2\": {\"cmd\": \"command3\"},\n }\n\n\ndef test_load_when_lockfile_does_not_exist(tmp_dir, dvc):\n assert {} == Lockfile(dvc, \"pipelines.lock\").load()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_humanize.py_from_collections_import_O_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_humanize.py_from_collections_import_O_", "embedding": null, "metadata": {"file_path": "tests/unit/utils/test_humanize.py", "file_name": "test_humanize.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 41, "span_ids": ["imports", "test_get_summary"], "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": "from collections import OrderedDict\n\nfrom dvc.utils.humanize import get_summary\n\n\ndef test_get_summary():\n # dict, so that we could delete from it easily\n stats = OrderedDict(\n [\n (\"fetched\", 3),\n (\"added\", [\"file1\", \"file2\", \"file3\"]),\n (\"deleted\", [\"file4\", \"file5\"]),\n (\"modified\", [\"file6\", \"file7\"]),\n ]\n )\n\n assert get_summary(stats.items()) == (\n \"3 files fetched, \"\n \"3 files added, \"\n \"2 files deleted \"\n \"and \"\n \"2 files modified\"\n )\n\n del stats[\"fetched\"]\n del stats[\"deleted\"][1]\n assert (\n get_summary(stats.items())\n == \"3 files added, 1 file deleted and 2 files modified\"\n )\n\n del stats[\"deleted\"][0]\n assert get_summary(stats.items()) == \"3 files added and 2 files modified\"\n\n del stats[\"modified\"]\n assert get_summary(stats.items()) == \"3 files added\"\n\n assert get_summary([]) == \"\"\n assert get_summary([(\"x\", 0), (\"y\", [])]) == \"\"\n assert get_summary([(\"x\", 1), (\"y\", [])]) == \"1 file x\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_os_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_os_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": 26, "span_ids": ["imports", "test_to_chunks_chunk_size"], "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": "import os\nimport re\n\nimport pytest\n\nfrom dvc.path_info import PathInfo\nfrom dvc.utils import (\n dict_sha256,\n file_md5,\n fix_env,\n parse_target,\n relpath,\n resolve_output,\n tmp_fname,\n to_chunks,\n)\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_resolve_output_test_resolve_output.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_resolve_output_test_resolve_output.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": 114, "end_line": 135, "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/unit/utils/test_utils.py_test_parse_target_test_hint_on_lockfile.assert_dvc_yaml_name_in": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_utils.py_test_parse_target_test_hint_on_lockfile.assert_dvc_yaml_name_in", "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": 138, "end_line": 161, "span_ids": ["test_hint_on_lockfile", "test_parse_target"], "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": "@pytest.mark.parametrize(\n \"inp,out, default\",\n [\n [\"dvc.yaml\", (\"dvc.yaml\", None), None],\n [\"dvc.yaml:name\", (\"dvc.yaml\", \"name\"), None],\n [\":name\", (\"dvc.yaml\", \"name\"), None],\n [\"stage.dvc\", (\"stage.dvc\", None), None],\n [\"dvc.yaml:name\", (\"dvc.yaml\", \"name\"), None],\n [\"../models/stage.dvc\", (\"../models/stage.dvc\", None), \"def\"],\n [\":name\", (\"default\", \"name\"), \"default\"],\n [\":name\", (\"default\", \"name\"), \"default\"],\n [\"something.dvc:name\", (\"something.dvc\", \"name\"), None],\n [\"../something.dvc:name\", (\"../something.dvc\", \"name\"), None],\n [\"file\", (None, \"file\"), None],\n ],\n)\ndef test_parse_target(inp, out, default):\n assert parse_target(inp, default) == out\n\n\ndef test_hint_on_lockfile():\n with pytest.raises(Exception) as exc:\n assert parse_target(\"dvc.lock:name\")\n assert \"dvc.yaml:name\" in str(exc.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/utils/test_utils.py_test_dict_sha256_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_utils.py_test_dict_sha256_", "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": 161, "end_line": 184, "span_ids": ["test_dict_sha256"], "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": "@pytest.mark.parametrize(\n \"d,sha\",\n [\n (\n {\n \"cmd\": \"echo content > out\",\n \"deps\": {\"dep\": \"2254342becceafbd04538e0a38696791\"},\n \"outs\": {\"out\": \"f75b8179e4bbe7e2b4a074dcef62de95\"},\n },\n \"f472eda60f09660a4750e8b3208cf90b3a3b24e5f42e0371d829710e9464d74a\",\n ),\n (\n {\n \"cmd\": \"echo content > out\",\n \"deps\": {\"dep\": \"2254342becceafbd04538e0a38696791\"},\n \"outs\": [\"out\"],\n },\n \"a239b67073bd58affcdb81fff3305d1726c6e7f9c86f3d4fca0e92e8147dc7b0\",\n ),\n ],\n)\ndef test_dict_sha256(d, sha):\n assert dict_sha256(d) == sha", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_DvcParser_DvcParser.parse_args.return.args": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cli.py_DvcParser_DvcParser.parse_args.return.args", "embedding": null, "metadata": {"file_path": "dvc/cli.py", "file_name": "cli.py", "file_type": "text/x-python", "category": "implementation", "start_line": 83, "end_line": 111, "span_ids": ["DvcParser", "DvcParser.error", "DvcParser.parse_args"], "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 DvcParser(argparse.ArgumentParser):\n \"\"\"Custom parser class for dvc CLI.\"\"\"\n\n def error(self, message, command=None): # pylint: disable=arguments-differ\n \"\"\"Custom error method.\n Args:\n message (str): error message.\n command (str): subcommand name for help message\n Raises:\n dvc.exceptions.DvcParser: dvc parser exception.\n\n \"\"\"\n logger.error(message)\n if command is not None:\n for action in self._actions:\n if action.dest == \"cmd\" and command in action.choices:\n subparser = action.choices[command]\n subparser.print_help()\n raise DvcParserError()\n self.print_help()\n raise DvcParserError()\n\n # override this to send subcommand name to error method\n def parse_args(self, args=None, namespace=None):\n args, argv = self.parse_known_args(args, namespace)\n if argv:\n msg = \"unrecognized arguments: %s\"\n self.error(msg % \" \".join(argv), args.cmd)\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/cli.py_VersionAction_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_VersionAction_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": 112, "end_line": 140, "span_ids": ["get_parent_parser", "VersionAction.__call__", "VersionAction"], "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 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)\n\n\ndef 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=\"count\", default=0, help=\"Be quiet.\"\n )\n log_level_group.add_argument(\n \"-v\", \"--verbose\", action=\"count\", default=0, 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/command/dag.py_argparse__show_dot.return.dot_file_getvalue_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/dag.py_argparse__show_dot.return.dot_file_getvalue_", "embedding": null, "metadata": {"file_path": "dvc/command/dag.py", "file_name": "dag.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 29, "span_ids": ["imports", "_show_dot", "_show_ascii"], "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 argparse\nimport logging\n\nfrom dvc.command.base import CmdBase, append_doc_link\nfrom dvc.exceptions import DvcException\n\nlogger = logging.getLogger(__name__)\n\n\ndef _show_ascii(G):\n from dvc.repo.graph import get_pipelines\n from dvc.dagascii import draw\n\n pipelines = get_pipelines(G)\n\n ret = []\n for pipeline in pipelines:\n ret.append(draw(pipeline.nodes, pipeline.edges))\n\n return \"\\n\".join(ret)\n\n\ndef _show_dot(G):\n import io\n from networkx.drawing.nx_pydot import write_dot\n\n dot_file = io.StringIO()\n write_dot(G, dot_file)\n return dot_file.getvalue()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/dag.py__build__build.return.nx_relabel_nodes_H__rela": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/dag.py__build__build.return.nx_relabel_nodes_H__rela", "embedding": null, "metadata": {"file_path": "dvc/command/dag.py", "file_name": "dag.py", "file_type": "text/x-python", "category": "implementation", "start_line": 32, "end_line": 48, "span_ids": ["_build"], "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": "def _build(G, target=None, full=False):\n import networkx as nx\n from dvc.repo.graph import get_pipeline, get_pipelines\n\n if target:\n H = get_pipeline(get_pipelines(G), target)\n if not full:\n descendants = nx.descendants(G, target)\n descendants.add(target)\n H.remove_nodes_from(set(G.nodes()) - descendants)\n else:\n H = G\n\n def _relabel(stage):\n return stage.addressing\n\n return nx.relabel_nodes(H, _relabel, copy=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/command/dag.py_CmdDAG_CmdDAG.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/dag.py_CmdDAG_CmdDAG.run.try_.except_DvcException_.return.1", "embedding": null, "metadata": {"file_path": "dvc/command/dag.py", "file_name": "dag.py", "file_type": "text/x-python", "category": "implementation", "start_line": 51, "end_line": 82, "span_ids": ["CmdDAG", "CmdDAG.run"], "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": "class CmdDAG(CmdBase):\n def run(self):\n try:\n target = None\n if self.args.target:\n stages = self.repo.collect(self.args.target)\n if len(stages) > 1:\n logger.error(\n f\"'{self.args.target}' contains more than one stage \"\n \"{stages}, please specify one stage\"\n )\n return 1\n target = stages[0]\n\n G = _build(self.repo.graph, target=target, full=self.args.full,)\n\n if self.args.dot:\n logger.info(_show_dot(G))\n else:\n from dvc.utils.pager import pager\n\n pager(_show_ascii(G))\n\n return 0\n except DvcException:\n msg = \"failed to show \"\n if self.args.target:\n msg += f\"a pipeline for '{target}'\"\n else:\n msg += \"pipelines\"\n logger.exception(msg)\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/dag.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/dag.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/dag.py", "file_name": "dag.py", "file_type": "text/x-python", "category": "implementation", "start_line": 85, "end_line": 116, "span_ids": ["add_parser"], "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": "def add_parser(subparsers, parent_parser):\n DAG_HELP = \"Visualize DVC project DAG.\"\n dag_parser = subparsers.add_parser(\n \"dag\",\n parents=[parent_parser],\n description=append_doc_link(DAG_HELP, \"dag\"),\n help=DAG_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n dag_parser.add_argument(\n \"--dot\",\n action=\"store_true\",\n default=False,\n help=\"Print DAG with .dot format.\",\n )\n dag_parser.add_argument(\n \"--full\",\n action=\"store_true\",\n default=False,\n help=(\n \"Show full DAG that the target belongs too, instead of \"\n \"showing DAG consisting only of ancestors.\"\n ),\n )\n dag_parser.add_argument(\n \"target\",\n nargs=\"?\",\n help=\"Stage or output to show pipeline for (optional). \"\n \"Finds all stages in the workspace by default.\",\n )\n dag_parser.set_defaults(func=CmdDAG)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/freeze.py_argparse_CmdUnfreeze.run.return.self__run_self_repo_unfre": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/freeze.py_argparse_CmdUnfreeze.run.return.self__run_self_repo_unfre", "embedding": null, "metadata": {"file_path": "dvc/command/freeze.py", "file_name": "freeze.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 30, "span_ids": ["CmdFreezeBase", "CmdFreeze", "imports", "CmdFreezeBase._run", "CmdFreeze.run", "CmdUnfreeze", "CmdUnfreeze.run"], "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": "import argparse\nimport logging\n\nfrom dvc.command import completion\nfrom dvc.command.base import CmdBase, append_doc_link\nfrom dvc.exceptions import DvcException\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdFreezeBase(CmdBase):\n def _run(self, func, name):\n ret = 0\n for target in self.args.targets:\n try:\n func(target)\n except DvcException:\n logger.exception(f\"failed to {name} '{target}'\")\n ret = 1\n return ret\n\n\nclass CmdFreeze(CmdFreezeBase):\n def run(self):\n return self._run(self.repo.freeze, \"freeze\")\n\n\nclass CmdUnfreeze(CmdFreezeBase):\n def run(self):\n return self._run(self.repo.unfreeze, \"unfreeze\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/freeze.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/freeze.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/freeze.py", "file_name": "freeze.py", "file_type": "text/x-python", "category": "implementation", "start_line": 33, "end_line": 59, "span_ids": ["add_parser"], "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 add_parser(subparsers, parent_parser):\n FREEZE_HELP = \"Freeze stages or .dvc files.\"\n freeze_parser = subparsers.add_parser(\n \"freeze\",\n parents=[parent_parser],\n description=append_doc_link(FREEZE_HELP, \"freeze\"),\n help=FREEZE_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n freeze_parser.add_argument(\n \"targets\", nargs=\"+\", help=\"Stages or .dvc files to freeze\",\n ).complete = completion.DVC_FILE\n freeze_parser.set_defaults(func=CmdFreeze)\n\n UNFREEZE_HELP = \"Unfreeze stages or .dvc files.\"\n unfreeze_parser = subparsers.add_parser(\n \"unfreeze\",\n parents=[parent_parser],\n description=append_doc_link(UNFREEZE_HELP, \"unfreeze\"),\n help=UNFREEZE_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n unfreeze_parser.add_argument(\n \"targets\", nargs=\"+\", help=\"Stages or .dvc files to unfreeze\",\n ).complete = completion.DVC_FILE\n unfreeze_parser.set_defaults(func=CmdUnfreeze)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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__show_diff__show_diff.return.table_header_rows_markd": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py__show_diff__show_diff.return.table_header_rows_markd", "embedding": null, "metadata": {"file_path": "dvc/command/metrics.py", "file_name": "metrics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 69, "end_line": 103, "span_ids": ["_show_diff"], "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 _show_diff(diff, markdown=False, no_path=False, old=False, precision=None):\n from collections import OrderedDict\n\n from dvc.utils.diff import table\n\n if precision is None:\n precision = DEFAULT_PRECISION\n\n def _round(val):\n if isinstance(val, float):\n return round(val, precision)\n\n return val\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 row = [] if no_path else [fname]\n row.append(metric)\n if old:\n row.append(_round(change.get(\"old\")))\n row.append(_round(change[\"new\"]))\n row.append(_round(change.get(\"diff\", \"diff not supported\")))\n rows.append(row)\n\n header = [] if no_path else [\"Path\"]\n header.append(\"Metric\")\n if old:\n header.extend([\"Old\", \"New\"])\n else:\n header.append(\"Value\")\n header.append(\"Change\")\n\n return table(header, rows, markdown)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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__show_diff.return.table_header_rows_markd": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/params.py_argparse__show_diff.return.table_header_rows_markd", "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": 29, "span_ids": ["imports", "_show_diff"], "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 argparse\nimport logging\nfrom collections import OrderedDict\n\nfrom dvc.command.base import CmdBase, append_doc_link, fix_subparsers\nfrom dvc.exceptions import DvcException\n\nlogger = logging.getLogger(__name__)\n\n\ndef _show_diff(diff, markdown=False, no_path=False):\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 row = [] if no_path else [fname]\n row.append(param)\n row.append(change[\"old\"])\n row.append(change[\"new\"])\n rows.append(row)\n\n header = [] if no_path else [\"Path\"]\n header.append(\"Param\")\n header.append(\"Old\")\n header.append(\"New\")\n\n return table(header, rows, markdown)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_CmdParamsDiff_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_CmdParamsDiff_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": 32, "end_line": 54, "span_ids": ["CmdParamsDiff.run", "CmdParamsDiff"], "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 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, self.args.show_md, self.args.no_path)\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/plots.py_argparse_DIV_HTML._div_id_id_div": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/plots.py_argparse_DIV_HTML._div_id_id_div", "embedding": null, "metadata": {"file_path": "dvc/command/plots.py", "file_name": "plots.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 30, "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 argparse\nimport logging\nimport os\n\nfrom dvc.command import completion\nfrom dvc.command.base import CmdBase, append_doc_link, fix_subparsers\nfrom dvc.exceptions import DvcException\nfrom dvc.schema import PLOT_PROPS\nfrom dvc.utils import format_link\n\nlogger = logging.getLogger(__name__)\n\nPAGE_HTML = \"\"\"\n\n\n DVC Plot\n \n \n \n\n\n {divs}\n\n\"\"\"\n\nDIV_HTML = \"\"\"
\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/plots.py_CmdPlots_CmdPlots.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/plots.py_CmdPlots_CmdPlots.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/plots.py", "file_name": "plots.py", "file_type": "text/x-python", "category": "implementation", "start_line": 32, "end_line": 78, "span_ids": ["CmdPlots._func", "CmdPlots.run", "CmdPlots", "CmdPlots._props"], "tokens": 335}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CmdPlots(CmdBase):\n def _func(self, *args, **kwargs):\n raise NotImplementedError\n\n def _props(self):\n # Pass only props specified by user, to not shadow ones from plot def\n props = {p: getattr(self.args, p) for p in PLOT_PROPS}\n return {k: v for k, v in props.items() if v is not None}\n\n def run(self):\n if self.args.show_vega:\n if not self.args.targets:\n logger.error(\"please specify a target for `--show-vega`\")\n return 1\n if len(self.args.targets) > 1:\n logger.error(\n \"you can only specify one target for `--show-vega`\"\n )\n return 1\n\n try:\n plots = self._func(targets=self.args.targets, props=self._props())\n\n if self.args.show_vega:\n target = self.args.targets[0]\n logger.info(plots[target])\n return 0\n\n divs = [\n DIV_HTML.format(id=f\"plot{i}\", vega_json=plot)\n for i, plot in enumerate(plots.values())\n ]\n html = PAGE_HTML.format(divs=\"\\n\".join(divs))\n path = self.args.out or \"plots.html\"\n\n with open(path, \"w\") as fobj:\n fobj.write(html)\n\n logger.info(\n \"file://{}\".format(os.path.join(self.repo.root_dir, path))\n )\n\n except DvcException:\n logger.exception(\"\")\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/plots.py_CmdPlotsShow_CmdPlotsModify.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/plots.py_CmdPlotsShow_CmdPlotsModify.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/plots.py", "file_name": "plots.py", "file_type": "text/x-python", "category": "implementation", "start_line": 81, "end_line": 96, "span_ids": ["CmdPlotsDiff._func", "CmdPlotsShow._func", "CmdPlotsModify.run", "CmdPlotsShow", "CmdPlotsModify", "CmdPlotsDiff"], "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 CmdPlotsShow(CmdPlots):\n def _func(self, *args, **kwargs):\n return self.repo.plots.show(*args, **kwargs)\n\n\nclass CmdPlotsDiff(CmdPlots):\n def _func(self, *args, **kwargs):\n return self.repo.plots.diff(*args, revs=self.args.revisions, **kwargs)\n\n\nclass CmdPlotsModify(CmdPlots):\n def run(self):\n self.repo.plots.modify(\n self.args.target, props=self._props(), unset=self.args.unset,\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/plots.py_add_parser_add_parser.plots_modify_parser_set_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/plots.py_add_parser_add_parser.plots_modify_parser_set_d", "embedding": null, "metadata": {"file_path": "dvc/command/plots.py", "file_name": "plots.py", "file_type": "text/x-python", "category": "implementation", "start_line": 100, "end_line": 179, "span_ids": ["add_parser"], "tokens": 621}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 PLOTS_HELP = (\n \"Commands to visualize and compare plot metrics in structured files \"\n \"(JSON, YAML, CSV, TSV)\"\n )\n\n plots_parser = subparsers.add_parser(\n \"plots\",\n parents=[parent_parser],\n description=append_doc_link(PLOTS_HELP, \"plots\"),\n help=PLOTS_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n plots_subparsers = plots_parser.add_subparsers(\n dest=\"cmd\",\n help=\"Use `dvc plots CMD --help` to display command-specific help.\",\n )\n\n fix_subparsers(plots_subparsers)\n\n SHOW_HELP = \"Generate plots from metric files.\"\n plots_show_parser = plots_subparsers.add_parser(\n \"show\",\n parents=[parent_parser],\n description=append_doc_link(SHOW_HELP, \"plots/show\"),\n help=SHOW_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n plots_show_parser.add_argument(\n \"targets\",\n nargs=\"*\",\n help=\"Plots files to visualize. Shows all plots by default.\",\n ).complete = completion.FILE\n _add_props_arguments(plots_show_parser)\n _add_output_arguments(plots_show_parser)\n plots_show_parser.set_defaults(func=CmdPlotsShow)\n\n PLOTS_DIFF_HELP = (\n \"Show multiple versions of plot metrics \"\n \"by plotting them in a single image.\"\n )\n plots_diff_parser = plots_subparsers.add_parser(\n \"diff\",\n parents=[parent_parser],\n description=append_doc_link(PLOTS_DIFF_HELP, \"plots/diff\"),\n help=PLOTS_DIFF_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n plots_diff_parser.add_argument(\n \"--targets\",\n nargs=\"*\",\n help=\"Plots file to visualize. Shows all plots by default.\",\n metavar=\"\",\n ).complete = completion.FILE\n plots_diff_parser.add_argument(\n \"revisions\", nargs=\"*\", default=None, help=\"Git commits to plot from\",\n )\n _add_props_arguments(plots_diff_parser)\n _add_output_arguments(plots_diff_parser)\n plots_diff_parser.set_defaults(func=CmdPlotsDiff)\n\n PLOTS_MODIFY_HELP = \"Modify display properties of plot metric files.\"\n plots_modify_parser = plots_subparsers.add_parser(\n \"modify\",\n parents=[parent_parser],\n description=append_doc_link(PLOTS_MODIFY_HELP, \"plots/modify\"),\n help=PLOTS_MODIFY_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n plots_modify_parser.add_argument(\n \"target\", help=\"Metric file to set properties to\",\n ).complete = completion.FILE\n _add_props_arguments(plots_modify_parser)\n plots_modify_parser.add_argument(\n \"--unset\",\n nargs=\"*\",\n metavar=\"\",\n help=\"Unset one or more display properties.\",\n )\n plots_modify_parser.set_defaults(func=CmdPlotsModify)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/plots.py__add_props_arguments_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/plots.py__add_props_arguments_", "embedding": null, "metadata": {"file_path": "dvc/command/plots.py", "file_name": "plots.py", "file_type": "text/x-python", "category": "implementation", "start_line": 182, "end_line": 234, "span_ids": ["_add_output_arguments", "_add_props_arguments"], "tokens": 347}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_props_arguments(parser):\n parser.add_argument(\n \"-t\",\n \"--template\",\n nargs=\"?\",\n default=None,\n help=(\n \"Special JSON or HTML schema file to inject with the data. \"\n \"See {}\".format(\n format_link(\"https://man.dvc.org/plots#plot-templates\")\n )\n ),\n metavar=\"\",\n ).complete = completion.FILE\n parser.add_argument(\n \"-x\", default=None, help=\"Field name for X axis.\", metavar=\"\"\n )\n parser.add_argument(\n \"-y\", default=None, help=\"Field name for Y axis.\", metavar=\"\"\n )\n parser.add_argument(\n \"--no-header\",\n action=\"store_false\",\n dest=\"header\",\n default=None, # Use default None to distinguish when it's not used\n help=\"Provided CSV or TSV datafile does not have a header.\",\n )\n parser.add_argument(\n \"--title\", default=None, metavar=\"\", help=\"Plot title.\"\n )\n parser.add_argument(\n \"--x-label\", default=None, help=\"X axis label\", metavar=\"\"\n )\n parser.add_argument(\n \"--y-label\", default=None, help=\"Y axis label\", metavar=\"\"\n )\n\n\ndef _add_output_arguments(parser):\n parser.add_argument(\n \"-o\",\n \"--out\",\n default=None,\n help=\"Destination path to save plots to\",\n metavar=\"\",\n ).complete = completion.DIR\n parser.add_argument(\n \"--show-vega\",\n action=\"store_true\",\n default=False,\n help=\"Show output in Vega format.\",\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_argparse_CmdRemote._check_exists.if_self_args_name_not_in_.raise_ConfigError_f_remot": {"__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_f_remot", "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": 21, "span_ids": ["imports", "CmdRemote", "CmdRemote.__init__", "CmdRemote._check_exists"], "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": "import argparse\nimport logging\n\nfrom dvc.command.base import append_doc_link, fix_subparsers\nfrom dvc.command.config import CmdConfig\nfrom dvc.config import ConfigError\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(f\"remote '{self.args.name}' doesn't 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/dvc/command/remote.py_CmdRemoteRename_CmdRemoteRename.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_CmdRemoteRename_CmdRemoteRename.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": 111, "end_line": 137, "span_ids": ["CmdRemoteRename.run", "CmdRemoteRename", "CmdRemoteRename._rename_default"], "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 CmdRemoteRename(CmdRemote):\n def _rename_default(self, conf):\n if conf[\"core\"].get(\"remote\") == self.args.name:\n conf[\"core\"][\"remote\"] = self.args.new\n\n def run(self):\n all_config = self.config.load_config_to_level(None)\n if self.args.new in all_config.get(\"remote\", {}):\n raise ConfigError(\n \"Rename failed. Remote name '{}' already exists.\".format(\n {self.args.new}\n )\n )\n\n with self.config.edit(self.args.level) as conf:\n self._check_exists(conf)\n conf[\"remote\"][self.args.new] = conf[\"remote\"][self.args.name]\n del conf[\"remote\"][self.args.name]\n self._rename_default(conf)\n\n for level in reversed(self.config.LEVELS):\n if level == self.args.level:\n break\n with self.config.edit(level) as level_conf:\n self._rename_default(level_conf)\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_add_parser_add_parser.REMOTE_REMOVE_HELP._Remove_a_data_remote_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_add_parser_add_parser.REMOTE_REMOVE_HELP._Remove_a_data_remote_", "embedding": null, "metadata": {"file_path": "dvc/command/remote.py", "file_name": "remote.py", "file_type": "text/x-python", "category": "implementation", "start_line": 140, "end_line": 244, "span_ids": ["add_parser"], "tokens": 781}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 # ... 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/remote.py_add_parser.remote_remove_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_add_parser.remote_remove_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/remote.py", "file_name": "remote.py", "file_type": "text/x-python", "category": "implementation", "start_line": 245, "end_line": 267, "span_ids": ["add_parser"], "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 add_parser(subparsers, parent_parser):\n # ... other code\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)\n REMOTE_RENAME_HELP = \"Rename a DVC remote\"\n remote_rename_parser = remote_subparsers.add_parser(\n \"rename\",\n parents=[parent_config_parser, parent_parser],\n description=append_doc_link(REMOTE_RENAME_HELP, \"remote/rename\"),\n help=REMOTE_RENAME_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n remote_rename_parser.add_argument(\"name\", help=\"Remote to be renamed\")\n remote_rename_parser.add_argument(\"new\", help=\"New name of the remote\")\n remote_rename_parser.set_defaults(func=CmdRemoteRename)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remove.py_argparse_", "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": 43, "span_ids": ["CmdRemove.run", "imports", "add_parser", "CmdRemove"], "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": "import argparse\nimport logging\n\nfrom dvc.command import completion\nfrom dvc.command.base import CmdBase, append_doc_link\nfrom dvc.exceptions import DvcException\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdRemove(CmdBase):\n def run(self):\n for target in self.args.targets:\n try:\n self.repo.remove(target, outs=self.args.outs)\n except DvcException:\n logger.exception(f\"failed to remove '{target}'\")\n return 1\n return 0\n\n\ndef add_parser(subparsers, parent_parser):\n REMOVE_HELP = (\n \"Remove stage entry, remove .gitignore entry and unprotect outputs\"\n )\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.add_argument(\n \"--outs\",\n action=\"store_true\",\n default=False,\n help=\"Remove outputs as well.\",\n )\n remove_parser.add_argument(\n \"targets\", nargs=\"+\", help=\"DVC-files to remove.\",\n ).complete = completion.DVC_FILE\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/run.py_CmdRun._parsed_cmd_CmdRun._quote_argument.return.f_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.f_argument_", "embedding": null, "metadata": {"file_path": "dvc/command/run.py", "file_name": "run.py", "file_type": "text/x-python", "category": "implementation", "start_line": 64, "end_line": 83, "span_ids": ["CmdRun._parsed_cmd", "CmdRun._quote_argument"], "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 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 f'\"{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/dagascii.py_AsciiCanvas_AsciiCanvas.draw.return.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.return.joined_lines", "embedding": null, "metadata": {"file_path": "dvc/dagascii.py", "file_name": "dagascii.py", "file_type": "text/x-python", "category": "implementation", "start_line": 78, "end_line": 101, "span_ids": ["AsciiCanvas", "AsciiCanvas.__init__", "AsciiCanvas.draw"], "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 AsciiCanvas:\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 lines = map(\"\".join, self.canvas)\n joined_lines = os.linesep.join(lines)\n return 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/dependency/__init__.py__merge_params_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/__init__.py__merge_params_", "embedding": null, "metadata": {"file_path": "dvc/dependency/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 91, "end_line": 117, "span_ids": ["_merge_params", "loads_params"], "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": "def _merge_params(s_list):\n d = defaultdict(list)\n default_file = ParamsDependency.DEFAULT_PARAMS_FILE\n for key in s_list:\n if isinstance(key, str):\n d[default_file].append(key)\n continue\n if not isinstance(key, dict):\n msg = \"Only list of str/dict is supported. Got: \"\n msg += f\"'{type(key).__name__}'.\"\n raise ValueError(msg)\n\n for k, params in key.items():\n if not isinstance(params, list):\n msg = \"Expected list of params for custom params file \"\n msg += f\"'{k}', got '{type(params).__name__}'.\"\n raise ValueError(msg)\n d[k].extend(params)\n return d\n\n\ndef loads_params(stage, s_list):\n d = _merge_params(s_list)\n return [\n ParamsDependency(stage, path, params) for path, params in d.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/dependency/azure.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/azure.py__", "embedding": null, "metadata": {"file_path": "dvc/dependency/azure.py", "file_name": "azure.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 8, "span_ids": ["imports", "AzureDependency"], "tokens": 46}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 BaseDependency\nfrom dvc.output.base import BaseOutput\nfrom dvc.remote.azure import AzureRemoteTree\n\n\nclass AzureDependency(BaseDependency, BaseOutput):\n TREE_CLS = AzureRemoteTree", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/param.py_os_", "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": 117, "span_ids": ["ParamsDependency", "ParamsDependency.__init__", "ParamsDependency.dumpd", "ParamsDependency.status", "ParamsDependency.save_info", "BadParamFileError", "imports", "ParamsDependency.read_params", "MissingParamsError", "ParamsDependency.fill_values", "ParamsDependency.save"], "tokens": 598}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 collections import defaultdict\n\nimport dpath.util\nimport yaml\nfrom voluptuous import Any\n\nfrom dvc.dependency.local import LocalDependency\nfrom dvc.exceptions import DvcException\n\n\nclass MissingParamsError(DvcException):\n pass\n\n\nclass BadParamFileError(DvcException):\n pass\n\n\nclass ParamsDependency(LocalDependency):\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 fill_values(self, values=None):\n \"\"\"Load params values dynamically.\"\"\"\n if not values:\n return\n for param in self.params:\n value = values.get(param)\n if value:\n self.info[param] = value\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 }\n\n def read_params(self):\n if not self.exists:\n return {}\n\n with self.repo.tree.open(self.path_info, \"r\") as fobj:\n try:\n config = yaml.safe_load(fobj)\n except yaml.YAMLError as exc:\n raise BadParamFileError(\n f\"Unable to read parameters from '{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/dependency/repo.py_os_RepoDependency._make_repo.return.external_repo_d_url_r": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/repo.py_os_RepoDependency._make_repo.return.external_repo_d_url_r", "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": 50, "span_ids": ["RepoDependency.__init__", "RepoDependency.repo_pair", "imports", "RepoDependency._make_repo", "RepoDependency.__str__", "RepoDependency._parse_path", "RepoDependency", "RepoDependency.is_in_repo"], "tokens": 302}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 dvc.exceptions import OutputNotFoundError\nfrom dvc.path_info import PathInfo\n\nfrom .local import LocalDependency\n\n\nclass RepoDependency(LocalDependency):\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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_RepoDependency._get_checksum_RepoDependency._get_checksum.with_self__make_repo_lock.try_.except_OutputNotFoundErro.return.tree_get_file_hash_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/repo.py_RepoDependency._get_checksum_RepoDependency._get_checksum.with_self__make_repo_lock.try_.except_OutputNotFoundErro.return.tree_get_file_hash_path_", "embedding": null, "metadata": {"file_path": "dvc/dependency/repo.py", "file_name": "repo.py", "file_type": "text/x-python", "category": "implementation", "start_line": 52, "end_line": 68, "span_ids": ["RepoDependency._get_checksum"], "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 RepoDependency(LocalDependency):\n\n def _get_checksum(self, locked=True):\n from dvc.repo.tree import RepoTree\n\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\n # we want stream but not fetch, so DVC out directories are\n # walked, but dir contents is not fetched\n tree = RepoTree(repo, stream=True)\n\n # We are polluting our repo cache with some dir listing here\n if tree.isdir(path):\n return self.repo.cache.local.get_hash(path, tree=tree)\n return tree.get_file_hash(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/dependency/repo.py_RepoDependency.status_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/repo.py_RepoDependency.status_", "embedding": null, "metadata": {"file_path": "dvc/dependency/repo.py", "file_name": "repo.py", "file_type": "text/x-python", "category": "implementation", "start_line": 70, "end_line": 101, "span_ids": ["RepoDependency.save", "RepoDependency.dumpd", "RepoDependency.download", "RepoDependency.status", "RepoDependency.update"], "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 RepoDependency(LocalDependency):\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.get_rev()\n\n cache = self.repo.cache.local\n with repo.use_cache(cache):\n _, _, cache_infos = repo.fetch_external([self.def_path])\n cache.checkout(to.path_info, cache_infos[0])\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.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/dvcfile.py_SingleStageFile_SingleStageFile.remove_stage.self_remove_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dvcfile.py_SingleStageFile_SingleStageFile.remove_stage.self_remove_", "embedding": null, "metadata": {"file_path": "dvc/dvcfile.py", "file_name": "dvcfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 119, "end_line": 145, "span_ids": ["SingleStageFile", "SingleStageFile.stage", "SingleStageFile.stages", "SingleStageFile.dump", "SingleStageFile.remove_stage"], "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 SingleStageFile(FileMixin):\n from dvc.schema import COMPILED_SINGLE_STAGE_SCHEMA as SCHEMA\n\n @property\n def stage(self):\n data, raw = self._load()\n return SingleStageLoader.load_stage(self, data, raw)\n\n @property\n def stages(self):\n data, raw = self._load()\n return SingleStageLoader(self, data, raw)\n\n def dump(self, stage, **kwargs):\n \"\"\"Dumps given stage appropriately in the dvcfile.\"\"\"\n from dvc.stage import PipelineStage\n\n assert not isinstance(stage, PipelineStage)\n check_dvc_filename(self.path)\n logger.debug(\n \"Saving information to '{file}'.\".format(file=relpath(self.path))\n )\n dump_yaml(self.path, serialize.to_single_stage_file(stage))\n self.repo.scm.track_file(self.relpath)\n\n def remove_stage(self, stage): # pylint: disable=unused-argument\n self.remove()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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___f_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___f_file_", "embedding": null, "metadata": {"file_path": "dvc/exceptions.py", "file_name": "exceptions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 79, "end_line": 104, "span_ids": ["ArgumentDuplicationError", "ArgumentDuplicationError.__init__", "CircularDependencyError", "CircularDependencyError.__init__"], "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 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 = \"'{}' is specified as an output and as a dependency.\"\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__(f\"file '{path}' is specified more than 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/exceptions.py_NotDvcRepoError_DvcIgnoreInCollectedDirError.__init__.super___init___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_NotDvcRepoError_DvcIgnoreInCollectedDirError.__init__.super___init___", "embedding": null, "metadata": {"file_path": "dvc/exceptions.py", "file_name": "exceptions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 125, "end_line": 238, "span_ids": ["FileMissingError.__init__", "DvcIgnoreInCollectedDirError.__init__", "ETagMismatchError.__init__", "BadMetricError", "FileMissingError", "ConfirmRemoveError", "NoPlotsError", "YAMLFileCorruptedError", "RecursiveAddingWhileUsingFilename.__init__", "DvcIgnoreInCollectedDirError", "YAMLFileCorruptedError.__init__", "NotDvcRepoError", "ETagMismatchError", "RecursiveAddingWhileUsingFilename", "CyclicGraphError", "ConfirmRemoveError.__init__", "InitError", "DvcParserError.__init__", "ReproductionError.__init__", "NoPlotsError.__init__", "CheckoutErrorSuggestGit.__init__", "OverlappingOutputPathsError.__init__", "OverlappingOutputPathsError", "BadMetricError.__init__", "NoMetricsError.__init__", "CheckoutErrorSuggestGit", "DvcParserError", "CyclicGraphError.__init__", "NoMetricsError", "ReproductionError"], "tokens": 753}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 msg = \"Pipeline has a cycle involving: {}.\".format(\n \", \".join(s.addressing for s in 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. 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__(f\"failed to reproduce '{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(f\"'{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. Use `-m/-M` options for \"\n \"`dvc run` to mark stage outputs as metrics.\"\n )\n\n\nclass NoPlotsError(DvcException):\n def __init__(self):\n super().__init__(\n \"no plots in this repository. Use `--plots/--plots-no-cache` \"\n \"options for `dvc run` to mark stage outputs as plots.\"\n )\n\n\nclass YAMLFileCorruptedError(DvcException):\n def __init__(self, path):\n path = relpath(path)\n super().__init__(\n f\"unable to read: '{path}', YAML file structure is corrupted\"\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__(f\"Did you mean `git checkout {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, hint=None):\n self.path = path\n hint = \"\" if hint is None else f\". {hint}\"\n super().__init__(\n f\"Can't find '{path}' neither locally nor on remote{hint}\"\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 )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_GitHookAlreadyExistsError_HTTPError.__init__.super___init___f_code": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_GitHookAlreadyExistsError_HTTPError.__init__.super___init___f_code", "embedding": null, "metadata": {"file_path": "dvc/exceptions.py", "file_name": "exceptions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 241, "end_line": 299, "span_ids": ["NoOutputInExternalRepoError", "GitHookAlreadyExistsError", "DownloadError.__init__", "HTTPError.__init__", "UploadError", "NoRemoteInExternalRepoError.__init__", "DownloadError", "GitHookAlreadyExistsError.__init__", "UploadError.__init__", "CheckoutError.__init__", "NoRemoteInExternalRepoError", "NoOutputInExternalRepoError.__init__", "CollectCacheError", "HTTPError", "CheckoutError"], "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 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 )\n\n\nclass DownloadError(DvcException):\n def __init__(self, amount):\n self.amount = amount\n\n super().__init__(f\"{amount} files failed to download\")\n\n\nclass UploadError(DvcException):\n def __init__(self, amount):\n self.amount = amount\n\n super().__init__(f\"{amount} files failed to upload\")\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 f\"No DVC remote is specified in target repository '{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__(f\"'{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.dvc_only.dvc_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.dvc_only.dvc_only", "embedding": null, "metadata": {"file_path": "dvc/exceptions.py", "file_name": "exceptions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 302, "end_line": 315, "span_ids": ["PathMissingError", "PathMissingError.__init__"], "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 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_dvc_only = (\n \"The path '{}' does not exist in the target repository '{}'\"\n \" as an DVC output.\"\n )\n\n def __init__(self, path, repo, dvc_only=False):\n msg = self.default_msg if not dvc_only else self.default_msg_dvc_only\n super().__init__(msg.format(path, repo))\n self.dvc_only = dvc_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/external_repo.py_BaseExternalRepo.fetch_external_BaseExternalRepo.fetch_external.return.sum_download_results_fa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py_BaseExternalRepo.fetch_external_BaseExternalRepo.fetch_external.return.sum_download_results_fa", "embedding": null, "metadata": {"file_path": "dvc/external_repo.py", "file_name": "external_repo.py", "file_type": "text/x-python", "category": "implementation", "start_line": 107, "end_line": 136, "span_ids": ["BaseExternalRepo.fetch_external"], "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 BaseExternalRepo:\n\n def fetch_external(self, paths: Iterable, **kwargs):\n \"\"\"Fetch specified external repo paths into cache.\n\n Returns 3-tuple in the form\n (downloaded, failed, list(cache_infos))\n where cache_infos can be used as checkout targets for the\n fetched paths.\n \"\"\"\n download_results = []\n failed = 0\n\n paths = [PathInfo(self.root_dir) / path for path in paths]\n\n def download_update(result):\n download_results.append(result)\n\n save_infos = []\n for path in paths:\n if not self.repo_tree.exists(path):\n raise PathMissingError(path, self.url)\n save_info = self.local_cache.save(\n path,\n self.repo_tree,\n None,\n save_link=False,\n download_callback=download_update,\n )\n save_infos.append(save_info)\n\n return sum(download_results), failed, save_infos", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_BaseExternalRepo.get_external_BaseExternalRepo.get_external.if_self_local_cache_.else_.self_repo_tree_copytree_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py_BaseExternalRepo.get_external_BaseExternalRepo.get_external.if_self_local_cache_.else_.self_repo_tree_copytree_p", "embedding": null, "metadata": {"file_path": "dvc/external_repo.py", "file_name": "external_repo.py", "file_type": "text/x-python", "category": "implementation", "start_line": 138, "end_line": 150, "span_ids": ["BaseExternalRepo.get_external"], "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": "class BaseExternalRepo:\n\n def get_external(self, path, dest):\n \"\"\"Convenience wrapper for fetch_external and checkout.\"\"\"\n if self.local_cache:\n # fetch DVC and git files to tmpdir cache, then checkout\n _, _, save_infos = self.fetch_external([path])\n self.local_cache.checkout(PathInfo(dest), save_infos[0])\n else:\n # git-only erepo with no cache, just copy files directly\n # to dest\n path = PathInfo(self.root_dir) / path\n if not self.repo_tree.exists(path):\n raise PathMissingError(path, self.url)\n self.repo_tree.copytree(path, 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/external_repo.py_ExternalRepo_ExternalRepo._set_cache_dir.self._local_cache.self_cache_local": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py_ExternalRepo_ExternalRepo._set_cache_dir.self._local_cache.self_cache_local", "embedding": null, "metadata": {"file_path": "dvc/external_repo.py", "file_name": "external_repo.py", "file_type": "text/x-python", "category": "implementation", "start_line": 153, "end_line": 172, "span_ids": ["ExternalRepo", "ExternalRepo.__init__", "ExternalRepo._set_cache_dir"], "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 ExternalRepo(Repo, BaseExternalRepo):\n def __init__(self, root_dir, url, rev, for_write=False):\n if for_write:\n super().__init__(root_dir)\n else:\n root_dir = os.path.realpath(root_dir)\n super().__init__(root_dir, scm=Git(root_dir), rev=rev)\n self.url = url\n self._set_cache_dir()\n self._fix_upstream()\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\n self._local_cache = self.cache.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/dvc/ignore.py_logging_DvcIgnore.__call__.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_logging_DvcIgnore.__call__.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "dvc/ignore.py", "file_name": "ignore.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 22, "span_ids": ["imports", "DvcIgnore", "DvcIgnore.__call__"], "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": "import logging\nimport os\nimport re\nfrom itertools import groupby\n\nfrom funcy import cached_property\nfrom pathspec.patterns import GitWildMatchPattern\nfrom pathspec.util import normalize_file\n\nfrom dvc.path_info import PathInfo\nfrom dvc.scm.tree import BaseTree\nfrom dvc.system import System\nfrom dvc.utils import relpath\n\nlogger = logging.getLogger(__name__)\n\n\nclass DvcIgnore:\n DVCIGNORE_FILE = \".dvcignore\"\n\n def __call__(self, root, dirs, files):\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/ignore.py_DvcIgnorePatterns_DvcIgnorePatterns.__call__.return.dirs_files": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_DvcIgnorePatterns_DvcIgnorePatterns.__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": 25, "end_line": 49, "span_ids": ["DvcIgnorePatterns.__init__", "DvcIgnorePatterns.__call__", "DvcIgnorePatterns"], "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 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 path_spec_lines = fobj.readlines()\n regex_pattern_list = map(\n GitWildMatchPattern.pattern_to_regex, path_spec_lines\n )\n self.ignore_spec = [\n (ignore, re.compile(\"|\".join(item[0] for item in group)))\n for ignore, group in groupby(\n regex_pattern_list, lambda x: x[1]\n )\n if ignore is not None\n ]\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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_addLoggingLevel.setattr_logging_methodNa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py__Manages_logging_config_addLoggingLevel.setattr_logging_methodNa", "embedding": null, "metadata": {"file_path": "dvc/logger.py", "file_name": "logger.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 46, "span_ids": ["addLoggingLevel", "docstring"], "tokens": 309}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\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\ndef addLoggingLevel(levelName, levelNum, methodName=None):\n \"\"\"\n Adds a new logging level to the `logging` module and the\n currently configured logging class.\n\n Based on https://stackoverflow.com/questions/2183233\n \"\"\"\n if methodName is None:\n methodName = levelName.lower()\n\n assert not hasattr(logging, levelName)\n assert not hasattr(logging, methodName)\n assert not hasattr(logging.getLoggerClass(), methodName)\n\n def logForLevel(self, message, *args, **kwargs):\n if self.isEnabledFor(levelNum):\n # pylint: disable=protected-access\n self._log(levelNum, message, args, **kwargs)\n\n def logToRoot(message, *args, **kwargs):\n logging.log(levelNum, message, *args, **kwargs)\n\n logging.addLevelName(levelNum, levelName)\n setattr(logging, levelName, levelNum)\n setattr(logging.getLoggerClass(), methodName, logForLevel)\n setattr(logging, methodName, logToRoot)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_LoggingException_ColorFormatter.color_code._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py_LoggingException_ColorFormatter.color_code._", "embedding": null, "metadata": {"file_path": "dvc/logger.py", "file_name": "logger.py", "file_type": "text/x-python", "category": "implementation", "start_line": 48, "end_line": 80, "span_ids": ["LoggingException.__init__", "ColorFormatter", "excludeFilter", "LoggingException"], "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 LoggingException(Exception):\n def __init__(self, record):\n msg = \"failed to log {}\".format(str(record))\n super().__init__(msg)\n\n\ndef excludeFilter(level):\n class ExcludeLevelFilter(logging.Filter):\n def filter(self, record):\n return record.levelno < level\n\n return ExcludeLevelFilter\n\n\nclass 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 \"TRACE\": colorama.Fore.GREEN,\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/output/__init__.py_from_collections_import_d_None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/__init__.py_from_collections_import_d_None_4", "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": 60, "span_ids": ["imports"], "tokens": 467}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\nfrom urllib.parse import urlparse\n\nfrom funcy import collecting, project\nfrom voluptuous import And, Any, Coerce, Length, Lower, Required, SetTo\n\nfrom dvc.output.base import BaseOutput\nfrom dvc.output.gs import GSOutput\nfrom dvc.output.hdfs import HDFSOutput\nfrom dvc.output.local import LocalOutput\nfrom dvc.output.s3 import S3Output\nfrom dvc.output.ssh import SSHOutput\nfrom dvc.remote import get_remote\nfrom dvc.remote.hdfs import HDFSRemoteTree\nfrom dvc.remote.local import LocalRemoteTree\nfrom dvc.remote.s3 import S3RemoteTree\nfrom dvc.scheme import Schemes\n\nOUTS = [\n HDFSOutput,\n S3Output,\n GSOutput,\n SSHOutput,\n # NOTE: LocalOutput is the default choice\n]\n\nOUTS_MAP = {\n Schemes.HDFS: HDFSOutput,\n Schemes.S3: S3Output,\n Schemes.GS: GSOutput,\n Schemes.SSH: SSHOutput,\n Schemes.LOCAL: LocalOutput,\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 LocalRemoteTree.PARAM_CHECKSUM: CHECKSUM_SCHEMA,\n S3RemoteTree.PARAM_CHECKSUM: CHECKSUM_SCHEMA,\n HDFSRemoteTree.PARAM_CHECKSUM: CHECKSUM_SCHEMA,\n}\n\nSCHEMA = CHECKSUMS_SCHEMA.copy()\nSCHEMA[Required(BaseOutput.PARAM_PATH)] = str\nSCHEMA[BaseOutput.PARAM_CACHE] = bool\nSCHEMA[BaseOutput.PARAM_METRIC] = BaseOutput.METRIC_SCHEMA\nSCHEMA[BaseOutput.PARAM_PLOT] = bool\nSCHEMA[BaseOutput.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/__init__.py_loadd_from_loadd_from.return.ret": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/__init__.py_loadd_from_loadd_from.return.ret", "embedding": null, "metadata": {"file_path": "dvc/output/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 105, "end_line": 124, "span_ids": ["loadd_from"], "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 loadd_from(stage, d_list):\n ret = []\n for d in d_list:\n p = d.pop(BaseOutput.PARAM_PATH)\n cache = d.pop(BaseOutput.PARAM_CACHE, True)\n metric = d.pop(BaseOutput.PARAM_METRIC, False)\n plot = d.pop(BaseOutput.PARAM_PLOT, False)\n persist = d.pop(BaseOutput.PARAM_PERSIST, False)\n ret.append(\n _get(\n stage,\n p,\n info=d,\n cache=cache,\n metric=metric,\n plot=plot,\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/__init__.py_loads_from__merge_data.return.d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/__init__.py_loads_from__merge_data.return.d", "embedding": null, "metadata": {"file_path": "dvc/output/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 127, "end_line": 163, "span_ids": ["_split_dict", "loads_from", "_merge_data"], "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": "def loads_from(\n stage, s_list, use_cache=True, metric=False, plot=False, persist=False\n):\n return [\n _get(\n stage,\n s,\n info={},\n cache=use_cache,\n metric=metric,\n plot=plot,\n persist=persist,\n )\n for s in s_list\n ]\n\n\ndef _split_dict(d, keys):\n return project(d, keys), project(d, d.keys() - keys)\n\n\ndef _merge_data(s_list):\n d = defaultdict(dict)\n for key in s_list:\n if isinstance(key, str):\n d[key].update({})\n continue\n if not isinstance(key, dict):\n raise ValueError(f\"'{type(key).__name__}' not supported.\")\n\n for k, flags in key.items():\n if not isinstance(flags, dict):\n raise ValueError(\n f\"Expected dict for '{k}', got: '{type(flags).__name__}'\"\n )\n d[k].update(flags)\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/output/__init__.py_load_from_pipeline_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/__init__.py_load_from_pipeline_", "embedding": null, "metadata": {"file_path": "dvc/output/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 166, "end_line": 184, "span_ids": ["load_from_pipeline"], "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": "@collecting\ndef load_from_pipeline(stage, s_list, typ=\"outs\"):\n if typ not in (stage.PARAM_OUTS, stage.PARAM_METRICS, stage.PARAM_PLOTS):\n raise ValueError(f\"'{typ}' key is not allowed for pipeline files.\")\n\n metric = typ == stage.PARAM_METRICS\n plot = typ == stage.PARAM_PLOTS\n\n d = _merge_data(s_list)\n\n for path, flags in d.items():\n plt_d = {}\n if plot:\n from dvc.schema import PLOT_PROPS\n\n plt_d, flags = _split_dict(flags, keys=PLOT_PROPS.keys())\n extra = project(flags, [\"cache\", \"persist\"])\n yield _get(stage, path, {}, plot=plt_d or plot, metric=metric, **extra)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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___f_Stage_": {"__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___f_Stage_", "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": 44, "span_ids": ["OutputIsNotFileOrDirError.__init__", "OutputIsStageFileError", "imports", "OutputDoesNotExistError.__init__", "OutputIsNotFileOrDirError", "OutputDoesNotExistError", "OutputAlreadyTrackedError.__init__", "OutputAlreadyTrackedError", "OutputIsStageFileError.__init__"], "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": "import logging\nimport os\nfrom copy import copy\nfrom urllib.parse import urlparse\n\nfrom voluptuous import Any\n\nimport dvc.prompt as prompt\nfrom dvc.cache import NamedCache\nfrom dvc.exceptions import (\n CollectCacheError,\n DvcException,\n RemoteCacheRequiredError,\n)\nfrom dvc.remote.base import BaseRemoteTree, Remote\n\nlogger = logging.getLogger(__name__)\n\n\nclass OutputDoesNotExistError(DvcException):\n def __init__(self, path):\n msg = f\"output '{path}' does not exist\"\n super().__init__(msg)\n\n\nclass OutputIsNotFileOrDirError(DvcException):\n def __init__(self, path):\n msg = f\"output '{path}' is not a file or directory\"\n super().__init__(msg)\n\n\nclass OutputAlreadyTrackedError(DvcException):\n def __init__(self, path):\n msg = f\"\"\" output '{path}' is already tracked by SCM (e.g. Git).\n You can remove it from Git, then add to DVC.\n To stop tracking from Git:\n git rm -r --cached '{path}'\n git commit -m \"stop tracking {path}\" \"\"\"\n super().__init__(msg)\n\n\nclass OutputIsStageFileError(DvcException):\n def __init__(self, path):\n super().__init__(f\"Stage file '{path}' cannot be an 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/output/base.py_BaseOutput.verify_metric_BaseOutput.get_dir_cache.return.self_dir_cache": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_BaseOutput.verify_metric_BaseOutput.get_dir_cache.return.self_dir_cache", "embedding": null, "metadata": {"file_path": "dvc/output/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 315, "end_line": 387, "span_ids": ["BaseOutput.download", "BaseOutput.verify_metric", "BaseOutput.get_dir_cache", "BaseOutput.move", "BaseOutput.checkout", "BaseOutput.get_files_number", "BaseOutput.unprotect", "BaseOutput.remove"], "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": "class BaseOutput:\n\n def verify_metric(self):\n raise DvcException(f\"verify metric is not supported for {self.scheme}\")\n\n def download(self, to):\n self.remote.tree.download(self.path_info, to.path_info)\n\n def checkout(\n self,\n force=False,\n progress_callback=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 return self.cache.checkout(\n self.path_info,\n self.info,\n force=force,\n progress_callback=progress_callback,\n relink=relink,\n filter_info=filter_info,\n )\n\n def remove(self, ignore_remove=False):\n self.remote.tree.remove(self.path_info)\n if self.scheme != \"local\":\n return\n\n if ignore_remove:\n self.ignore_remove()\n\n def move(self, out):\n # pylint: disable=no-member\n if self.scheme == \"local\" and self.use_scm_ignore:\n self.repo.scm.ignore_remove(self.fspath)\n\n self.remote.tree.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.tree.unprotect(self.path_info)\n\n def get_dir_cache(self, **kwargs):\n if not self.is_dir_checksum:\n raise DvcException(\"cannot get dir cache for file checksum\")\n if self.cache.changed_cache_file(self.checksum):\n self.repo.cloud.pull(\n NamedCache.make(\"local\", self.checksum, str(self)),\n show_checksums=False,\n **kwargs,\n )\n return self.dir_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/base.py_BaseOutput.collect_used_dir_cache_BaseOutput.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_BaseOutput.collect_used_dir_cache_BaseOutput.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": 389, "end_line": 448, "span_ids": ["BaseOutput.collect_used_dir_cache"], "tokens": 433}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseOutput:\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 try:\n self.get_dir_cache(jobs=jobs, remote=remote)\n except DvcException:\n logger.debug(f\"failed to pull cache for '{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.tree.PARAM_CHECKSUM]\n entry_relpath = entry[self.remote.tree.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_LocalOutput._parse_path.return.self_TREE_CLS_PATH_CLS_ab": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/local.py_logging_LocalOutput._parse_path.return.self_TREE_CLS_PATH_CLS_ab", "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": 42, "span_ids": ["imports", "LocalOutput.__init__", "LocalOutput", "LocalOutput._parse_path"], "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": "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 BaseOutput\nfrom dvc.remote.local import LocalRemote, LocalRemoteTree\nfrom dvc.utils import relpath\nfrom dvc.utils.fs import path_isin\n\nlogger = logging.getLogger(__name__)\n\n\nclass LocalOutput(BaseOutput):\n REMOTE_CLS = LocalRemote\n TREE_CLS = LocalRemoteTree\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.TREE_CLS.PATH_CLS(path)\n if self.stage and not p.is_absolute():\n p = self.stage.wdir / p\n\n abs_p = os.path.abspath(os.path.normpath(p))\n return self.TREE_CLS.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/output/local.py_LocalOutput.__str___LocalOutput.dumpd.return.ret": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/local.py_LocalOutput.__str___LocalOutput.dumpd.return.ret", "embedding": null, "metadata": {"file_path": "dvc/output/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 44, "end_line": 72, "span_ids": ["LocalOutput.fspath", "LocalOutput.is_in_repo", "LocalOutput.dumpd", "LocalOutput.__str__"], "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 LocalOutput(BaseOutput):\n\n def __str__(self):\n if not self.repo or 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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_LocalOutput.verify_metric_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/local.py_LocalOutput.verify_metric_", "embedding": null, "metadata": {"file_path": "dvc/output/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 74, "end_line": 90, "span_ids": ["LocalOutput.verify_metric"], "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 LocalOutput(BaseOutput):\n\n def verify_metric(self):\n if not self.metric or self.plot:\n return\n\n path = os.fspath(self.path_info)\n if not os.path.exists(path):\n return\n\n name = \"metrics\" if self.metric else \"plot\"\n if os.path.isdir(path):\n msg = \"directory '{}' cannot be used as {}.\"\n raise IsADirectoryError(msg.format(self.path_info, name))\n\n if not istextfile(path):\n msg = \"binary file '{}' cannot be used as {}.\"\n raise DvcException(msg.format(self.path_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/path_info.py_WindowsPathInfo__URLPathParents.__repr__.return.f_self_src_parents_": {"__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.f_self_src_parents_", "embedding": null, "metadata": {"file_path": "dvc/path_info.py", "file_name": "path_info.py", "file_type": "text/x-python", "category": "implementation", "start_line": 75, "end_line": 102, "span_ids": ["_URLPathInfo:2", "_URLPathInfo.__str__", "_URLPathParents.__getitem__", "_URLPathInfo", "_URLPathParents", "_URLPathParents.__repr__", "WindowsPathInfo", "PosixPathInfo", "_URLPathParents.__len__", "_URLPathParents.__init__"], "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 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:\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 f\"<{self.src}.parents>\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_hashlib_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_hashlib_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": 530}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 itertools\nimport json\nimport logging\nimport tempfile\nfrom concurrent.futures import ThreadPoolExecutor, as_completed\nfrom copy import copy\nfrom functools import partial, wraps\nfrom multiprocessing import cpu_count\nfrom operator import itemgetter\nfrom urllib.parse import urlparse\n\nfrom shortuuid import uuid\n\nimport dvc.prompt as prompt\nfrom dvc.exceptions import (\n CheckoutError,\n ConfirmRemoveError,\n DvcException,\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 makedirs, move\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 = f\"{action} is not supported for {scheme} remotes\"\n super().__init__(m)\n\n\nclass RemoteMissingDepsError(DvcException):\n pass\n\n\nclass DirCacheError(DvcException):\n def __init__(self, hash_):\n super().__init__(\n f\"Failed to load dir cache for hash value: '{hash_}'.\"\n )\n\n\ndef index_locked(f):\n @wraps(f)\n def wrapper(obj, named_cache, remote, *args, **kwargs):\n if hasattr(remote, \"index\"):\n with remote.index:\n return f(obj, named_cache, remote, *args, **kwargs)\n return f(obj, named_cache, remote, *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_Remote.hashes_exist_Remote.hashes_exist.return.list_indexed_hashes_li": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_Remote.hashes_exist_Remote.hashes_exist.return.list_indexed_hashes_li", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 760, "end_line": 845, "span_ids": ["Remote.hashes_exist"], "tokens": 793}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Remote:\n\n def hashes_exist(self, hashes, jobs=None, name=None):\n \"\"\"Check if the given hashes 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 hashes. 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 hash, run the `exists`\n method and filter the hashes 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 hashes_exist (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(hashes). 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 hash.\n\n Returns:\n A list with hashes that were found in the remote\n \"\"\"\n # Remotes which do not use traverse prefix should override\n # hashes_exist() (see ssh, local)\n assert self.tree.TRAVERSE_PREFIX_LEN >= 2\n\n hashes = set(hashes)\n indexed_hashes = set(self.index.intersection(hashes))\n hashes -= indexed_hashes\n logger.debug(\"Matched '{}' indexed hashes\".format(len(indexed_hashes)))\n if not hashes:\n return indexed_hashes\n\n if len(hashes) == 1 or not self.tree.CAN_TRAVERSE:\n remote_hashes = self.tree.list_hashes_exists(hashes, jobs, name)\n return list(indexed_hashes) + remote_hashes\n\n # Max remote size allowed for us to use traverse method\n remote_size, remote_hashes = self.tree.estimate_remote_size(\n hashes, name\n )\n\n traverse_pages = remote_size / self.tree.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(hashes) is at least 10k~100k\n if remote_size > self.tree.TRAVERSE_THRESHOLD_SIZE:\n traverse_weight = (\n traverse_pages * self.tree.TRAVERSE_WEIGHT_MULTIPLIER\n )\n else:\n traverse_weight = traverse_pages\n if len(hashes) < traverse_weight:\n logger.debug(\n \"Large remote ('{}' hashes < '{}' traverse weight), \"\n \"using object_exists for remaining hashes\".format(\n len(hashes), traverse_weight\n )\n )\n return (\n list(indexed_hashes)\n + list(hashes & remote_hashes)\n + self.tree.list_hashes_exists(\n hashes - remote_hashes, jobs, name\n )\n )\n\n logger.debug(\"Querying '{}' hashes via traverse\".format(len(hashes)))\n remote_hashes = set(\n self.tree.list_hashes_traverse(\n remote_size, remote_hashes, jobs, name\n )\n )\n return list(indexed_hashes) + list(hashes & set(remote_hashes))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_Remote.gc_Remote.gc.return.removed": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_Remote.gc_Remote.gc.return.removed", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 172, "end_line": 200, "span_ids": ["Remote.gc"], "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 Remote:\n\n @classmethod\n @index_locked\n def gc(cls, named_cache, remote, jobs=None):\n tree = remote.tree\n used = set(named_cache.scheme_keys(\"local\"))\n\n if tree.scheme != \"\":\n used.update(named_cache.scheme_keys(tree.scheme))\n\n removed = False\n # hashes must be sorted to ensure we always remove .dir files first\n for hash_ in sorted(\n tree.all(jobs, str(tree.path_info)),\n key=tree.is_dir_hash,\n reverse=True,\n ):\n if hash_ in used:\n continue\n path_info = tree.hash_to_path_info(hash_)\n if tree.is_dir_hash(hash_):\n # backward compatibility\n # pylint: disable=protected-access\n tree._remove_unpacked_dir(hash_)\n tree.remove(path_info)\n removed = True\n\n if removed and hasattr(remote, \"index\"):\n remote.index.clear()\n return removed", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_CloudCache_CloudCache.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_CloudCache_CloudCache.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": 892, "end_line": 954, "span_ids": ["CloudCache.scheme", "CloudCache", "CloudCache.__init__", "CloudCache.cache", "CloudCache.get_hash", "CloudCache.get_dir_cache", "CloudCache.path_info", "CloudCache.is_dir_hash", "CloudCache.open", "CloudCache.hash_to_path", "CloudCache.state", "CloudCache.hash_to_path_info"], "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": "class CloudCache:\n \"\"\"Cloud cache class.\"\"\"\n\n DEFAULT_CACHE_TYPES = [\"copy\"]\n CACHE_MODE = BaseRemoteTree.CACHE_MODE\n\n def __init__(self, tree):\n self.tree = tree\n self.repo = tree.repo\n\n self.cache_types = tree.config.get(\"type\") or copy(\n self.DEFAULT_CACHE_TYPES\n )\n self.cache_type_confirmed = False\n self._dir_info = {}\n\n @property\n def path_info(self):\n return self.tree.path_info\n\n @property\n def cache(self):\n return getattr(self.repo.cache, self.scheme)\n\n @property\n def scheme(self):\n return self.tree.scheme\n\n @property\n def state(self):\n return self.tree.state\n\n def open(self, *args, **kwargs):\n return self.tree.open(*args, **kwargs)\n\n def is_dir_hash(self, hash_):\n return self.tree.is_dir_hash(hash_)\n\n def get_hash(self, path_info, **kwargs):\n return self.tree.get_hash(path_info, **kwargs)\n\n # Override to return path as a string instead of PathInfo for clouds\n # which support string paths (see local)\n def hash_to_path(self, hash_):\n return self.hash_to_path_info(hash_)\n\n def hash_to_path_info(self, hash_):\n return self.tree.hash_to_path_info(hash_)\n\n def get_dir_cache(self, hash_):\n assert hash_\n\n dir_info = self._dir_info.get(hash_)\n if dir_info:\n return dir_info\n\n try:\n dir_info = self.load_dir_cache(hash_)\n except DirCacheError:\n dir_info = []\n\n self._dir_info[hash_] = 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_CloudCache.load_dir_cache_CloudCache.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_CloudCache.load_dir_cache_CloudCache.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": 956, "end_line": 981, "span_ids": ["CloudCache.load_dir_cache"], "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 CloudCache:\n\n def load_dir_cache(self, hash_):\n path_info = self.hash_to_path_info(hash_)\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(hash_) 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.tree.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 relpath = info[self.tree.PARAM_RELPATH]\n info[self.tree.PARAM_RELPATH] = relpath.replace(\n \"/\", self.tree.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_CloudCache.changed_CloudCache.changed.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_CloudCache.changed_CloudCache.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": 983, "end_line": 1028, "span_ids": ["CloudCache.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 CloudCache:\n\n def changed(self, path_info, hash_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 hash: 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, hash_info\n )\n\n if not self.tree.exists(path_info):\n logger.debug(\"'%s' doesn't exist.\", path_info)\n return True\n\n hash_ = hash_info.get(self.tree.PARAM_CHECKSUM)\n if hash_ is None:\n logger.debug(\"hash value for '%s' is missing.\", path_info)\n return True\n\n if self.changed_cache(hash_):\n logger.debug(\"cache for '%s'('%s') has changed.\", path_info, hash_)\n return True\n\n actual = self.get_hash(path_info)\n if hash_ != actual:\n logger.debug(\n \"hash value '%s' for '%s' has changed (actual '%s').\",\n hash_,\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_CloudCache.link_CloudCache._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_CloudCache.link_CloudCache._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": 1015, "end_line": 1034, "span_ids": ["CloudCache.link", "CloudCache._verify_link", "CloudCache._link"], "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 CloudCache:\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.tree.isfile(from_info)\n\n self.tree.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.tree, f\"is_{link_type}\", None)\n if is_link and not is_link(path_info):\n self.tree.remove(path_info)\n raise DvcException(f\"failed to verify {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_CloudCache._try_links_CloudCache._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_CloudCache._try_links_CloudCache._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": 1036, "end_line": 1061, "span_ids": ["CloudCache._try_links", "CloudCache._do_link"], "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": "class CloudCache:\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.tree, 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.tree.exists(to_info):\n raise DvcException(f\"Link '{to_info}' already exists!\")\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_CloudCache._save_file_CloudCache._save_file.return._self_tree_PARAM_CHECKSUM": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_CloudCache._save_file_CloudCache._save_file.return._self_tree_PARAM_CHECKSUM", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1078, "end_line": 1115, "span_ids": ["CloudCache._save_file"], "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": "class CloudCache:\n\n def _save_file(self, path_info, tree, hash_, save_link=True, **kwargs):\n assert hash_\n\n cache_info = self.hash_to_path_info(hash_)\n if tree == self.tree:\n if self.changed_cache(hash_):\n self.tree.move(path_info, cache_info, mode=self.CACHE_MODE)\n self.link(cache_info, path_info)\n elif self.tree.iscopy(path_info) and self._cache_is_copy(\n path_info\n ):\n # Default relink procedure involves unneeded copy\n self.tree.unprotect(path_info)\n else:\n self.tree.remove(path_info)\n self.link(cache_info, path_info)\n\n if save_link:\n self.state.save_link(path_info)\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, hash_)\n else:\n if self.changed_cache(hash_):\n with tree.open(path_info, mode=\"rb\") as fobj:\n # if tree has fetch enabled, DVC out will be fetched on\n # open and we do not need to read/copy any data\n if not (\n tree.isdvc(path_info, strict=False) and tree.fetch\n ):\n self.tree.copy_fobj(fobj, cache_info)\n callback = kwargs.get(\"download_callback\")\n if callback:\n callback(1)\n\n self.state.save(cache_info, hash_)\n return {self.tree.PARAM_CHECKSUM: hash_}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_CloudCache._cache_is_copy_CloudCache._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_CloudCache._cache_is_copy_CloudCache._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": 1117, "end_line": 1137, "span_ids": ["CloudCache._cache_is_copy"], "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 CloudCache:\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.tree.exists(test_cache_file):\n with self.tree.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.tree.remove(workspace_file)\n self.tree.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_CloudCache._save_dir_CloudCache._save_dir.return._self_tree_PARAM_CHECKSUM": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_CloudCache._save_dir_CloudCache._save_dir.return._self_tree_PARAM_CHECKSUM", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1139, "end_line": 1157, "span_ids": ["CloudCache._save_dir"], "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 CloudCache:\n\n def _save_dir(self, path_info, tree, hash_, save_link=True, **kwargs):\n dir_info = self.get_dir_cache(hash_)\n for entry in Tqdm(\n dir_info, desc=\"Saving \" + path_info.name, unit=\"file\"\n ):\n entry_info = path_info / entry[self.tree.PARAM_RELPATH]\n entry_hash = entry[self.tree.PARAM_CHECKSUM]\n self._save_file(\n entry_info, tree, entry_hash, save_link=False, **kwargs\n )\n\n if save_link:\n self.state.save_link(path_info)\n if self.tree.exists(path_info):\n self.state.save(path_info, hash_)\n\n cache_info = self.hash_to_path_info(hash_)\n self.state.save(cache_info, hash_)\n return {self.tree.PARAM_CHECKSUM: hash_}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_CloudCache.changed_cache_file_CloudCache.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_CloudCache.changed_cache_file_CloudCache.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": 1178, "end_line": 1217, "span_ids": ["CloudCache.changed_cache_file"], "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": "class CloudCache:\n\n def changed_cache_file(self, hash_):\n \"\"\"Compare the given hash with the (corresponding) actual one.\n\n - Use `State` as a cache for computed hashes\n + The entries are invalidated by taking into account the following:\n * mtime\n * inode\n * size\n * hash\n\n - Remove the file from cache if it doesn't match the actual hash\n \"\"\"\n # Prefer string path over PathInfo when possible due to performance\n cache_info = self.hash_to_path(hash_)\n if self.tree.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_hash(cache_info)\n\n logger.debug(\n \"cache '%s' expected '%s' actual '%s'\", cache_info, hash_, actual,\n )\n\n if not hash_ or not actual:\n return True\n\n if actual.split(\".\")[0] == hash_.split(\".\")[0]:\n # making cache file read-only so we don't need to check it\n # next time\n self.tree.protect(cache_info)\n return False\n\n if self.tree.exists(cache_info):\n logger.warning(\"corrupted cache file '%s'.\", cache_info)\n self.tree.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_CloudCache._changed_dir_cache_CloudCache.safe_remove.self_tree_remove_path_inf": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_CloudCache._changed_dir_cache_CloudCache.safe_remove.self_tree_remove_path_inf", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1219, "end_line": 1264, "span_ids": ["CloudCache.changed_cache", "CloudCache._changed_dir_cache", "CloudCache.safe_remove", "CloudCache.already_cached"], "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": "class CloudCache:\n\n def _changed_dir_cache(self, hash_, path_info=None, filter_info=None):\n if self.changed_cache_file(hash_):\n return True\n\n for entry in self.get_dir_cache(hash_):\n entry_hash = entry[self.tree.PARAM_CHECKSUM]\n\n if path_info and filter_info:\n entry_info = path_info / entry[self.tree.PARAM_RELPATH]\n if not entry_info.isin_or_eq(filter_info):\n continue\n\n if self.changed_cache_file(entry_hash):\n return True\n\n return False\n\n def changed_cache(self, hash_, path_info=None, filter_info=None):\n if self.is_dir_hash(hash_):\n return self._changed_dir_cache(\n hash_, path_info=path_info, filter_info=filter_info\n )\n return self.changed_cache_file(hash_)\n\n def already_cached(self, path_info):\n current = self.get_hash(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.tree.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.tree.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/base.py_CloudCache._checkout_file_CloudCache._checkout_file.return.added_modified_and_not_r": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_CloudCache._checkout_file_CloudCache._checkout_file.return.added_modified_and_not_r", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1266, "end_line": 1283, "span_ids": ["CloudCache._checkout_file"], "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 CloudCache:\n\n def _checkout_file(\n self, path_info, hash_, 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.hash_to_path_info(hash_)\n if self.tree.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, hash_)\n if progress_callback:\n progress_callback(str(path_info))\n\n return added, modified and not relink", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_CloudCache._checkout_dir_CloudCache._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_CloudCache._checkout_dir_CloudCache._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": 1285, "end_line": 1344, "span_ids": ["CloudCache._remove_redundant_files", "CloudCache._checkout_dir"], "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 CloudCache:\n\n def _checkout_dir(\n self,\n path_info,\n hash_,\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.tree.exists(path_info):\n added = True\n self.tree.makedirs(path_info)\n\n dir_info = self.get_dir_cache(hash_)\n\n logger.debug(\"Linking directory '%s'.\", path_info)\n\n for entry in dir_info:\n relative_path = entry[self.tree.PARAM_RELPATH]\n entry_hash = entry[self.tree.PARAM_CHECKSUM]\n entry_cache_info = self.hash_to_path_info(entry_hash)\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_hash_info = {self.tree.PARAM_CHECKSUM: entry_hash}\n if relink or self.changed(entry_info, entry_hash_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_hash)\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, hash_)\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.tree.walk_files(path_info))\n\n needed_files = {\n path_info / entry[self.tree.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_CloudCache.checkout_CloudCache.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_CloudCache.checkout_CloudCache.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": 1346, "end_line": 1398, "span_ids": ["CloudCache.checkout"], "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": "class CloudCache:\n\n def checkout(\n self,\n path_info,\n hash_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 hash_ = hash_info.get(self.tree.PARAM_CHECKSUM)\n failed = None\n skip = False\n if not hash_:\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, hash_info):\n logger.debug(\"Data '%s' didn't change.\", path_info)\n skip = True\n\n elif self.changed_cache(\n hash_, path_info=path_info, filter_info=filter_info\n ):\n logger.warning(\n \"Cache '%s' not found. File '%s' won't be created.\",\n hash_,\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(self.path_info, hash_, filter_info),\n )\n if failed:\n raise CheckoutError([failed])\n return\n\n logger.debug(\"Checking out '%s' with cache '%s'.\", path_info, hash_)\n\n return self._checkout(\n path_info, hash_, 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/base.py_CloudCache._checkout_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_CloudCache._checkout_", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1400, "end_line": 1434, "span_ids": ["CloudCache._checkout", "CloudCache.get_files_number"], "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 CloudCache:\n\n def _checkout(\n self,\n path_info,\n hash_,\n force=False,\n progress_callback=None,\n relink=False,\n filter_info=None,\n ):\n if not self.is_dir_hash(hash_):\n return self._checkout_file(\n path_info, hash_, force, progress_callback, relink\n )\n\n return self._checkout_dir(\n path_info, hash_, force, progress_callback, relink, filter_info\n )\n\n def get_files_number(self, path_info, hash_, filter_info):\n from funcy.py3 import ilen\n\n if not hash_:\n return 0\n\n if not self.is_dir_hash(hash_):\n return 1\n\n if not filter_info:\n return len(self.get_dir_cache(hash_))\n\n return ilen(\n filter_info.isin_or_eq(path_info / entry[self.tree.PARAM_CHECKSUM])\n for entry in self.get_dir_cache(hash_)\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__log_exceptions_LocalRemote.INDEX_CLS.RemoteIndexNoop": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py__log_exceptions_LocalRemote.INDEX_CLS.RemoteIndexNoop", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 28, "end_line": 50, "span_ids": ["LocalRemote", "_log_exceptions"], "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 _log_exceptions(func, operation):\n @wraps(func)\n def wrapper(from_info, to_info, *args, **kwargs):\n try:\n func(from_info, to_info, *args, **kwargs)\n return 0\n except Exception as exc: # pylint: disable=broad-except\n # NOTE: this means we ran out of file descriptors and there is no\n # reason to try to proceed, as we will hit this error anyways.\n # pylint: disable=no-member\n if isinstance(exc, OSError) and exc.errno == errno.EMFILE:\n raise\n\n logger.exception(\n \"failed to %s '%s' to '%s'\", operation, from_info, to_info\n )\n return 1\n\n return wrapper\n\n\nclass LocalRemote(Remote):\n INDEX_CLS = RemoteIndexNoop", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_LocalCache_LocalCache.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_LocalCache_LocalCache.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": 349, "end_line": 426, "span_ids": ["LocalCache.cache_dir", "LocalCache.already_cached", "LocalCache.__init__", "LocalCache._verify_link", "LocalCache.supported", "LocalCache", "LocalCache.hash_to_path", "LocalCache.cache_path", "LocalCache.hashes_exist", "LocalCache.status", "LocalCache.cache_dir_1"], "tokens": 522}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LocalCache(CloudCache):\n DEFAULT_CACHE_TYPES = [\"reflink\", \"copy\"]\n CACHE_MODE = LocalRemoteTree.CACHE_MODE\n\n def __init__(self, tree):\n super().__init__(tree)\n self.cache_dir = tree.config.get(\"url\")\n\n @property\n def cache_dir(self):\n return self.tree.path_info.fspath if self.tree.path_info else None\n\n @cache_dir.setter\n def cache_dir(self, value):\n self.tree.path_info = PathInfo(value) if value else None\n\n @classmethod\n def supported(cls, config): # pylint: disable=unused-argument\n return True\n\n @cached_property\n def cache_path(self):\n return os.path.abspath(self.cache_dir)\n\n def hash_to_path(self, hash_):\n # NOTE: `self.cache_path` is already normalized so we can simply use\n # `os.sep` instead of `os.path.join`. This results in this helper\n # being ~5.5 times faster.\n return f\"{self.cache_path}{os.sep}{hash_[0:2]}{os.sep}{hash_[2:]}\"\n\n def hashes_exist(\n self, hashes, jobs=None, name=None\n ): # pylint: disable=unused-argument\n return [\n hash_\n for hash_ in Tqdm(\n hashes,\n unit=\"file\",\n desc=\"Querying \"\n + (\"cache in \" + name if name else \"local cache\"),\n )\n if not self.changed_cache_file(hash_)\n ]\n\n def already_cached(self, path_info):\n assert path_info.scheme in [\"\", \"local\"]\n\n current_md5 = self.get_hash(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.tree.getsize(path_info) == 0:\n return\n\n super()._verify_link(path_info, link_type)\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_LocalCache._status_LocalCache._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_LocalCache._status_LocalCache._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": 428, "end_line": 474, "span_ids": ["LocalCache._status"], "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": "class LocalCache(CloudCache):\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_contents).\n\n dir_status_info contains status for .dir files, file_status_info\n contains status for all other files, and dir_contents is a dict of\n {dir_hash: set(file_hash, ...)} which can be used to map\n a .dir file to its file contents.\n \"\"\"\n logger.debug(f\"Preparing to collect status from {remote.path_info}\")\n md5s = set(named_cache.scheme_keys(self.scheme))\n\n logger.debug(\"Collecting information from local cache...\")\n local_exists = frozenset(\n self.hashes_exist(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_hashes(named_cache, remote, dir_md5s)\n )\n md5s.difference_update(remote_exists)\n if md5s:\n remote_exists.update(\n remote.hashes_exist(\n md5s, jobs=jobs, name=str(remote.path_info)\n )\n )\n return self._make_status(\n named_cache, 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_LocalCache._make_status_LocalCache._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_LocalCache._make_status_LocalCache._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": 476, "end_line": 502, "span_ids": ["LocalCache._make_status"], "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": "class LocalCache(CloudCache):\n\n def _make_status(\n self, named_cache, show_checksums, local_exists, remote_exists\n ):\n def make_names(hash_, names):\n return {\"name\": hash_ if show_checksums else \" \".join(names)}\n\n dir_status = {}\n file_status = {}\n dir_contents = {}\n for hash_, item in named_cache[self.scheme].items():\n if item.children:\n dir_status[hash_] = make_names(hash_, item.names)\n dir_contents[hash_] = set()\n for child_hash, child in item.children.items():\n file_status[child_hash] = make_names(\n child_hash, child.names\n )\n dir_contents[hash_].add(child_hash)\n else:\n file_status[hash_] = make_names(hash_, 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_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/local.py_LocalCache._indexed_dir_hashes_LocalCache._indexed_dir_hashes.for_dir_hash_in_dir_exist.yield_from_file_hashes": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_LocalCache._indexed_dir_hashes_LocalCache._indexed_dir_hashes.for_dir_hash_in_dir_exist.yield_from_file_hashes", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 504, "end_line": 539, "span_ids": ["LocalCache._indexed_dir_hashes"], "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": "class LocalCache(CloudCache):\n\n def _indexed_dir_hashes(self, named_cache, remote, dir_md5s):\n # Validate our index by verifying all indexed .dir hashes\n # still exist on the remote\n indexed_dirs = set(remote.index.dir_hashes())\n indexed_dir_exists = set()\n if indexed_dirs:\n indexed_dir_exists.update(\n remote.tree.list_hashes_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 hashes '{}', \"\n \"clearing remote index\".format(\", \".join(missing_dirs))\n )\n remote.index.clear()\n\n # Check if non-indexed (new) dir hashes exist on remote\n dir_exists = dir_md5s.intersection(indexed_dir_exists)\n dir_exists.update(\n remote.tree.list_hashes_exists(dir_md5s - dir_exists)\n )\n\n # If .dir hash exists on the remote, assume directory contents\n # still exists on the remote\n for dir_hash in dir_exists:\n file_hashes = list(named_cache.child_keys(self.scheme, dir_hash))\n if dir_hash not in remote.index:\n logger.debug(\n \"Indexing new .dir '{}' with '{}' nested files\".format(\n dir_hash, len(file_hashes)\n )\n )\n remote.index.update([dir_hash], file_hashes)\n yield dir_hash\n yield from file_hashes", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_LocalCache._fill_statuses_LocalCache._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_LocalCache._fill_statuses_LocalCache._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": 541, "end_line": 572, "span_ids": ["LocalCache._fill_statuses", "LocalCache._get_plans"], "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": "class LocalCache(CloudCache):\n\n @staticmethod\n def _fill_statuses(hash_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 hash_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 hashes = []\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.hash_to_path_info(md5))\n path_infos.append(remote.hash_to_path_info(md5))\n names.append(info[\"name\"])\n hashes.append(md5)\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, hashes", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_LocalCache._process_LocalCache._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_LocalCache._process_LocalCache._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": 574, "end_line": 677, "span_ids": ["LocalCache._process"], "tokens": 696}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LocalCache(CloudCache):\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 _log_exceptions(remote.tree.download, \"download\"),\n dir_mode=self.tree.dir_mode,\n file_mode=self.tree.file_mode,\n )\n status = STATUS_DELETED\n desc = \"Downloading\"\n else:\n func = _log_exceptions(remote.tree.upload, \"upload\")\n status = STATUS_NEW\n desc = \"Uploading\"\n\n if jobs is None:\n jobs = remote.tree.JOBS\n\n dir_status, file_status, dir_contents = 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 total = len(dir_plans[0]) + len(file_plans[0])\n if total == 0:\n return 0\n\n with Tqdm(total=total, unit=\"file\", desc=desc) as pbar:\n func = pbar.wrap_fn(func)\n with ThreadPoolExecutor(max_workers=jobs) as executor:\n if download:\n from_infos, to_infos, names, _ = (\n d + f for d, f in zip(dir_plans, file_plans)\n )\n fails = sum(\n executor.map(func, from_infos, to_infos, names)\n )\n else:\n # for uploads, push files first, and any .dir files last\n\n file_futures = {}\n for from_info, to_info, name, hash_ in zip(*file_plans):\n file_futures[hash_] = executor.submit(\n func, from_info, to_info, name\n )\n dir_futures = {}\n for from_info, to_info, name, dir_hash in zip(*dir_plans):\n wait_futures = {\n future\n for file_hash, future in file_futures.items()\n if file_hash in dir_contents[dir_hash]\n }\n dir_futures[dir_hash] = 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 dir_hash, future in dir_futures.items():\n if future.result() == 0:\n file_hashes = dir_contents[dir_hash]\n logger.debug(\n \"Indexing pushed dir '{}' with \"\n \"'{}' nested files\".format(dir_hash, len(file_hashes))\n )\n remote.index.update([dir_hash], file_hashes)\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_LocalCache._dir_upload_LocalCache._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_LocalCache._dir_upload_LocalCache._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": 676, "end_line": 688, "span_ids": ["LocalCache._dir_upload"], "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 LocalCache(CloudCache):\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(f\"failed to upload '{from_info}' to '{to_info}'\")\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_LocalCache.push_LocalCache.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_LocalCache.push_LocalCache.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": 690, "end_line": 708, "span_ids": ["LocalCache.push", "LocalCache.pull"], "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 LocalCache(CloudCache):\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_LocalCache._log_missing_caches_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_LocalCache._log_missing_caches_", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 710, "end_line": 727, "span_ids": ["LocalCache._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 LocalCache(CloudCache):\n\n @staticmethod\n def _log_missing_caches(hash_info_dict):\n missing_caches = [\n (md5, info)\n for md5, info in hash_info_dict.items()\n if info[\"status\"] == STATUS_MISSING\n ]\n if missing_caches:\n missing_desc = \"\\n\".join(\n \"name: {}, 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:\\n{}\".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_logging_locked.return.wrapper": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_logging_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": 41, "span_ids": ["locked", "imports"], "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 logging\nimport os\nfrom contextlib import contextmanager\nfrom functools import wraps\n\nfrom funcy import cached_property, cat, first\n\nfrom dvc.config import Config\nfrom dvc.dvcfile import PIPELINE_FILE, Dvcfile, is_valid_filename\nfrom dvc.exceptions import FileMissingError\nfrom dvc.exceptions import IsADirectoryError as DvcIsADirectoryError\nfrom dvc.exceptions import (\n NoOutputOrStageError,\n NotDvcRepoError,\n OutputNotFoundError,\n)\nfrom dvc.ignore import CleanTree\nfrom dvc.path_info import PathInfo\nfrom dvc.repo.tree import RepoTree\nfrom dvc.scm.tree import is_working_tree\nfrom dvc.utils.fs import path_isin\n\nfrom ..stage.exceptions import StageFileDoesNotExistError, StageNotFound\nfrom ..utils import parse_target\nfrom .graph import check_acyclic, get_pipeline, get_pipelines\n\nlogger = logging.getLogger(__name__)\n\n\ndef locked(f):\n @wraps(f)\n def wrapper(repo, *args, **kwargs):\n with repo.lock, repo.state:\n # pylint: disable=protected-access\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.f_self___class_____name_": {"__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.f_self___class_____name_", "embedding": null, "metadata": {"file_path": "dvc/repo/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 44, "end_line": 150, "span_ids": ["Repo.tree_1", "Repo.__repr__", "Repo", "Repo.tree", "Repo.__init__"], "tokens": 855}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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:\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.freeze import freeze, unfreeze\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, scm=None, rev=None):\n from dvc.state import State, StateNoop\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.plots import Plots\n from dvc.repo.params import Params\n from dvc.scm.tree import WorkingTree\n from dvc.utils.fs import makedirs\n from dvc.stage.cache import StageCache\n\n if scm:\n # use GitTree instead of WorkingTree as default repo tree instance\n tree = scm.get_tree(rev)\n self.root_dir = self.find_root(root_dir, tree)\n self.scm = scm\n self.tree = tree\n self.state = StateNoop()\n else:\n root_dir = self.find_root(root_dir)\n self.root_dir = os.path.abspath(os.path.realpath(root_dir))\n\n self.dvc_dir = os.path.join(self.root_dir, self.DVC_DIR)\n self.config = Config(self.dvc_dir)\n\n if not scm:\n no_scm = self.config[\"core\"].get(\"no_scm\", False)\n self.scm = SCM(self.root_dir, no_scm=no_scm)\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.tmp_dir, \"lock\"),\n tmp_dir=self.tmp_dir,\n hardlink_lock=hardlink_lock,\n friendly=True,\n )\n\n self.cache = Cache(self)\n self.cloud = DataCloud(self)\n\n if not scm:\n # NOTE: storing state and link_state in the repository itself to\n # avoid any possible state corruption in 'shared cache dir'\n # scenario.\n self.state = State(self.cache.local)\n\n self.stage_cache = StageCache(self)\n\n self.metrics = Metrics(self)\n self.plots = Plots(self)\n self.params = Params(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 if is_working_tree(tree) or tree.tree_root == self.root_dir:\n root = None\n else:\n root = self.root_dir\n self._tree = (\n tree if isinstance(tree, CleanTree) else CleanTree(tree, root)\n )\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 f\"{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_dvc_dir_Repo.get_stages.return.list_dvcfile_stages_value": {"__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.get_stages.return.list_dvcfile_stages_value", "embedding": null, "metadata": {"file_path": "dvc/repo/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 177, "end_line": 217, "span_ids": ["Repo.find_dvc_dir", "Repo._ignore", "Repo.unprotect", "Repo.init", "Repo.get_stages", "Repo.get_stage"], "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": "class Repo:\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.tree.unprotect(PathInfo(target))\n\n def _ignore(self):\n flist = [self.config.files[\"local\"], self.tmp_dir]\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)\n\n def get_stage(self, path=None, name=None):\n if not path:\n path = PIPELINE_FILE\n logger.debug(\"Assuming '%s' to be a stage inside '%s'\", name, path)\n\n dvcfile = Dvcfile(self, path)\n return dvcfile.stages[name]\n\n def get_stages(self, path=None, name=None):\n if not path:\n path = PIPELINE_FILE\n logger.debug(\"Assuming '%s' to be a stage inside '%s'\", name, path)\n\n if name:\n return [self.get_stage(path, name)]\n\n dvcfile = Dvcfile(self, path)\n return list(dvcfile.stages.values())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_from_default_dvcfile.if_dvcfile_exists_.return.dvcfile_stages_get_target": {"__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_from_default_dvcfile.if_dvcfile_exists_.return.dvcfile_stages_get_target", "embedding": null, "metadata": {"file_path": "dvc/repo/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 236, "end_line": 272, "span_ids": ["Repo._collect_inside", "Repo._collect_from_default_dvcfile", "Repo._collect_pipeline", "Repo.collect"], "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": "class Repo:\n\n def _collect_inside(self, path, graph):\n import networkx as nx\n\n stages = nx.dfs_postorder_nodes(graph)\n return [stage for stage in stages if path_isin(stage.path, path)]\n\n def collect(\n self, target=None, with_deps=False, recursive=False, graph=None\n ):\n if not target:\n return list(graph) if graph else self.stages\n\n if recursive and os.path.isdir(target):\n return self._collect_inside(\n os.path.abspath(target), graph or self.graph\n )\n\n path, name = parse_target(target)\n stages = self.get_stages(path, name)\n if not with_deps:\n return stages\n\n res = set()\n for stage in stages:\n res.update(self._collect_pipeline(stage, graph=graph))\n return res\n\n def _collect_pipeline(self, stage, graph=None):\n import networkx as nx\n\n pipeline = get_pipeline(get_pipelines(graph or self.graph), stage)\n return nx.dfs_postorder_nodes(pipeline, stage)\n\n def _collect_from_default_dvcfile(self, target):\n dvcfile = Dvcfile(self, PIPELINE_FILE)\n if dvcfile.exists():\n return dvcfile.stages.get(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/__init__.py_Repo.collect_granular_Repo.collect_granular.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.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": 274, "end_line": 328, "span_ids": ["Repo.collect_granular"], "tokens": 467}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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:\n\n def collect_granular(\n self, target=None, with_deps=False, recursive=False, graph=None\n ):\n \"\"\"\n Priority is in the order of following in case of ambiguity:\n - .dvc file or .yaml file\n - dir if recursive and directory exists\n - stage_name\n - output file\n \"\"\"\n if not target:\n return [(stage, None) for stage in self.stages]\n\n file, name = parse_target(target)\n stages = []\n\n # Optimization: do not collect the graph for a specific target\n if not file:\n # parsing is ambiguous when it does not have a colon\n # or if it's not a dvcfile, as it can be a stage name\n # in `dvc.yaml` or, an output in a stage.\n logger.debug(\n \"Checking if stage '%s' is in '%s'\", target, PIPELINE_FILE\n )\n if not (recursive and os.path.isdir(target)):\n stage = self._collect_from_default_dvcfile(target)\n if stage:\n stages = (\n self._collect_pipeline(stage) if with_deps else [stage]\n )\n elif not with_deps and is_valid_filename(file):\n stages = self.get_stages(file, name)\n\n if not stages:\n if not (recursive and os.path.isdir(target)):\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 pass\n\n try:\n stages = self.collect(target, with_deps, recursive, graph)\n except StageFileDoesNotExistError as exc:\n # collect() might try to use `target` as a stage name\n # and throw error that dvc.yaml does not exist, whereas it\n # should say that both stage name and file does not exist.\n if file and is_valid_filename(file):\n raise\n raise NoOutputOrStageError(target, exc.file) from exc\n except StageNotFound as exc:\n raise NoOutputOrStageError(target, exc.file) from exc\n\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.graph_Repo.stages.return.self__collect_stages_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.graph_Repo.stages.return.self__collect_stages_", "embedding": null, "metadata": {"file_path": "dvc/repo/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 497, "end_line": 516, "span_ids": ["Repo.graph", "Repo.stages", "Repo.pipelines"], "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:\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.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()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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.plot_templates_Repo._collect_stages.return.stages": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.plot_templates_Repo._collect_stages.return.stages", "embedding": null, "metadata": {"file_path": "dvc/repo/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 518, "end_line": 539, "span_ids": ["Repo.plot_templates", "Repo._collect_stages"], "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 Repo:\n\n @cached_property\n def plot_templates(self):\n from .plots.template import PlotTemplates\n\n return PlotTemplates(self.dvc_dir)\n\n def _collect_stages(self):\n stages = []\n outs = set()\n\n for root, dirs, files in self.tree.walk(self.root_dir):\n for file_name in filter(is_valid_filename, files):\n new_stages = self.get_stages(os.path.join(root, file_name))\n stages.extend(new_stages)\n outs.update(\n out.fspath\n for stage in new_stages\n for out in stage.outs\n if out.scheme == \"local\"\n )\n dirs[:] = [d for d in dirs if os.path.join(root, d) not in outs]\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/__init__.py_Repo.open_by_relpath_Repo.open_by_relpath.try_.except_IsADirectoryError_.raise_DvcIsADirectoryErro": {"__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.try_.except_IsADirectoryError_.raise_DvcIsADirectoryErro", "embedding": null, "metadata": {"file_path": "dvc/repo/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 573, "end_line": 591, "span_ids": ["Repo.open_by_relpath"], "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 Repo:\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\n tree = RepoTree(self, stream=True)\n path = os.path.join(self.root_dir, path)\n try:\n with self.state:\n with tree.open(\n os.path.join(self.root_dir, path),\n mode=mode,\n encoding=encoding,\n remote=remote,\n ) as fobj:\n yield fobj\n except FileNotFoundError as exc:\n raise FileMissingError(path) from exc\n except IsADirectoryError as exc:\n raise DvcIsADirectoryError(f\"'{path}' is a directory\") 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/repo/commit.py_from_dvc_import_prompt__prepare_message.return.msg_format_map_kw_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/commit.py_from_dvc_import_prompt__prepare_message.return.msg_format_map_kw_", "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": 27, "span_ids": ["imports", "_prepare_message"], "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 import prompt\nfrom dvc.dvcfile import Dvcfile\nfrom dvc.stage.exceptions import StageCommitError\n\nfrom . import locked\n\n\ndef _prepare_message(stage, changes):\n changed_deps, changed_outs, changed_stage = changes\n if changed_deps and changed_outs:\n msg = \"dependencies {deps} and outputs {outs} of {stage} changed.\"\n elif changed_deps:\n msg = \"dependencies {deps} of {stage} changed.\"\n elif changed_outs:\n msg = \"outputs {outs} of {stage} changed.\"\n else:\n msg = \"{stage_changed}\"\n\n msg += \" Are you sure you want to commit it?\"\n\n kw = {\n \"stage\": stage,\n \"deps\": changed_deps,\n \"outs\": changed_outs,\n \"stage_changed\": changed_stage,\n }\n return msg.format_map(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/repo/commit.py_prompt_to_commit_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/commit.py_prompt_to_commit_", "embedding": null, "metadata": {"file_path": "dvc/repo/commit.py", "file_name": "commit.py", "file_type": "text/x-python", "category": "implementation", "start_line": 30, "end_line": 50, "span_ids": ["commit", "prompt_to_commit"], "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 prompt_to_commit(stage, changes, force=False):\n if not (force or prompt.confirm(_prepare_message(stage, changes))):\n raise StageCommitError(\n \"unable to commit changed {}. Use `-f|--force` to \"\n \"force.\".format(stage)\n )\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 changes = stage.changed_entries()\n if any(changes):\n prompt_to_commit(stage, changes, force=force)\n stage.save()\n stage.commit()\n\n Dvcfile(self, stage.path).dump(stage)\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/diff.py_diff.if_self_scm_no_commits__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/diff.py_diff.if_self_scm_no_commits__", "embedding": null, "metadata": {"file_path": "dvc/repo/diff.py", "file_name": "diff.py", "file_type": "text/x-python", "category": "implementation", "start_line": 55, "end_line": 88, "span_ids": ["diff"], "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": "@locked\ndef diff(self, a_rev=\"HEAD\", b_rev=None):\n # ... other code\n\n if self.scm.no_commits:\n return {}\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 ret = {\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 }\n\n return ret if any(ret.values()) else {}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_len_used_run": {"__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_len_used_run", "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": 75, "span_ids": ["imports", "_fetch"], "tokens": 406}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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.config import NoRemoteError\nfrom dvc.exceptions import DownloadError\nfrom dvc.scm.base import CloneError\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 run_cache=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\n used_run_cache = self.stage_cache.pull(remote) if run_cache else []\n\n if isinstance(targets, str):\n targets = [targets]\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 used_run_cache=used_run_cache,\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 + len(used_run_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/fetch.py__fetch_external_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/fetch.py__fetch_external_", "embedding": null, "metadata": {"file_path": "dvc/repo/fetch.py", "file_name": "fetch.py", "file_type": "text/x-python", "category": "implementation", "start_line": 78, "end_line": 95, "span_ids": ["_fetch_external"], "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 _fetch_external(self, repo_url, repo_rev, files, jobs):\n from dvc.external_repo import external_repo\n\n failed, downloaded = 0, 0\n try:\n with external_repo(repo_url, repo_rev) as repo:\n with repo.use_cache(self.cache.local):\n d, f, _ = repo.fetch_external(files, jobs=jobs)\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/freeze.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/freeze.py__", "embedding": null, "metadata": {"file_path": "dvc/repo/freeze.py", "file_name": "freeze.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 22, "span_ids": ["imports", "freeze", "_set", "unfreeze"], "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": "from . import locked\n\n\n@locked\ndef _set(repo, target, frozen):\n from dvc.utils import parse_target\n\n path, name = parse_target(target)\n stage = repo.get_stage(path, name)\n stage.frozen = frozen\n stage.dvcfile.dump(stage, update_pipeline=True)\n\n return stage\n\n\ndef freeze(repo, target):\n return _set(repo, target, True)\n\n\ndef unfreeze(repo, target):\n return _set(repo, target, 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/metrics/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/__init__.py__", "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": 14, "span_ids": ["Metrics.show", "Metrics.diff", "Metrics", "Metrics.__init__"], "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": "class Metrics:\n def __init__(self, repo):\n self.repo = repo\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 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/plots/__init__.py_logging_PropsNotFoundError.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/__init__.py_logging_PropsNotFoundError.pass", "embedding": null, "metadata": {"file_path": "dvc/repo/plots/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 22, "span_ids": ["imports", "PropsNotFoundError", "NotAPlotError.__init__", "NotAPlotError"], "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": "import logging\n\nfrom funcy import first, project\n\nfrom dvc.exceptions import DvcException, NoPlotsError, OutputNotFoundError\nfrom dvc.repo.tree import RepoTree\nfrom dvc.schema import PLOT_PROPS\nfrom dvc.utils import relpath\n\nlogger = logging.getLogger(__name__)\n\n\nclass NotAPlotError(DvcException):\n def __init__(self, out):\n super().__init__(\n f\"'{out}' is not a known plot. Use `dvc plots modify` to turn it \"\n \"into one.\"\n )\n\n\nclass PropsNotFoundError(DvcException):\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/repo/plots/__init__.py_Plots_Plots.collect.return.data": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/__init__.py_Plots_Plots.collect.return.data", "embedding": null, "metadata": {"file_path": "dvc/repo/plots/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 24, "end_line": 62, "span_ids": ["Plots.__init__", "Plots.collect", "Plots"], "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": "class Plots:\n def __init__(self, repo):\n self.repo = repo\n\n def collect(self, targets=None, revs=None):\n \"\"\"Collects all props and data for plots.\n\n Returns a structure like:\n {rev: {plots.csv: {\n props: {x: ..., \"header\": ..., ...},\n data: \"...data as a string...\",\n }}}\n Data parsing is postponed, since it's affected by props.\n \"\"\"\n targets = [targets] if isinstance(targets, str) else targets or []\n data = {}\n for rev in self.repo.brancher(revs=revs):\n # .brancher() adds unwanted workspace\n if revs is not None and rev not in revs:\n continue\n rev = rev or \"workspace\"\n\n tree = RepoTree(self.repo)\n plots = _collect_plots(self.repo, targets, rev)\n for path_info, props in plots.items():\n datafile = relpath(path_info, self.repo.root_dir)\n if rev not in data:\n data[rev] = {}\n data[rev].update({datafile: {\"props\": props}})\n\n # Load data from git or dvc cache\n try:\n with tree.open(path_info) as fd:\n data[rev][datafile][\"data\"] = fd.read()\n except FileNotFoundError:\n # This might happen simply because cache is absent\n pass\n\n return 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/repo/plots/__init__.py_Plots.render_Plots.show.return.self_render_data_revs_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/__init__.py_Plots.render_Plots.show.return.self_render_data_revs_p", "embedding": null, "metadata": {"file_path": "dvc/repo/plots/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 64, "end_line": 92, "span_ids": ["Plots.show", "Plots.render"], "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": "class Plots:\n\n @staticmethod\n def render(data, revs=None, props=None, templates=None):\n \"\"\"Renders plots\"\"\"\n props = props or {}\n\n # Merge data by plot file and apply overriding props\n plots = _prepare_plots(data, revs, props)\n\n return {\n datafile: _render(datafile, desc[\"data\"], desc[\"props\"], templates)\n for datafile, desc in plots.items()\n }\n\n def show(self, targets=None, revs=None, props=None):\n from .data import NoMetricInHistoryError\n\n data = self.collect(targets, revs)\n\n # If any mentioned plot doesn't have any data then that's an error\n targets = [targets] if isinstance(targets, str) else targets or []\n for target in targets:\n if not any(\"data\" in d[target] for d in data.values()):\n raise NoMetricInHistoryError(target)\n\n # No data at all is a special error with a special message\n if not data:\n raise NoPlotsError()\n\n return self.render(data, revs, props, self.repo.plot_templates)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/plots/__init__.py_Plots.diff_Plots.modify.dvcfile_dump_out_stage_u": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/__init__.py_Plots.diff_Plots.modify.dvcfile_dump_out_stage_u", "embedding": null, "metadata": {"file_path": "dvc/repo/plots/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 94, "end_line": 138, "span_ids": ["Plots.modify", "Plots._unset", "Plots.diff"], "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": "class Plots:\n\n def diff(self, *args, **kwargs):\n from .diff import diff\n\n return diff(self.repo, *args, **kwargs)\n\n @staticmethod\n def _unset(out, props):\n missing = list(set(props) - set(out.plot.keys()))\n if missing:\n raise PropsNotFoundError(\n f\"display properties {missing} not found in plot '{out}'\"\n )\n\n for prop in props:\n out.plot.pop(prop)\n\n def modify(self, path, props=None, unset=None):\n from dvc.dvcfile import Dvcfile\n\n props = props or {}\n template = props.get(\"template\")\n if template:\n self.repo.plot_templates.get_template(template)\n\n (out,) = self.repo.find_outs_by_path(path)\n if not out.plot and unset is not None:\n raise NotAPlotError(out)\n\n # This out will become a plot unless it is one already\n if not isinstance(out.plot, dict):\n out.plot = {}\n\n if unset:\n self._unset(out, unset)\n\n out.plot.update(props)\n\n # Empty dict will move it to non-plots\n if not out.plot:\n out.plot = True\n\n out.verify_metric()\n\n dvcfile = Dvcfile(self.repo, out.stage.path)\n dvcfile.dump(out.stage, update_pipeline=True, no_lock=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/plots/__init__.py__collect_plots__plot_props.return.project_out_plot_PLOT_PR": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/__init__.py__collect_plots__plot_props.return.project_out_plot_PLOT_PR", "embedding": null, "metadata": {"file_path": "dvc/repo/plots/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 141, "end_line": 169, "span_ids": ["_plot_props", "_collect_plots"], "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 _collect_plots(repo, targets=None, rev=None):\n def _targets_to_outs(targets):\n for t in targets:\n try:\n (out,) = repo.find_outs_by_path(t)\n yield out\n except OutputNotFoundError:\n logger.warning(\n \"File '{}' was not found at: '{}'. It will not be \"\n \"plotted.\".format(t, rev)\n )\n\n if targets:\n outs = _targets_to_outs(targets)\n else:\n outs = (out for stage in repo.stages for out in stage.outs if out.plot)\n\n return {out.path_info: _plot_props(out) for out in outs}\n\n\ndef _plot_props(out):\n if not out.plot:\n raise NotAPlotError(out)\n if isinstance(out.plot, list):\n raise DvcException(\"Multiple plots per data file not supported.\")\n if isinstance(out.plot, bool):\n return {}\n\n return project(out.plot, PLOT_PROPS)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/plots/__init__.py__prepare_plots__prepare_plots.return.plots": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/__init__.py__prepare_plots__prepare_plots.return.plots", "embedding": null, "metadata": {"file_path": "dvc/repo/plots/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 172, "end_line": 208, "span_ids": ["_prepare_plots"], "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": "def _prepare_plots(data, revs, props):\n \"\"\"Groups data by plot file.\n\n Also resolves props conflicts between revs and applies global props.\n \"\"\"\n # we go in order revs are supplied on props conflict first ones win.\n revs = iter(data) if revs is None else revs\n\n plots, props_revs = {}, {}\n for rev in revs:\n # Asked for revision without data\n if rev not in data:\n continue\n\n for datafile, desc in data[rev].items():\n # props from command line overwrite plot props from out definition\n full_props = {**desc[\"props\"], **props}\n\n if datafile in plots:\n saved = plots[datafile]\n if saved[\"props\"] != full_props:\n logger.warning(\n f\"Inconsistent plot props for '{datafile}' in \"\n f\"'{props_revs[datafile]}' and '{rev}'. \"\n f\"Going to use ones from '{props_revs[datafile]}'\"\n )\n\n saved[\"data\"][rev] = desc[\"data\"]\n else:\n plots[datafile] = {\n \"props\": full_props,\n \"data\": {rev: desc[\"data\"]},\n }\n # Save rev we got props from\n props_revs[datafile] = rev\n\n return plots", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/plots/__init__.py__render_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/__init__.py__render_", "embedding": null, "metadata": {"file_path": "dvc/repo/plots/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 211, "end_line": 247, "span_ids": ["_render"], "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 _render(datafile, datas, props, templates):\n from .data import plot_data, PlotData\n\n # Copy it to not modify a passed value\n props = props.copy()\n\n # Add x and y to fields if set\n fields = props.get(\"fields\")\n if fields is not None:\n fields = {*fields, props.get(\"x\"), props.get(\"y\")} - {None}\n\n template = templates.load(props.get(\"template\") or \"default\")\n\n # If x is not set add index field\n if not props.get(\"x\") and template.has_anchor(\"x\"):\n props[\"append_index\"] = True\n props[\"x\"] = PlotData.INDEX_FIELD\n\n # Parse all data, preprocess it and collect as a list of dicts\n data = []\n for rev, datablob in datas.items():\n rev_data = plot_data(datafile, rev, datablob).to_datapoints(\n fields=fields,\n path=props.get(\"path\"),\n header=props.get(\"header\", True),\n append_index=props.get(\"append_index\", False),\n )\n data.extend(rev_data)\n\n # If y is not set then use last field not used yet\n if not props.get(\"y\") and template.has_anchor(\"y\"):\n fields = list(first(data))\n skip = (PlotData.REVISION_FIELD, props.get(\"x\"))\n props[\"y\"] = first(f for f in reversed(fields) if f not in skip)\n\n return template.render(data, props=props)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/plots/data.py_csv_plot_data.raise_PlotMetricTypeError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/data.py_csv_plot_data.raise_PlotMetricTypeError", "embedding": null, "metadata": {"file_path": "dvc/repo/plots/data.py", "file_name": "data.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 46, "span_ids": ["PlotMetricTypeError", "plot_data", "PlotMetricTypeError.__init__", "imports", "NoMetricInHistoryError", "PlotDataStructureError", "NoMetricInHistoryError.__init__", "PlotDataStructureError.__init__"], "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": "import csv\nimport io\nimport json\nimport os\nfrom collections import OrderedDict\nfrom copy import copy\n\nimport yaml\nfrom funcy import first\nfrom yaml import SafeLoader\n\nfrom dvc.exceptions import DvcException\n\n\nclass PlotMetricTypeError(DvcException):\n def __init__(self, file):\n super().__init__(\n \"'{}' - file type error\\n\"\n \"Only JSON, YAML, CSV and TSV formats are supported.\".format(file)\n )\n\n\nclass PlotDataStructureError(DvcException):\n def __init__(self):\n super().__init__(\n \"Plot data extraction failed. Please see \"\n \"https://man.dvc.org/plot for supported data formats.\"\n )\n\n\nclass NoMetricInHistoryError(DvcException):\n def __init__(self, path):\n super().__init__(f\"Could not find '{path}'.\")\n\n\ndef plot_data(filename, revision, content):\n _, extension = os.path.splitext(filename.lower())\n if extension == \".json\":\n return JSONPlotData(filename, revision, content)\n elif extension == \".csv\":\n return CSVPlotData(filename, revision, content)\n elif extension == \".tsv\":\n return CSVPlotData(filename, revision, content, delimiter=\"\\t\")\n elif extension == \".yaml\":\n return YAMLPlotData(filename, revision, content)\n raise PlotMetricTypeError(filename)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/plots/data.py__filter_fields__filter_fields.return.new_data": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/data.py__filter_fields__filter_fields.return.new_data", "embedding": null, "metadata": {"file_path": "dvc/repo/plots/data.py", "file_name": "data.py", "file_type": "text/x-python", "category": "implementation", "start_line": 49, "end_line": 70, "span_ids": ["_filter_fields"], "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 _filter_fields(data_points, filename, revision, fields=None, **kwargs):\n if not fields:\n return data_points\n assert isinstance(fields, set)\n\n new_data = []\n for data_point in data_points:\n new_dp = copy(data_point)\n\n keys = set(data_point.keys())\n if keys & fields != fields:\n raise DvcException(\n \"Could not find fields: '{}' for '{}' at '{}'.\".format(\n \", \".join(fields), filename, revision\n )\n )\n\n to_del = keys - fields\n for key in to_del:\n del new_dp[key]\n new_data.append(new_dp)\n return new_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/repo/plots/data.py__apply_path__apply_path.return.data_points": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/data.py__apply_path__apply_path.return.data_points", "embedding": null, "metadata": {"file_path": "dvc/repo/plots/data.py", "file_name": "data.py", "file_type": "text/x-python", "category": "implementation", "start_line": 73, "end_line": 98, "span_ids": ["_apply_path"], "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": "def _apply_path(data, path=None, **kwargs):\n if not path or not isinstance(data, dict):\n return data\n\n import jsonpath_ng\n\n found = jsonpath_ng.parse(path).find(data)\n first_datum = first(found)\n if (\n len(found) == 1\n and isinstance(first_datum.value, list)\n and isinstance(first(first_datum.value), dict)\n ):\n data_points = first_datum.value\n elif len(first_datum.path.fields) == 1:\n field_name = first(first_datum.path.fields)\n data_points = [{field_name: datum.value} for datum in found]\n else:\n raise PlotDataStructureError()\n\n if not isinstance(data_points, list) or not (\n isinstance(first(data_points), dict)\n ):\n raise PlotDataStructureError()\n\n return data_points", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/plots/data.py__lists__find_data.raise_PlotDataStructureEr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/data.py__lists__find_data.raise_PlotDataStructureEr", "embedding": null, "metadata": {"file_path": "dvc/repo/plots/data.py", "file_name": "data.py", "file_type": "text/x-python", "category": "implementation", "start_line": 101, "end_line": 121, "span_ids": ["_lists", "_find_data"], "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": "def _lists(dictionary):\n for _, value in dictionary.items():\n if isinstance(value, dict):\n yield from (_lists(value))\n elif isinstance(value, list):\n yield value\n\n\ndef _find_data(data, fields=None, **kwargs):\n if not isinstance(data, dict):\n return data\n\n if not fields:\n # just look for first list of dicts\n fields = set()\n\n for l in _lists(data):\n if all(isinstance(dp, dict) for dp in l):\n if set(first(l).keys()) & fields == fields:\n return l\n raise PlotDataStructureError()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/plots/data.py__append_index__append_revision.return.data_points": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/data.py__append_index__append_revision.return.data_points", "embedding": null, "metadata": {"file_path": "dvc/repo/plots/data.py", "file_name": "data.py", "file_type": "text/x-python", "category": "implementation", "start_line": 124, "end_line": 142, "span_ids": ["_append_index", "_append_revision"], "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 _append_index(data_points, append_index=False, **kwargs):\n if not append_index:\n return data_points\n\n if PlotData.INDEX_FIELD in first(data_points).keys():\n raise DvcException(\n \"Cannot append index. Field of same name ('{}') found in data. \"\n \"Use `-x` to specify x axis field.\".format(PlotData.INDEX_FIELD)\n )\n\n for index, data_point in enumerate(data_points):\n data_point[PlotData.INDEX_FIELD] = index\n return data_points\n\n\ndef _append_revision(data_points, revision, **kwargs):\n for data_point in data_points:\n data_point[PlotData.REVISION_FIELD] = revision\n return data_points", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/plots/data.py_PlotData_JSONPlotData._processors.return.__apply_path__find_data_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/data.py_PlotData_JSONPlotData._processors.return.__apply_path__find_data_", "embedding": null, "metadata": {"file_path": "dvc/repo/plots/data.py", "file_name": "data.py", "file_type": "text/x-python", "category": "implementation", "start_line": 145, "end_line": 176, "span_ids": ["PlotData.raw", "PlotData._processors", "JSONPlotData", "PlotData.__init__", "JSONPlotData.raw", "PlotData.to_datapoints", "PlotData", "JSONPlotData._processors"], "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 PlotData:\n REVISION_FIELD = \"rev\"\n INDEX_FIELD = \"index\"\n\n def __init__(self, filename, revision, content, **kwargs):\n self.filename = filename\n self.revision = revision\n self.content = content\n\n def raw(self, **kwargs):\n raise NotImplementedError\n\n def _processors(self):\n return [_filter_fields, _append_index, _append_revision]\n\n def to_datapoints(self, **kwargs):\n data = self.raw(**kwargs)\n\n for data_proc in self._processors():\n data = data_proc(\n data, filename=self.filename, revision=self.revision, **kwargs\n )\n return data\n\n\nclass JSONPlotData(PlotData):\n def raw(self, **kwargs):\n return json.loads(self.content, object_pairs_hook=OrderedDict)\n\n def _processors(self):\n parent_processors = super()._processors()\n return [_apply_path, _find_data] + parent_processors", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/plots/data.py_CSVPlotData_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/data.py_CSVPlotData_", "embedding": null, "metadata": {"file_path": "dvc/repo/plots/data.py", "file_name": "data.py", "file_type": "text/x-python", "category": "implementation", "start_line": 179, "end_line": 225, "span_ids": ["YAMLPlotData", "CSVPlotData.raw", "YAMLPlotData.raw", "YAMLPlotData._processors", "CSVPlotData", "CSVPlotData.__init__"], "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 CSVPlotData(PlotData):\n def __init__(self, filename, revision, content, delimiter=\",\"):\n super().__init__(filename, revision, content)\n self.delimiter = delimiter\n\n def raw(self, header=True, **kwargs): # pylint: disable=arguments-differ\n first_row = first(csv.reader(io.StringIO(self.content)))\n\n if header:\n reader = csv.DictReader(\n io.StringIO(self.content), delimiter=self.delimiter,\n )\n else:\n reader = csv.DictReader(\n io.StringIO(self.content),\n delimiter=self.delimiter,\n fieldnames=[str(i) for i in range(len(first_row))],\n )\n\n fieldnames = reader.fieldnames\n data = list(reader)\n\n return [\n OrderedDict([(field, data_point[field]) for field in fieldnames])\n for data_point in data\n ]\n\n\nclass YAMLPlotData(PlotData):\n def raw(self, **kwargs):\n class OrderedLoader(SafeLoader):\n pass\n\n def construct_mapping(loader, node):\n loader.flatten_mapping(node)\n return OrderedDict(loader.construct_pairs(node))\n\n OrderedLoader.add_constructor(\n yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG, construct_mapping\n )\n\n return yaml.load(self.content, OrderedLoader)\n\n def _processors(self):\n parent_processors = super()._processors()\n return [_find_data] + parent_processors", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/plots/diff.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/diff.py__", "embedding": null, "metadata": {"file_path": "dvc/repo/plots/diff.py", "file_name": "diff.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 14, "span_ids": ["_revisions", "diff"], "tokens": 100}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _revisions(revs, is_dirty):\n revisions = revs or []\n if len(revisions) <= 1:\n if len(revisions) == 0 and is_dirty:\n revisions.append(\"HEAD\")\n revisions.append(\"workspace\")\n return revisions\n\n\ndef diff(repo, *args, revs=None, **kwargs):\n return repo.plots.show(\n *args, revs=_revisions(revs, repo.scm.is_dirty()), **kwargs\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/plots/template.py_json_NoFieldInDataError.__init__.super___init___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/template.py_json_NoFieldInDataError.__init__.super___init___", "embedding": null, "metadata": {"file_path": "dvc/repo/plots/template.py", "file_name": "template.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 23, "span_ids": ["TemplateNotFoundError.__init__", "TemplateNotFoundError", "imports", "BadTemplateError", "NoFieldInDataError.__init__", "NoFieldInDataError"], "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": "import json\nimport os\n\nfrom funcy import cached_property\n\nfrom dvc.exceptions import DvcException\nfrom dvc.utils.fs import makedirs\n\n\nclass TemplateNotFoundError(DvcException):\n def __init__(self, path):\n super().__init__(f\"Template '{path}' not found.\")\n\n\nclass BadTemplateError(DvcException):\n pass\n\n\nclass NoFieldInDataError(DvcException):\n def __init__(self, field_name):\n super().__init__(\n f\"Field '{field_name}' does not exist in provided 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/repo/plots/template.py_Template_Template.render.return.content": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/template.py_Template_Template.render.return.content", "embedding": null, "metadata": {"file_path": "dvc/repo/plots/template.py", "file_name": "template.py", "file_type": "text/x-python", "category": "implementation", "start_line": 26, "end_line": 58, "span_ids": ["Template", "Template.render", "Template.__init__"], "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": "class Template:\n INDENT = 4\n SEPARATORS = (\",\", \": \")\n EXTENSION = \".json\"\n ANCHOR = \"\"\n\n DEFAULT_CONTENT = None\n DEFAULT_NAME = None\n\n def __init__(self, content=None, name=None):\n self.content = self.DEFAULT_CONTENT if content is None else content\n self.name = name or self.DEFAULT_NAME\n assert self.content and self.name\n self.filename = self.name + self.EXTENSION\n\n def render(self, data, props=None):\n props = props or {}\n\n if self._anchor_str(\"data\") not in self.content:\n anchor = self.anchor(\"data\")\n raise BadTemplateError(\n f\"Template '{self.filename}' is not using '{anchor}' anchor\"\n )\n\n if props.get(\"x\"):\n Template._check_field_exists(data, props.get(\"x\"))\n if props.get(\"y\"):\n Template._check_field_exists(data, props.get(\"y\"))\n\n content = self._fill_anchor(self.content, \"data\", data)\n content = self._fill_metadata(content, props)\n\n return 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/dvc/repo/plots/template.py_Template.anchor_Template._check_field_exists.if_not_any_field_in_row_f.raise_NoFieldInDataError_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/template.py_Template.anchor_Template._check_field_exists.if_not_any_field_in_row_f.raise_NoFieldInDataError_", "embedding": null, "metadata": {"file_path": "dvc/repo/plots/template.py", "file_name": "template.py", "file_type": "text/x-python", "category": "implementation", "start_line": 56, "end_line": 91, "span_ids": ["Template.has_anchor", "Template._fill_metadata", "Template._fill_anchor", "Template._check_field_exists", "Template._anchor_str", "Template.anchor"], "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 Template:\n\n @classmethod\n def anchor(cls, name):\n return cls.ANCHOR.format(name.upper())\n\n def has_anchor(self, name):\n return self._anchor_str(name) in self.content\n\n @classmethod\n def _fill_anchor(cls, content, name, value):\n value_str = json.dumps(\n value, indent=cls.INDENT, separators=cls.SEPARATORS, sort_keys=True\n )\n return content.replace(cls._anchor_str(name), value_str)\n\n @classmethod\n def _anchor_str(cls, name):\n return '\"{}\"'.format(cls.anchor(name))\n\n @classmethod\n def _fill_metadata(cls, content, props):\n props.setdefault(\"title\", \"\")\n props.setdefault(\"x_label\", props.get(\"x\"))\n props.setdefault(\"y_label\", props.get(\"y\"))\n\n names = [\"title\", \"x\", \"y\", \"x_label\", \"y_label\"]\n for name in names:\n value = props.get(name)\n if value is not None:\n content = cls._fill_anchor(content, name, value)\n\n return content\n\n @staticmethod\n def _check_field_exists(data, field):\n if not any(field in row for row in data):\n raise NoFieldInDataError(field)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/plots/template.py_DefaultLinearTemplate_DefaultLinearTemplate.DEFAULT_CONTENT._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/template.py_DefaultLinearTemplate_DefaultLinearTemplate.DEFAULT_CONTENT._", "embedding": null, "metadata": {"file_path": "dvc/repo/plots/template.py", "file_name": "template.py", "file_type": "text/x-python", "category": "implementation", "start_line": 94, "end_line": 116, "span_ids": ["DefaultLinearTemplate"], "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 DefaultLinearTemplate(Template):\n DEFAULT_NAME = \"default\"\n\n DEFAULT_CONTENT = {\n \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.json\",\n \"data\": {\"values\": Template.anchor(\"data\")},\n \"title\": Template.anchor(\"title\"),\n \"mark\": {\"type\": \"line\"},\n \"encoding\": {\n \"x\": {\n \"field\": Template.anchor(\"x\"),\n \"type\": \"quantitative\",\n \"title\": Template.anchor(\"x_label\"),\n },\n \"y\": {\n \"field\": Template.anchor(\"y\"),\n \"type\": \"quantitative\",\n \"title\": Template.anchor(\"y_label\"),\n \"scale\": {\"zero\": False},\n },\n \"color\": {\"field\": \"rev\", \"type\": \"nominal\"},\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/plots/template.py_DefaultConfusionTemplate_DefaultConfusionTemplate.DEFAULT_CONTENT._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/template.py_DefaultConfusionTemplate_DefaultConfusionTemplate.DEFAULT_CONTENT._", "embedding": null, "metadata": {"file_path": "dvc/repo/plots/template.py", "file_name": "template.py", "file_type": "text/x-python", "category": "implementation", "start_line": 119, "end_line": 142, "span_ids": ["DefaultConfusionTemplate"], "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 DefaultConfusionTemplate(Template):\n DEFAULT_NAME = \"confusion\"\n DEFAULT_CONTENT = {\n \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.json\",\n \"data\": {\"values\": Template.anchor(\"data\")},\n \"title\": Template.anchor(\"title\"),\n \"mark\": \"rect\",\n \"encoding\": {\n \"x\": {\n \"field\": Template.anchor(\"x\"),\n \"type\": \"nominal\",\n \"sort\": \"ascending\",\n \"title\": Template.anchor(\"x_label\"),\n },\n \"y\": {\n \"field\": Template.anchor(\"y\"),\n \"type\": \"nominal\",\n \"sort\": \"ascending\",\n \"title\": Template.anchor(\"y_label\"),\n },\n \"color\": {\"aggregate\": \"count\", \"type\": \"quantitative\"},\n \"facet\": {\"field\": \"rev\", \"type\": \"nominal\"},\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/plots/template.py_DefaultScatterTemplate_DefaultScatterTemplate.DEFAULT_CONTENT._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/template.py_DefaultScatterTemplate_DefaultScatterTemplate.DEFAULT_CONTENT._", "embedding": null, "metadata": {"file_path": "dvc/repo/plots/template.py", "file_name": "template.py", "file_type": "text/x-python", "category": "implementation", "start_line": 145, "end_line": 166, "span_ids": ["DefaultScatterTemplate"], "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 DefaultScatterTemplate(Template):\n DEFAULT_NAME = \"scatter\"\n DEFAULT_CONTENT = {\n \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.json\",\n \"data\": {\"values\": Template.anchor(\"data\")},\n \"title\": Template.anchor(\"title\"),\n \"mark\": \"point\",\n \"encoding\": {\n \"x\": {\n \"field\": Template.anchor(\"x\"),\n \"type\": \"quantitative\",\n \"title\": Template.anchor(\"x_label\"),\n },\n \"y\": {\n \"field\": Template.anchor(\"y\"),\n \"type\": \"quantitative\",\n \"title\": Template.anchor(\"y_label\"),\n \"scale\": {\"zero\": False},\n },\n \"color\": {\"field\": \"rev\", \"type\": \"nominal\"},\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/plots/template.py_SmoothLinearTemplate_SmoothLinearTemplate.DEFAULT_CONTENT._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/template.py_SmoothLinearTemplate_SmoothLinearTemplate.DEFAULT_CONTENT._", "embedding": null, "metadata": {"file_path": "dvc/repo/plots/template.py", "file_name": "template.py", "file_type": "text/x-python", "category": "implementation", "start_line": 169, "end_line": 199, "span_ids": ["SmoothLinearTemplate"], "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 SmoothLinearTemplate(Template):\n DEFAULT_NAME = \"smooth\"\n\n DEFAULT_CONTENT = {\n \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.json\",\n \"data\": {\"values\": Template.anchor(\"data\")},\n \"title\": Template.anchor(\"title\"),\n \"mark\": {\"type\": \"line\"},\n \"encoding\": {\n \"x\": {\n \"field\": Template.anchor(\"x\"),\n \"type\": \"quantitative\",\n \"title\": Template.anchor(\"x_label\"),\n },\n \"y\": {\n \"field\": Template.anchor(\"y\"),\n \"type\": \"quantitative\",\n \"title\": Template.anchor(\"y_label\"),\n \"scale\": {\"zero\": False},\n },\n \"color\": {\"field\": \"rev\", \"type\": \"nominal\"},\n },\n \"transform\": [\n {\n \"loess\": Template.anchor(\"y\"),\n \"on\": Template.anchor(\"x\"),\n \"groupby\": [\"rev\"],\n \"bandwidth\": 0.3,\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/repo/plots/template.py_PlotTemplates_PlotTemplates.default_template.return.default_plot_path": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/template.py_PlotTemplates_PlotTemplates.default_template.return.default_plot_path", "embedding": null, "metadata": {"file_path": "dvc/repo/plots/template.py", "file_name": "template.py", "file_type": "text/x-python", "category": "implementation", "start_line": 202, "end_line": 220, "span_ids": ["PlotTemplates.default_template", "PlotTemplates.templates_dir", "PlotTemplates"], "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 PlotTemplates:\n TEMPLATES_DIR = \"plots\"\n TEMPLATES = [\n DefaultLinearTemplate,\n DefaultConfusionTemplate,\n DefaultScatterTemplate,\n SmoothLinearTemplate,\n ]\n\n @cached_property\n def templates_dir(self):\n return os.path.join(self.dvc_dir, self.TEMPLATES_DIR)\n\n @cached_property\n def default_template(self):\n default_plot_path = os.path.join(self.templates_dir, \"default.json\")\n if not os.path.exists(default_plot_path):\n raise TemplateNotFoundError(os.path.relpath(default_plot_path))\n return default_plot_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/plots/template.py_PlotTemplates.get_template_PlotTemplates.get_template.raise_TemplateNotFoundErr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/template.py_PlotTemplates.get_template_PlotTemplates.get_template.raise_TemplateNotFoundErr", "embedding": null, "metadata": {"file_path": "dvc/repo/plots/template.py", "file_name": "template.py", "file_type": "text/x-python", "category": "implementation", "start_line": 222, "end_line": 244, "span_ids": ["PlotTemplates.get_template"], "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": "class PlotTemplates:\n\n def get_template(self, path):\n if os.path.exists(path):\n return path\n\n t_path = os.path.join(self.templates_dir, path)\n if os.path.exists(t_path):\n return t_path\n\n all_templates = [\n os.path.join(root, file)\n for root, _, files in os.walk(self.templates_dir)\n for file in files\n ]\n matches = [\n template\n for template in all_templates\n if os.path.splitext(template)[0] == t_path\n ]\n if matches:\n assert len(matches) == 1\n return matches[0]\n\n raise TemplateNotFoundError(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/plots/template.py_PlotTemplates.__init___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/plots/template.py_PlotTemplates.__init___", "embedding": null, "metadata": {"file_path": "dvc/repo/plots/template.py", "file_name": "template.py", "file_type": "text/x-python", "category": "implementation", "start_line": 246, "end_line": 272, "span_ids": ["PlotTemplates.load", "PlotTemplates.dump", "PlotTemplates.__init__"], "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 PlotTemplates:\n\n def __init__(self, dvc_dir):\n self.dvc_dir = dvc_dir\n\n if not os.path.exists(self.templates_dir):\n makedirs(self.templates_dir, exist_ok=True)\n for t in self.TEMPLATES:\n self.dump(t())\n\n def dump(self, template):\n path = os.path.join(self.templates_dir, template.filename)\n with open(path, \"w\") as fd:\n json.dump(\n template.content,\n fd,\n indent=template.INDENT,\n separators=template.SEPARATORS,\n )\n fd.write(\"\\n\")\n\n def load(self, name):\n path = self.get_template(name)\n\n with open(path) as fd:\n content = fd.read()\n\n return Template(content, name=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/run.py_os_parse_params.return.ret": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/run.py_os_parse_params.return.ret", "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": 35, "span_ids": ["imports", "parse_params", "is_valid_name"], "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": "import os\nfrom contextlib import suppress\n\nfrom funcy import concat, first, lfilter\n\nfrom dvc.exceptions import InvalidArgumentError\nfrom dvc.stage import PipelineStage\nfrom dvc.stage.exceptions import (\n DuplicateStageName,\n InvalidStageName,\n StageFileAlreadyExistsError,\n)\n\nfrom ..exceptions import OutputDuplicationError\nfrom . import locked\nfrom .scm_context import scm_context\n\n\ndef is_valid_name(name: str):\n from ..stage import INVALID_STAGENAME_CHARS\n\n return not INVALID_STAGENAME_CHARS & set(name)\n\n\ndef parse_params(path_params):\n ret = []\n for path_param in path_params:\n path, _, params_str = path_param.rpartition(\":\")\n # remove empty strings from params, on condition such as `-p \"file1:\"`\n params = lfilter(bool, params_str.split(\",\"))\n if not path:\n ret.extend(params)\n else:\n ret.append({path: params})\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/run.py__get_file_path__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__get_file_path__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": 38, "end_line": 58, "span_ids": ["_get_file_path"], "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 _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(\"plots\", []),\n kwargs.get(\"plots_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__check_stage_exists__check_stage_exists.if_stage___class___Pip.elif_stage_name_and_stage.raise_DuplicateStageName_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/run.py__check_stage_exists__check_stage_exists.if_stage___class___Pip.elif_stage_name_and_stage.raise_DuplicateStageName_", "embedding": null, "metadata": {"file_path": "dvc/repo/run.py", "file_name": "run.py", "file_type": "text/x-python", "category": "implementation", "start_line": 61, "end_line": 73, "span_ids": ["_check_stage_exists"], "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 _check_stage_exists(dvcfile, stage):\n if not dvcfile.exists():\n return\n\n hint = \"Use '--force' to overwrite.\"\n if stage.__class__ != PipelineStage:\n raise StageFileAlreadyExistsError(\n f\"'{stage.relpath}' already exists. {hint}\"\n )\n elif stage.name and stage.name in dvcfile.stages:\n raise DuplicateStageName(\n f\"Stage '{stage.name}' already exists in '{stage.relpath}'. {hint}\"\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/tree.py_DvcTree.open_DvcTree.open.return.open_cache_path_mode_mod": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_DvcTree.open_DvcTree.open.return.open_cache_path_mode_mod", "embedding": null, "metadata": {"file_path": "dvc/repo/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 58, "end_line": 101, "span_ids": ["DvcTree.open"], "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": "class DvcTree(BaseTree):\n\n def open(\n self, path, mode=\"r\", encoding=\"utf-8\", remote=None\n ): # pylint: disable=arguments-differ\n try:\n outs = self._find_outs(path, strict=False)\n except OutputNotFoundError as exc:\n raise FileNotFoundError from exc\n\n # NOTE: this handles both dirty and checkout-ed out at the same time\n if self.repo.tree.exists(path):\n return self.repo.tree.open(path, mode=mode, encoding=encoding)\n\n if len(outs) != 1 or (\n outs[0].is_dir_checksum and path == outs[0].path_info\n ):\n raise IsADirectoryError\n\n out = outs[0]\n if out.changed_cache(filter_info=path):\n if not self.fetch and not self.stream:\n raise FileNotFoundError\n\n remote_obj = self.repo.cloud.get_remote(remote)\n if self.stream:\n if out.is_dir_checksum:\n checksum = self._get_granular_checksum(path, out)\n else:\n checksum = out.checksum\n try:\n remote_info = remote_obj.hash_to_path_info(checksum)\n return remote_obj.open(\n remote_info, mode=mode, encoding=encoding\n )\n except RemoteActionNotImplemented:\n pass\n cache_info = out.get_used_cache(filter_info=path, remote=remote)\n self.repo.cloud.pull(cache_info, remote=remote)\n\n if out.is_dir_checksum:\n checksum = self._get_granular_checksum(path, out)\n cache_path = out.cache.hash_to_path_info(checksum).url\n else:\n cache_path = out.cache_path\n return open(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.isdir.try_.except_FileNotFoundError_.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_DvcTree.exists_DvcTree.isdir.try_.except_FileNotFoundError_.return.True", "embedding": null, "metadata": {"file_path": "dvc/repo/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 103, "end_line": 134, "span_ids": ["DvcTree.exists", "DvcTree.isdir"], "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": "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:\n return True\n\n out = outs[0]\n if not out.is_dir_checksum:\n if out.path_info != path_info:\n return True\n return False\n\n if out.path_info == path_info:\n return True\n\n # for dir checksum, we need to check if this is a file inside the\n # directory\n try:\n self._get_granular_checksum(path, out)\n return False\n except FileNotFoundError:\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/repo/tree.py_DvcTree.walk_DvcTree.walk.yield_from_self__walk_roo": {"__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.yield_from_self__walk_roo", "embedding": null, "metadata": {"file_path": "dvc/repo/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 189, "end_line": 215, "span_ids": ["DvcTree.walk"], "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 DvcTree(BaseTree):\n\n def walk(self, top, topdown=True, onerror=None, **kwargs):\n from pygtrie import Trie\n\n assert topdown\n\n if not self.exists(top):\n if onerror is not None:\n onerror(FileNotFoundError(top))\n return\n\n if not self.isdir(top):\n if onerror is not None:\n onerror(NotADirectoryError(top))\n return\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 if out.is_dir_checksum and root.isin_or_eq(out.path_info):\n self._add_dir(top, trie, out, **kwargs)\n\n yield from self._walk(root, trie, topdown=topdown, **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/tree.py_DvcTree.isdvc_DvcTree.get_file_hash.return.out_checksum": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_DvcTree.isdvc_DvcTree.get_file_hash.return.out_checksum", "embedding": null, "metadata": {"file_path": "dvc/repo/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 220, "end_line": 237, "span_ids": ["DvcTree.isdvc", "DvcTree.isexec", "DvcTree.get_file_hash"], "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 DvcTree(BaseTree):\n\n def isdvc(self, path, **kwargs):\n try:\n return len(self._find_outs(path, **kwargs)) == 1\n except OutputNotFoundError:\n pass\n return False\n\n def isexec(self, path): # pylint: disable=unused-argument\n return False\n\n def get_file_hash(self, path_info):\n outs = self._find_outs(path_info, strict=False)\n if len(outs) != 1:\n raise OutputNotFoundError\n out = outs[0]\n if out.is_dir_checksum:\n return self._get_granular_checksum(path_info, out)\n return 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/repo/tree.py_RepoTree_RepoTree._walk_one.for___in_dirs_.yield_from_self__walk_one": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_RepoTree_RepoTree._walk_one.for___in_dirs_.yield_from_self__walk_one", "embedding": null, "metadata": {"file_path": "dvc/repo/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 239, "end_line": 311, "span_ids": ["RepoTree.fetch", "RepoTree.isexec", "RepoTree.isfile", "RepoTree.stat", "RepoTree.open", "RepoTree.exists", "RepoTree.isdir", "RepoTree._walk_one", "RepoTree", "RepoTree.isdvc", "RepoTree.stream", "RepoTree.__init__"], "tokens": 517}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RepoTree(BaseTree):\n \"\"\"DVC + git-tracked files tree.\n\n Args:\n repo: DVC or git repo.\n\n Any kwargs will be passed to `DvcTree()`.\n \"\"\"\n\n def __init__(self, repo, **kwargs):\n self.repo = repo\n if hasattr(repo, \"dvc_dir\"):\n self.dvctree = DvcTree(repo, **kwargs)\n else:\n # git-only erepo's do not need dvctree\n self.dvctree = None\n\n @property\n def fetch(self):\n if self.dvctree:\n return self.dvctree.fetch\n return False\n\n @property\n def stream(self):\n if self.dvctree:\n return self.dvctree.stream\n return False\n\n def open(self, path, mode=\"r\", encoding=\"utf-8\", **kwargs):\n if \"b\" in mode:\n encoding = None\n\n if self.dvctree and self.dvctree.exists(path):\n return self.dvctree.open(\n path, mode=mode, encoding=encoding, **kwargs\n )\n return self.repo.tree.open(path, mode=mode, encoding=encoding)\n\n def exists(self, path):\n return self.repo.tree.exists(path) or (\n self.dvctree and self.dvctree.exists(path)\n )\n\n def isdir(self, path):\n return self.repo.tree.isdir(path) or (\n self.dvctree and self.dvctree.isdir(path)\n )\n\n def isdvc(self, path, **kwargs):\n return self.dvctree is not None and self.dvctree.isdvc(path, **kwargs)\n\n def isfile(self, path):\n return self.repo.tree.isfile(path) or (\n self.dvctree and self.dvctree.isfile(path)\n )\n\n def isexec(self, path):\n if self.dvctree and self.dvctree.exists(path):\n return self.dvctree.isexec(path)\n return self.repo.tree.isexec(path)\n\n def stat(self, path):\n return self.repo.tree.stat(path)\n\n def _walk_one(self, walk):\n try:\n root, dirs, files = next(walk)\n except StopIteration:\n return\n yield root, dirs, files\n for _ in dirs:\n yield from self._walk_one(walk)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_RepoTree._walk_RepoTree._walk.for_dirname_in_dirs_.if_dirname_in_shared_.elif_dirname_in_repo_set_.yield_from_self__walk_one": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_RepoTree._walk_RepoTree._walk.for_dirname_in_dirs_.if_dirname_in_shared_.elif_dirname_in_repo_set_.yield_from_self__walk_one", "embedding": null, "metadata": {"file_path": "dvc/repo/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 305, "end_line": 340, "span_ids": ["RepoTree._walk"], "tokens": 335}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RepoTree(BaseTree):\n\n def _walk(self, dvc_walk, repo_walk, dvcfiles=False):\n try:\n _, dvc_dirs, dvc_fnames = next(dvc_walk)\n repo_root, repo_dirs, repo_fnames = next(repo_walk)\n except StopIteration:\n return\n\n # separate subdirs into shared dirs, dvc-only dirs, repo-only dirs\n dvc_set = set(dvc_dirs)\n repo_set = set(repo_dirs)\n dvc_only = list(dvc_set - repo_set)\n repo_only = list(repo_set - dvc_set)\n shared = list(dvc_set & repo_set)\n dirs = shared + dvc_only + repo_only\n\n # merge file lists\n files = {\n fname\n for fname in dvc_fnames + repo_fnames\n if dvcfiles or not is_valid_filename(fname)\n }\n\n yield repo_root, dirs, list(files)\n\n # set dir order for next recursion level - shared dirs first so that\n # next() for both generators recurses into the same shared directory\n dvc_dirs[:] = [dirname for dirname in dirs if dirname in dvc_set]\n repo_dirs[:] = [dirname for dirname in dirs if dirname in repo_set]\n\n for dirname in dirs:\n if dirname in shared:\n yield from self._walk(dvc_walk, repo_walk, dvcfiles=dvcfiles)\n elif dirname in dvc_set:\n yield from self._walk_one(dvc_walk)\n elif dirname in repo_set:\n yield from self._walk_one(repo_walk)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_RepoTree.walk_RepoTree.walk.yield_from_self__walk_dvc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_RepoTree.walk_RepoTree.walk.yield_from_self__walk_dvc", "embedding": null, "metadata": {"file_path": "dvc/repo/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 351, "end_line": 394, "span_ids": ["RepoTree.walk"], "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 RepoTree(BaseTree):\n\n def walk(\n self, top, topdown=True, onerror=None, dvcfiles=False, **kwargs\n ): # pylint: disable=arguments-differ\n \"\"\"Walk and merge both DVC and repo trees.\n\n Args:\n top: path to walk from\n topdown: if True, tree will be walked from top down.\n onerror: if set, onerror function will be called if an error\n occurs (by default errors are ignored).\n dvcfiles: if True, dvcfiles will be included in the files list\n for walked directories.\n\n Any kwargs will be passed into methods used for fetching and/or\n streaming DVC outs from remotes.\n \"\"\"\n assert topdown\n\n if not self.exists(top):\n if onerror is not None:\n onerror(FileNotFoundError(top))\n return\n\n if not self.isdir(top):\n if onerror is not None:\n onerror(NotADirectoryError(top))\n return\n\n dvc_exists = self.dvctree and self.dvctree.exists(top)\n repo_exists = self.repo.tree.exists(top)\n if dvc_exists and not repo_exists:\n yield from self.dvctree.walk(\n top, topdown=topdown, onerror=onerror, **kwargs\n )\n return\n if repo_exists and not dvc_exists:\n yield from self.repo.tree.walk(\n top, topdown=topdown, onerror=onerror\n )\n return\n\n dvc_walk = self.dvctree.walk(top, topdown=topdown, **kwargs)\n repo_walk = self.repo.tree.walk(top, topdown=topdown)\n yield from self._walk(dvc_walk, repo_walk, dvcfiles=dvcfiles)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_RepoTree.walk_files_RepoTree.get_file_hash.return.file_md5_path_info_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_RepoTree.walk_files_RepoTree.get_file_hash.return.file_md5_path_info_self_", "embedding": null, "metadata": {"file_path": "dvc/repo/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 385, "end_line": 404, "span_ids": ["RepoTree.get_file_hash", "RepoTree.walk_files"], "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 RepoTree(BaseTree):\n\n def walk_files(self, top, **kwargs):\n for root, _, files in self.walk(top, **kwargs):\n for fname in files:\n yield PathInfo(root) / fname\n\n def get_file_hash(self, path_info):\n \"\"\"Return file checksum for specified path.\n\n If path_info is a DVC out, the pre-computed checksum for the file\n will be used. If path_info is a git file, MD5 will be computed for\n the git object.\n \"\"\"\n if not self.exists(path_info):\n raise FileNotFoundError\n if self.dvctree and self.dvctree.exists(path_info):\n try:\n return self.dvctree.get_file_hash(path_info)\n except OutputNotFoundError:\n pass\n return file_md5(path_info, self)[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/repo/tree.py_RepoTree.copytree_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_RepoTree.copytree_", "embedding": null, "metadata": {"file_path": "dvc/repo/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 417, "end_line": 442, "span_ids": ["RepoTree.hash_jobs", "RepoTree.copytree"], "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 RepoTree(BaseTree):\n\n def copytree(self, top, dest):\n top = PathInfo(top)\n dest = PathInfo(dest)\n\n if not self.exists(top):\n raise FileNotFoundError\n\n if self.isfile(top):\n makedirs(dest.parent, exist_ok=True)\n with self.open(top, mode=\"rb\") as fobj:\n copy_fobj_to_file(fobj, dest)\n return\n\n for root, _, files in self.walk(top):\n root = PathInfo(root)\n dest_dir = dest / root.relative_to(top)\n makedirs(dest_dir, exist_ok=True)\n for fname in files:\n src = root / fname\n with self.open(src, mode=\"rb\") as fobj:\n copy_fobj_to_file(fobj, dest_dir / fname)\n\n @property\n def hash_jobs(self):\n return self.repo.tree.hash_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/scm/git/__init__.py_Git._add_entry_to_gitignore_Git._add_entry_to_gitignore.with_open_gitignore_a_.fobj_write_f_prefix_ent": {"__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_f_prefix_ent", "embedding": null, "metadata": {"file_path": "dvc/scm/git/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 202, "end_line": 214, "span_ids": ["Git._add_entry_to_gitignore"], "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 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(f\"{prefix}{entry}\\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/git/__init__.py_Git.resolve_rev_Git.resolve_rev.raise_RevError_f_unknown_": {"__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_f_unknown_", "embedding": null, "metadata": {"file_path": "dvc/scm/git/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 386, "end_line": 415, "span_ids": ["Git.resolve_rev"], "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 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(f\"{remote.name}/{rev}\")\n for remote in self.repo.remotes\n } - {None}\n if len(shas) > 1:\n raise RevError(f\"ambiguous Git revision '{rev}'\")\n if len(shas) == 1:\n return shas.pop()\n\n raise RevError(f\"unknown Git revision '{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/tree.py_GitTree._walk_GitTree._walk.if_not_topdown_.yield_os_path_normpath_tr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_GitTree._walk_GitTree._walk.if_not_topdown_.yield_os_path_normpath_tr", "embedding": null, "metadata": {"file_path": "dvc/scm/git/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 113, "end_line": 129, "span_ids": ["GitTree._walk"], "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 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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_GitTree.isexec.return.mode_stat_S_IXUSR_st": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_GitTree.walk_GitTree.isexec.return.mode_stat_S_IXUSR_st", "embedding": null, "metadata": {"file_path": "dvc/scm/git/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 131, "end_line": 155, "span_ids": ["GitTree.isexec", "GitTree.walk"], "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 GitTree(BaseTree):\n\n def walk(self, top, topdown=True, onerror=None):\n \"\"\"Directory tree generator.\n\n See `os.walk` for the docs. Differences:\n - no support for symlinks\n \"\"\"\n\n tree = self._git_object_by_path(top)\n if tree is None:\n if onerror is not None:\n onerror(OSError(errno.ENOENT, \"No such file\", top))\n return\n if tree.mode != GIT_MODE_DIR:\n if onerror is not None:\n onerror(NotADirectoryError(top))\n return\n\n yield from self._walk(tree, topdown=topdown)\n\n def isexec(self, path):\n if not self.exists(path):\n return False\n\n mode = self.stat(path).st_mode\n return mode & (stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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.stat_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_GitTree.stat_", "embedding": null, "metadata": {"file_path": "dvc/scm/git/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 157, "end_line": 192, "span_ids": ["GitTree.hash_jobs", "GitTree.stat"], "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 GitTree(BaseTree):\n\n def stat(self, path):\n import git\n\n def to_ctime(git_time):\n sec, nano_sec = git_time\n return sec + nano_sec / 1000000000\n\n obj = self._git_object_by_path(path)\n if obj is None:\n raise OSError(errno.ENOENT, \"No such file\")\n entry = git.index.IndexEntry.from_blob(obj)\n\n # os.stat_result takes a tuple in the form:\n # (mode, ino, dev, nlink, uid, gid, size, atime, mtime, ctime)\n return os.stat_result(\n (\n entry.mode,\n entry.inode,\n entry.dev,\n 0,\n entry.uid,\n entry.gid,\n entry.size,\n # git index has no atime equivalent, use mtime\n to_ctime(entry.mtime),\n to_ctime(entry.mtime),\n to_ctime(entry.ctime),\n )\n )\n\n @property\n def hash_jobs(self):\n # NOTE: gitpython is not threadsafe. See\n # https://github.com/iterative/dvc/issues/4079\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/stage/__init__.py_Stage_Stage.changed_deps.return.self__changed_deps_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage_Stage.changed_deps.return.self__changed_deps_", "embedding": null, "metadata": {"file_path": "dvc/stage/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 90, "end_line": 229, "span_ids": ["Stage.changed_deps", "Stage.__str__", "Stage.__repr__", "Stage.__init__", "Stage.__hash__", "Stage.is_callback", "Stage.addressing", "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": 844}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 # pylint:disable=no-value-for-parameter\n # rwlocked() confuses pylint\n\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, # backward compatibility\n frozen=False,\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.frozen = locked or frozen\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 self.__dict__.pop(\"path_in_repo\", None)\n self.__dict__.pop(\"relpath\", None)\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 f\"Stage: '{self.addressing}'\"\n\n def __str__(self):\n return f\"stage: '{self.addressing}'\"\n\n @property\n def addressing(self):\n \"\"\"\n Useful for alternative presentations where we don't need\n `Stage:` prefix.\n \"\"\"\n return self.relpath if self.path else \"No path\"\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 @cached_property\n def path_in_repo(self):\n return relpath(self.path, self.repo.root_dir)\n\n @cached_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 @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.RepoDependency)\n\n def changed_deps(self):\n if self.frozen:\n return False\n\n if self.is_callback:\n logger.debug(\n '%s is a \"callback\" stage '\n \"(has a command and no dependencies) and thus always \"\n \"considered as changed.\",\n self,\n )\n return True\n\n if self.always_changed:\n return True\n\n return self._changed_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/stage/__init__.py_Stage._changed_deps_Stage.remove.if_purge_.self_dvcfile_remove_stage": {"__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.remove.if_purge_.self_dvcfile_remove_stage", "embedding": null, "metadata": {"file_path": "dvc/stage/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 231, "end_line": 304, "span_ids": ["Stage.remove_outs", "Stage.changed_stage", "Stage.unprotect_outs", "Stage.remove", "Stage.changed_outs", "Stage.changed", "Stage.ignore_remove_outs", "Stage._changed_deps"], "tokens": 490}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 # pylint:disable=no-value-for-parameter\n\n def _changed_deps(self):\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, status=status[str(dep)]\n )\n )\n return True\n return False\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, status=status[str(out)]\n )\n )\n return True\n\n return False\n\n def changed_stage(self):\n changed = self.md5 != self.compute_md5()\n if changed:\n logger.debug(self._changed_stage_entry())\n return changed\n\n @rwlocked(read=[\"deps\", \"outs\"])\n def changed(self):\n is_changed = (\n # Short-circuit order: stage md5 is fast,\n # deps are expected to change\n self.changed_stage()\n or self.changed_deps()\n or self.changed_outs()\n )\n if is_changed:\n logger.debug(\"%s changed.\", self)\n return is_changed\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 continue\n\n logger.debug(f\"Removing output '{out}' of {self}.\")\n out.remove(ignore_remove=ignore_remove)\n\n def unprotect_outs(self):\n for out in self.outs:\n out.unprotect()\n\n def ignore_remove_outs(self):\n for out in self.outs:\n out.ignore_remove()\n\n @rwlocked(write=[\"outs\"])\n def remove(self, force=False, remove_outs=True, purge=True):\n if remove_outs:\n self.remove_outs(ignore_remove=True, force=force)\n else:\n self.unprotect_outs()\n self.ignore_remove_outs()\n if purge:\n self.dvcfile.remove_stage(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.reproduce_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.reproduce_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": 306, "end_line": 338, "span_ids": ["Stage.can_be_skipped", "Stage.reload", "Stage.reproduce", "Stage.update"], "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": "class Stage(params.StageParams):\n # pylint:disable=no-value-for-parameter\n\n @rwlocked(read=[\"deps\"], write=[\"outs\"])\n def reproduce(self, interactive=False, **kwargs):\n if not (kwargs.get(\"force\", False) or self.changed()):\n logger.info(\"Stage '%s' didn't change, skipping\", self.addressing)\n return None\n\n msg = (\n \"Going to reproduce {stage}. \"\n \"Are you sure you want to continue?\".format(stage=self)\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(f\"{self} was reproduced\")\n\n return self\n\n def update(self, rev=None):\n if not (self.is_repo_import or self.is_import):\n raise StageUpdateError(self.relpath)\n update_import(self, rev=rev)\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.dumpd_Stage.commit.for_out_in_self_outs_.out_commit_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/__init__.py_Stage.dumpd_Stage.commit.for_out_in_self_outs_.out_commit_", "embedding": null, "metadata": {"file_path": "dvc/stage/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 366, "end_line": 416, "span_ids": ["Stage.compute_md5", "Stage.save_deps", "Stage.ignore_outs", "Stage.changed_entries", "Stage.dumpd", "Stage._changed_entries", "Stage._changed_stage_entry", "Stage.save", "Stage.save_outs", "Stage.commit"], "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 Stage(params.StageParams):\n # pylint:disable=no-value-for-parameter\n\n def dumpd(self):\n return get_dump(self)\n\n def compute_md5(self):\n # `dvc add`ed files don't need stage md5\n if self.is_data_source and not (self.is_import or self.is_repo_import):\n m = None\n else:\n m = compute_md5(self)\n logger.debug(f\"Computed {self} md5: '{m}'\")\n return m\n\n def save(self):\n self.save_deps()\n self.save_outs()\n self.md5 = self.compute_md5()\n\n self.repo.stage_cache.save(self)\n\n def save_deps(self):\n for dep in self.deps:\n dep.save()\n\n def save_outs(self):\n for out in self.outs:\n out.save()\n\n def ignore_outs(self):\n for out in self.outs:\n out.ignore()\n\n @staticmethod\n def _changed_entries(entries):\n return [str(entry) for entry in entries if entry.changed_checksum()]\n\n def _changed_stage_entry(self):\n return f\"'md5' of {self} changed.\"\n\n def changed_entries(self):\n changed_deps = self._changed_entries(self.deps)\n changed_outs = self._changed_entries(self.outs)\n return (\n changed_deps,\n changed_outs,\n self._changed_stage_entry() if self.changed_stage() else None,\n )\n\n @rwlocked(write=[\"outs\"])\n def commit(self):\n for out in self.outs:\n out.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._filter_outs_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._filter_outs_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": 440, "end_line": 534, "span_ids": ["Stage.status", "Stage._status_always_changed", "Stage.checkout", "Stage._checkout", "Stage._status_stage", "Stage._filter_outs", "Stage._status_deps", "Stage._status_outs", "Stage.already_cached", "Stage.get_all_files_number", "Stage.get_used_cache", "Stage._status", "Stage.outs_cached", "Stage.deps_cached"], "tokens": 637}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 # pylint:disable=no-value-for-parameter\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(self, **kwargs):\n stats = defaultdict(list)\n for out in self._filter_outs(kwargs.get(\"filter_info\")):\n key, outs = self._checkout(out, **kwargs)\n if key:\n stats[key].extend(outs)\n return stats\n\n @staticmethod\n def _checkout(out, **kwargs):\n try:\n result = out.checkout(**kwargs)\n added, modified = result or (None, None)\n if not (added or modified):\n return None, []\n return \"modified\" if modified else \"added\", [out.path_info]\n except CheckoutError as exc:\n return \"failed\", exc.target_infos\n\n @rwlocked(read=[\"deps\", \"outs\"])\n def status(self, check_updates=False):\n ret = []\n show_import = self.is_repo_import and check_updates\n\n if not self.frozen or show_import:\n self._status_deps(ret)\n self._status_outs(ret)\n self._status_always_changed(ret)\n self._status_stage(ret)\n return {self.addressing: ret} if ret else {}\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 def _status_deps(self, ret):\n deps_status = self._status(self.deps)\n if deps_status:\n ret.append({\"changed deps\": deps_status})\n\n def _status_outs(self, ret):\n outs_status = self._status(self.outs)\n if outs_status:\n ret.append({\"changed outs\": outs_status})\n\n def _status_always_changed(self, ret):\n if self.is_callback or self.always_changed:\n ret.append(\"always changed\")\n\n def _status_stage(self, ret):\n if self.changed_stage():\n ret.append(\"changed checksum\")\n\n def already_cached(self):\n return (\n not self.changed_stage()\n and self.deps_cached()\n and self.outs_cached()\n )\n\n def deps_cached(self):\n return all(not dep.changed() for dep in self.deps)\n\n def outs_cached(self):\n return 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/cache.py_StageCache.save_StageCache.save.dump_yaml_path_cache_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/cache.py_StageCache.save_StageCache.save.dump_yaml_path_cache_", "embedding": null, "metadata": {"file_path": "dvc/stage/cache.py", "file_name": "cache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 122, "end_line": 145, "span_ids": ["StageCache.save"], "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 StageCache:\n\n def save(self, stage):\n cache_key = _get_stage_hash(stage)\n if not cache_key:\n return\n\n cache = to_single_stage_lockfile(stage)\n cache_value = _get_cache_hash(cache)\n\n existing_cache = self._load_cache(cache_key, cache_value)\n cache = existing_cache or cache\n\n for out in self._uncached_outs(stage, cache):\n out.commit()\n\n if existing_cache:\n return\n\n # sanity check\n COMPILED_LOCK_FILE_STAGE_SCHEMA(cache)\n\n path = self._get_cache_path(cache_key, cache_value)\n dpath = os.path.dirname(path)\n makedirs(dpath, exist_ok=True)\n dump_yaml(path, 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/imports.py_logging_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/imports.py_logging_", "embedding": null, "metadata": {"file_path": "dvc/stage/imports.py", "file_name": "imports.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 31, "span_ids": ["imports", "sync_import", "update_import"], "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": "import logging\n\nlogger = logging.getLogger(__name__)\n\n\ndef update_import(stage, rev=None):\n stage.deps[0].update(rev=rev)\n frozen = stage.frozen\n stage.frozen = False\n try:\n stage.reproduce()\n finally:\n stage.frozen = frozen\n\n\ndef sync_import(stage, dry=False, force=False):\n \"\"\"Synchronize import's outs to the workspace.\"\"\"\n logger.info(\n \"Importing '{dep}' -> '{out}'\".format(\n dep=stage.deps[0], out=stage.outs[0]\n )\n )\n if dry:\n return\n\n if not force and stage.already_cached():\n stage.outs[0].checkout()\n else:\n stage.save_deps()\n stage.deps[0].download(stage.outs[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/stage/loader.py_logging_StageLoader.fill_from_lock.for_key_item_in_items_.item.checksum.get_in_checksums_key_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/loader.py_logging_StageLoader.fill_from_lock.for_key_item_in_items_.item.checksum.get_in_checksums_key_p", "embedding": null, "metadata": {"file_path": "dvc/stage/loader.py", "file_name": "loader.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 45, "span_ids": ["imports", "StageLoader.fill_from_lock", "StageLoader", "StageLoader.__init__"], "tokens": 340}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 collections.abc import Mapping\nfrom copy import deepcopy\nfrom itertools import chain\n\nfrom funcy import get_in, lcat, project\n\nfrom dvc import dependency, output\n\nfrom . import PipelineStage, Stage, loads_from\nfrom .exceptions import StageNameUnspecified, StageNotFound\nfrom .params import StageParams\nfrom .utils import fill_stage_dependencies, resolve_paths\n\nlogger = logging.getLogger(__name__)\n\n\nclass StageLoader(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_from_lock(stage, lock_data=None):\n \"\"\"Fill values for params, checksums for outs and deps from lock.\"\"\"\n if not lock_data:\n return\n\n assert isinstance(lock_data, dict)\n items = chain(\n ((StageParams.PARAM_DEPS, dep) for dep in stage.deps),\n ((StageParams.PARAM_OUTS, out) for out in stage.outs),\n )\n\n checksums = {\n key: {item[\"path\"]: item for item in lock_data.get(key, {})}\n for key in [StageParams.PARAM_DEPS, StageParams.PARAM_OUTS]\n }\n for key, item in items:\n path = item.def_path\n if isinstance(item, dependency.ParamsDependency):\n item.fill_values(get_in(lock_data, [stage.PARAM_PARAMS, path]))\n continue\n item.checksum = get_in(checksums, [key, path, item.checksum_type])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/params.py__", "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": 14, "span_ids": ["StageParams"], "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": "class 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\" # backward compatibility\n PARAM_FROZEN = \"frozen\"\n PARAM_META = \"meta\"\n PARAM_ALWAYS_CHANGED = \"always_changed\"\n PARAM_PARAMS = \"params\"\n PARAM_METRICS = \"metrics\"\n PARAM_PLOTS = \"plots\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/run.py_logging__nix_cmd.return._executable_opts_get_n": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/run.py_logging__nix_cmd.return._executable_opts_get_n", "embedding": null, "metadata": {"file_path": "dvc/stage/run.py", "file_name": "run.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 18, "span_ids": ["imports", "_nix_cmd"], "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": "import logging\nimport os\nimport signal\nimport subprocess\nimport threading\n\nfrom dvc.utils import fix_env\n\nfrom .decorators import unlocked_repo\nfrom .exceptions import StageCmdFailedError\n\nlogger = logging.getLogger(__name__)\n\n\ndef _nix_cmd(executable, cmd):\n opts = {\"zsh\": [\"--no-rcs\"], \"bash\": [\"--noprofile\", \"--norc\"]}\n name = os.path.basename(executable).lower()\n return [executable] + opts.get(name, []) + [\"-c\", cmd]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/run.py_warn_if_fish_warn_if_fish.logger_warning_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/run.py_warn_if_fish_warn_if_fish.logger_warning_", "embedding": null, "metadata": {"file_path": "dvc/stage/run.py", "file_name": "run.py", "file_type": "text/x-python", "category": "implementation", "start_line": 21, "end_line": 34, "span_ids": ["warn_if_fish"], "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 warn_if_fish(executable):\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/run.py_cmd_run_cmd_run.if_retcode_0_.raise_StageCmdFailedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/run.py_cmd_run_cmd_run.if_retcode_0_.raise_StageCmdFailedError", "embedding": null, "metadata": {"file_path": "dvc/stage/run.py", "file_name": "run.py", "file_type": "text/x-python", "category": "implementation", "start_line": 37, "end_line": 81, "span_ids": ["cmd_run"], "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": "@unlocked_repo\ndef cmd_run(stage, *args, **kwargs):\n kwargs = {\"cwd\": stage.wdir, \"env\": fix_env(None), \"close_fds\": True}\n\n if os.name == \"nt\":\n kwargs[\"shell\"] = True\n cmd = stage.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 warn_if_fish(executable)\n cmd = _nix_cmd(executable, stage.cmd)\n\n main_thread = isinstance(\n threading.current_thread(),\n threading._MainThread, # pylint: disable=protected-access\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 retcode = None if not p else p.returncode\n if retcode != 0:\n raise StageCmdFailedError(stage.cmd, retcode)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/run.py__is_cached_restored_from_cache.return.restored": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/run.py__is_cached_restored_from_cache.return.restored", "embedding": null, "metadata": {"file_path": "dvc/stage/run.py", "file_name": "run.py", "file_type": "text/x-python", "category": "implementation", "start_line": 81, "end_line": 102, "span_ids": ["_is_cached", "restored_from_cache"], "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 _is_cached(stage):\n cached = (\n not stage.is_callback\n and not stage.always_changed\n and stage.already_cached()\n )\n if cached:\n logger.info(\"Stage '%s' is cached\", stage.addressing)\n return cached\n\n\ndef restored_from_cache(stage):\n stage.save_deps()\n stage_cache = stage.repo.stage_cache\n if not stage_cache.is_cached(stage):\n return False\n # restore stage from build cache\n stage_cache.restore(stage)\n restored = stage.outs_cached()\n if restored:\n logger.info(\"Restored stage '%s' from run-cache\", stage.addressing)\n return restored", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/run.py_run_stage_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/run.py_run_stage_", "embedding": null, "metadata": {"file_path": "dvc/stage/run.py", "file_name": "run.py", "file_type": "text/x-python", "category": "implementation", "start_line": 105, "end_line": 124, "span_ids": ["run_stage"], "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 run_stage(stage, dry=False, force=False, run_cache=False):\n if not (dry or force):\n stage_cached = _is_cached(stage) or (\n run_cache and restored_from_cache(stage)\n )\n if stage_cached:\n logger.info(\"Skipping run, checking out outputs\")\n stage.checkout()\n return\n\n callback_str = \"callback \" if stage.is_callback else \"\"\n logger.info(\n \"Running %s\" \"stage '%s' with command:\",\n callback_str,\n stage.addressing,\n )\n logger.info(\"\\t%s\", stage.cmd)\n if not dry:\n cmd_run(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/serialize.py_from_collections_import_O__serialize_outs.return.outs_metrics_plots": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/serialize.py_from_collections_import_O__serialize_outs.return.outs_metrics_plots", "embedding": null, "metadata": {"file_path": "dvc/stage/serialize.py", "file_name": "serialize.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 63, "span_ids": ["_serialize_outs", "imports", "_get_flags", "_serialize_out"], "tokens": 406}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 functools import partial\nfrom operator import attrgetter\nfrom typing import TYPE_CHECKING, List\n\nfrom funcy import post_processing\n\nfrom dvc.dependency import ParamsDependency\nfrom dvc.output import BaseOutput\nfrom dvc.utils.collections import apply_diff\nfrom dvc.utils.yaml import parse_yaml_for_update\n\nfrom .params import StageParams\nfrom .utils import resolve_wdir, split_params_deps\n\nif TYPE_CHECKING:\n from dvc.stage import PipelineStage, Stage\n\nPARAM_PARAMS = ParamsDependency.PARAM_PARAMS\nPARAM_PATH = ParamsDependency.PARAM_PATH\n\nPARAM_DEPS = StageParams.PARAM_DEPS\nPARAM_OUTS = StageParams.PARAM_OUTS\n\nPARAM_CACHE = BaseOutput.PARAM_CACHE\nPARAM_METRIC = BaseOutput.PARAM_METRIC\nPARAM_PLOT = BaseOutput.PARAM_PLOT\nPARAM_PERSIST = BaseOutput.PARAM_PERSIST\n\nDEFAULT_PARAMS_FILE = ParamsDependency.DEFAULT_PARAMS_FILE\n\n\nsort_by_path = partial(sorted, key=attrgetter(\"def_path\"))\n\n\n@post_processing(OrderedDict)\ndef _get_flags(out):\n if not out.use_cache:\n yield PARAM_CACHE, False\n if out.persist:\n yield PARAM_PERSIST, True\n if out.plot and isinstance(out.plot, dict):\n # notice `out.plot` is not sorted\n # `out.plot` is in the same order as is in the file when read\n # and, should be dumped as-is without any sorting\n yield from out.plot.items()\n\n\ndef _serialize_out(out):\n flags = _get_flags(out)\n return out.def_path if not flags else {out.def_path: flags}\n\n\ndef _serialize_outs(outputs: List[BaseOutput]):\n outs, metrics, plots = [], [], []\n for out in sort_by_path(outputs):\n bucket = outs\n if out.plot:\n bucket = plots\n elif out.metric:\n bucket = metrics\n bucket.append(_serialize_out(out))\n return outs, metrics, plots", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/serialize.py__serialize_params_keys__serialize_params_keys.return.keys": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/serialize.py__serialize_params_keys__serialize_params_keys.return.keys", "embedding": null, "metadata": {"file_path": "dvc/stage/serialize.py", "file_name": "serialize.py", "file_type": "text/x-python", "category": "implementation", "start_line": 66, "end_line": 89, "span_ids": ["_serialize_params_keys"], "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 _serialize_params_keys(params):\n \"\"\"\n Returns the following format of data:\n ['lr', 'train', {'params2.yaml': ['lr']}]\n\n The output is sorted, with keys of params from default params file being\n at the first, and then followed by entry of other files in lexicographic\n order. The keys of those custom files are also sorted in the same order.\n \"\"\"\n keys = []\n for param_dep in sort_by_path(params):\n dump = param_dep.dumpd()\n path, params = dump[PARAM_PATH], dump[PARAM_PARAMS]\n assert isinstance(params, (dict, list))\n # when on no_exec, params are not filled and are saved as list\n k = sorted(params.keys() if isinstance(params, dict) else params)\n if not k:\n continue\n\n if path == DEFAULT_PARAMS_FILE:\n keys = k + keys\n else:\n keys.append({path: k})\n return 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/stage/serialize.py__serialize_params_values__serialize_params_values.return.key_vals": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/serialize.py__serialize_params_values__serialize_params_values.return.key_vals", "embedding": null, "metadata": {"file_path": "dvc/stage/serialize.py", "file_name": "serialize.py", "file_type": "text/x-python", "category": "implementation", "start_line": 92, "end_line": 108, "span_ids": ["_serialize_params_values"], "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": "def _serialize_params_values(params: List[ParamsDependency]):\n \"\"\"Returns output of following format, used for lockfile:\n {'params.yaml': {'lr': '1', 'train': 2}, {'params2.yaml': {'lr': '1'}}\n\n Default params file are always kept at the start, followed by others in\n alphabetical order. The param values are sorted too(not recursively though)\n \"\"\"\n key_vals = OrderedDict()\n for param_dep in sort_by_path(params):\n dump = param_dep.dumpd()\n path, params = dump[PARAM_PATH], dump[PARAM_PARAMS]\n if isinstance(params, dict):\n kv = [(key, params[key]) for key in sorted(params.keys())]\n key_vals[path] = OrderedDict(kv)\n if path == DEFAULT_PARAMS_FILE:\n key_vals.move_to_end(path, last=False)\n return key_vals", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/serialize.py_to_pipeline_file_to_pipeline_file.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/serialize.py_to_pipeline_file_to_pipeline_file.return._", "embedding": null, "metadata": {"file_path": "dvc/stage/serialize.py", "file_name": "serialize.py", "file_type": "text/x-python", "category": "implementation", "start_line": 111, "end_line": 131, "span_ids": ["to_pipeline_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": "def to_pipeline_file(stage: \"PipelineStage\"):\n wdir = resolve_wdir(stage.wdir, stage.path)\n params, deps = split_params_deps(stage)\n deps = sorted(d.def_path for d in deps)\n params = _serialize_params_keys(params)\n\n outs, metrics, plots = _serialize_outs(stage.outs)\n res = [\n (stage.PARAM_CMD, stage.cmd),\n (stage.PARAM_WDIR, wdir),\n (stage.PARAM_DEPS, deps),\n (stage.PARAM_PARAMS, params),\n (stage.PARAM_OUTS, outs),\n (stage.PARAM_METRICS, metrics),\n (stage.PARAM_PLOTS, plots),\n (stage.PARAM_FROZEN, stage.frozen),\n (stage.PARAM_ALWAYS_CHANGED, stage.always_changed),\n ]\n return {\n stage.name: OrderedDict([(key, value) for key, value in res 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/serialize.py_to_single_stage_lockfile_to_lockfile.return._stage_name_to_single_st": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/serialize.py_to_single_stage_lockfile_to_lockfile.return._stage_name_to_single_st", "embedding": null, "metadata": {"file_path": "dvc/stage/serialize.py", "file_name": "serialize.py", "file_type": "text/x-python", "category": "implementation", "start_line": 134, "end_line": 164, "span_ids": ["to_single_stage_lockfile", "to_lockfile"], "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": "def to_single_stage_lockfile(stage: \"Stage\") -> dict:\n assert stage.cmd\n\n res = OrderedDict([(\"cmd\", stage.cmd)])\n params, deps = split_params_deps(stage)\n deps, outs = [\n [\n OrderedDict(\n [\n (PARAM_PATH, item.def_path),\n (item.checksum_type, item.checksum),\n ]\n )\n for item in sort_by_path(items)\n ]\n for items in [deps, stage.outs]\n ]\n params = _serialize_params_values(params)\n if deps:\n res[PARAM_DEPS] = deps\n if params:\n res[PARAM_PARAMS] = params\n if outs:\n res[PARAM_OUTS] = outs\n\n return res\n\n\ndef to_lockfile(stage: \"PipelineStage\") -> dict:\n assert stage.name\n return {stage.name: to_single_stage_lockfile(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/serialize.py_to_single_stage_file_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/serialize.py_to_single_stage_file_", "embedding": null, "metadata": {"file_path": "dvc/stage/serialize.py", "file_name": "serialize.py", "file_type": "text/x-python", "category": "implementation", "start_line": 167, "end_line": 186, "span_ids": ["to_single_stage_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": "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 text = stage._stage_text # noqa, pylint: disable=protected-access\n if text is not None:\n saved_state = parse_yaml_for_update(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/utils.py_os_MissingDataSource": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/utils.py_os_MissingDataSource", "embedding": null, "metadata": {"file_path": "dvc/stage/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 20, "span_ids": ["imports"], "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": "import os\nimport pathlib\nfrom itertools import product\n\nfrom funcy import lsplit, rpartial\n\nfrom dvc import dependency, output\nfrom dvc.utils.fs import path_isin\n\nfrom ..dependency import ParamsDependency\nfrom ..remote.local import LocalRemoteTree\nfrom ..remote.s3 import S3RemoteTree\nfrom ..utils import dict_md5, format_link, relpath\nfrom .exceptions import (\n MissingDataSource,\n StageExternalOutputsError,\n StagePathNotDirectoryError,\n StagePathNotFoundError,\n StagePathOutsideError,\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/utils.py_check_stage_path_check_stage_path.if_real_path_proj_dir_.raise_StagePathOutsideErr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/utils.py_check_stage_path_check_stage_path.if_real_path_proj_dir_.raise_StagePathOutsideErr", "embedding": null, "metadata": {"file_path": "dvc/stage/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 23, "end_line": 40, "span_ids": ["check_stage_path"], "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 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(error_msg.format(\"is not directory\"))\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(error_msg.format(\"is outside of 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/stage/utils.py_fill_stage_outputs_fill_stage_dependencies.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/utils.py_fill_stage_outputs_fill_stage_dependencies.None_2", "embedding": null, "metadata": {"file_path": "dvc/stage/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 43, "end_line": 73, "span_ids": ["fill_stage_outputs", "fill_stage_dependencies"], "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 fill_stage_outputs(stage, **kwargs):\n assert not stage.outs\n\n keys = [\n \"outs_persist\",\n \"outs_persist_no_cache\",\n \"metrics_no_cache\",\n \"metrics\",\n \"plots_no_cache\",\n \"plots\",\n \"outs_no_cache\",\n \"outs\",\n ]\n\n stage.outs = []\n for key in keys:\n stage.outs += output.loads_from(\n stage,\n kwargs.get(key, []),\n use_cache=\"no_cache\" not in key,\n persist=\"persist\" in key,\n metric=\"metrics\" in key,\n plot=\"plots\" in key,\n )\n\n\ndef fill_stage_dependencies(stage, deps=None, erepo=None, params=None):\n assert not stage.deps\n stage.deps = []\n stage.deps += dependency.loads_from(stage, deps or [], erepo=erepo)\n stage.deps += dependency.loads_params(stage, params or [])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/utils.py_check_no_externals_check_no_externals.raise_StageExternalOutput": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/utils.py_check_no_externals_check_no_externals.raise_StageExternalOutput", "embedding": null, "metadata": {"file_path": "dvc/stage/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 76, "end_line": 98, "span_ids": ["check_no_externals"], "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": "def check_no_externals(stage):\n from urllib.parse import urlparse\n\n # NOTE: preventing users from accidentally using external outputs. See\n # https://github.com/iterative/dvc/issues/1545 for more details.\n\n def _is_external(out):\n # NOTE: in case of `remote://` notation, the user clearly knows that\n # this is an advanced feature and so we shouldn't error-out.\n if out.is_in_repo or urlparse(out.def_path).scheme == \"remote\":\n return False\n return True\n\n outs = [str(out) for out in stage.outs if _is_external(out)]\n if not outs:\n return\n\n str_outs = \", \".join(outs)\n link = format_link(\"https://dvc.org/doc/user-guide/managing-external-data\")\n raise StageExternalOutputsError(\n f\"Output(s) outside of DVC project: {str_outs}. \"\n f\"See {link} for more 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/stage/utils.py_check_circular_dependency_check_missing_outputs.if_paths_.raise_MissingDataSource_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/utils.py_check_circular_dependency_check_missing_outputs.if_paths_.raise_MissingDataSource_p", "embedding": null, "metadata": {"file_path": "dvc/stage/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 101, "end_line": 126, "span_ids": ["check_duplicated_arguments", "check_missing_outputs", "check_circular_dependency"], "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": "def check_circular_dependency(stage):\n from dvc.exceptions import CircularDependencyError\n\n circular_dependencies = {d.path_info for d in stage.deps} & {\n o.path_info for o in stage.outs\n }\n\n if circular_dependencies:\n raise CircularDependencyError(str(circular_dependencies.pop()))\n\n\ndef check_duplicated_arguments(stage):\n from dvc.exceptions import ArgumentDuplicationError\n from collections import Counter\n\n path_counts = Counter(edge.path_info for edge in stage.deps + stage.outs)\n\n for path, occurrence in path_counts.items():\n if occurrence > 1:\n raise ArgumentDuplicationError(str(path))\n\n\ndef check_missing_outputs(stage):\n paths = [str(out) for out in stage.outs if not out.exists]\n if paths:\n raise MissingDataSource(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/stage/utils.py_stage_dump_eq_stage_dump_eq.return.old_d_new_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/utils.py_stage_dump_eq_stage_dump_eq.return.old_d_new_d", "embedding": null, "metadata": {"file_path": "dvc/stage/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 129, "end_line": 147, "span_ids": ["stage_dump_eq"], "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 stage_dump_eq(stage_cls, old_d, new_d):\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(stage_cls.PARAM_MD5, None)\n new_d.pop(stage_cls.PARAM_MD5, None)\n outs = old_d.get(stage_cls.PARAM_OUTS, [])\n for out in outs:\n out.pop(LocalRemoteTree.PARAM_CHECKSUM, None)\n out.pop(S3RemoteTree.PARAM_CHECKSUM, None)\n\n # outs and deps are lists of dicts. To check equality, we need to make\n # them independent of the order, so, we convert them to dicts.\n combination = product(\n [old_d, new_d], [stage_cls.PARAM_DEPS, stage_cls.PARAM_OUTS]\n )\n for coll, key in combination:\n if coll.get(key):\n coll[key] = {item[\"path\"]: item for item in coll[key]}\n return old_d == new_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/stage/utils.py_compute_md5_compute_md5.return.dict_md5_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/utils.py_compute_md5_compute_md5.return.dict_md5_", "embedding": null, "metadata": {"file_path": "dvc/stage/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 150, "end_line": 174, "span_ids": ["compute_md5"], "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": "def compute_md5(stage):\n from dvc.output.base import BaseOutput\n\n d = stage.dumpd()\n\n # Remove md5 and meta, these should not affect stage md5\n d.pop(stage.PARAM_MD5, None)\n d.pop(stage.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(stage.PARAM_WDIR) == \".\":\n del d[stage.PARAM_WDIR]\n\n return dict_md5(\n d,\n exclude=[\n stage.PARAM_LOCKED, # backward compatibility\n stage.PARAM_FROZEN,\n BaseOutput.PARAM_METRIC,\n BaseOutput.PARAM_PERSIST,\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/stage/utils.py_resolve_wdir_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage/utils.py_resolve_wdir_", "embedding": null, "metadata": {"file_path": "dvc/stage/utils.py", "file_name": "utils.py", "file_type": "text/x-python", "category": "implementation", "start_line": 177, "end_line": 207, "span_ids": ["resolve_wdir", "get_dump", "split_params_deps", "resolve_paths"], "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 resolve_wdir(wdir, path):\n rel_wdir = relpath(wdir, os.path.dirname(path))\n return pathlib.PurePath(rel_wdir).as_posix() if rel_wdir != \".\" else None\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\n\n\ndef get_dump(stage):\n return {\n key: value\n for key, value in {\n stage.PARAM_MD5: stage.md5,\n stage.PARAM_CMD: stage.cmd,\n stage.PARAM_WDIR: resolve_wdir(stage.wdir, stage.path),\n stage.PARAM_FROZEN: stage.frozen,\n stage.PARAM_DEPS: [d.dumpd() for d in stage.deps],\n stage.PARAM_OUTS: [o.dumpd() for o in stage.outs],\n stage.PARAM_ALWAYS_CHANGED: stage.always_changed,\n }.items()\n if value\n }\n\n\ndef split_params_deps(stage):\n return lsplit(rpartial(isinstance, ParamsDependency), stage.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/system.py_System._reflink_windows_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_windows_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": 79, "end_line": 117, "span_ids": ["System.reflink", "System._reflink_linux", "System._reflink_windows"], "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 System:\n\n @staticmethod\n def _reflink_windows(_src, _dst):\n return -1\n\n @staticmethod\n def _reflink_linux(src, dst):\n import fcntl\n\n FICLONE = 0x40049409\n\n try:\n ret = 255\n with open(src) 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\n\n @staticmethod\n def reflink(source, link_name):\n source, link_name = os.fspath(source), os.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 OSError:\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/utils/__init__.py__Helpers_for_other_modu__fobj_md5.while_True_.if_progress_func_.progress_func_len_data_": {"__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__fobj_md5.while_True_.if_progress_func_.progress_func_len_data_", "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": 43, "span_ids": ["_fobj_md5", "dos2unix", "docstring"], "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": "\"\"\"Helpers for other modules.\"\"\"\n\nimport hashlib\nimport io\nimport json\nimport logging\nimport math\nimport os\nimport re\nimport sys\nimport time\n\nimport colorama\nimport nanotime\nfrom ruamel.yaml import YAML\nfrom shortuuid import uuid\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\")\n\n\ndef _fobj_md5(fobj, hash_md5, binary, progress_func=None):\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 if progress_func:\n progress_func(len(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/utils/http.py_iter_url_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/http.py_iter_url_", "embedding": null, "metadata": {"file_path": "dvc/utils/http.py", "file_name": "http.py", "file_type": "text/x-python", "category": "implementation", "start_line": 26, "end_line": 66, "span_ids": ["iter_url"], "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": "@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(f\"Can't open {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\": f\"bytes={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/pager.py__Draws_DAG_in_ASCII__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/pager.py__Draws_DAG_in_ASCII__", "embedding": null, "metadata": {"file_path": "dvc/utils/pager.py", "file_name": "pager.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 49, "span_ids": ["find_pager", "make_pager", "pager", "docstring"], "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": "\"\"\"Draws DAG in ASCII.\"\"\"\n\nimport logging\nimport os\nimport pydoc\nimport sys\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\n\n\ndef 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(f\"({DEFAULT_PAGER}) 2>{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\n\n\ndef pager(text):\n find_pager()(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/utils/stream.py_io_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/stream.py_io_", "embedding": null, "metadata": {"file_path": "dvc/utils/stream.py", "file_name": "stream.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 46, "span_ids": ["IterStream.read1", "imports", "IterStream:3", "IterStream.__init__", "IterStream", "IterStream.readable", "IterStream.readinto"], "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": "import io\n\n\nclass IterStream(io.RawIOBase):\n \"\"\"Wraps an iterator yielding bytes as a file object\"\"\"\n\n def __init__(self, iterator): # pylint: disable=super-init-not-called\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/yaml.py_from_collections_import_O_parse_yaml.try_.except_yaml_error_YAMLErr.raise_YAMLFileCorruptedEr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/yaml.py_from_collections_import_O_parse_yaml.try_.except_yaml_error_YAMLErr.raise_YAMLFileCorruptedEr", "embedding": null, "metadata": {"file_path": "dvc/utils/yaml.py", "file_name": "yaml.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 25, "span_ids": ["load_yaml", "imports", "parse_yaml"], "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": "from collections import OrderedDict\n\nfrom ruamel.yaml import YAML\nfrom ruamel.yaml.error import YAMLError\n\nfrom dvc.exceptions import YAMLFileCorruptedError\n\ntry:\n from yaml import CSafeLoader as SafeLoader\nexcept ImportError:\n from yaml import SafeLoader\n\n\ndef load_yaml(path):\n with open(path, encoding=\"utf-8\") as fd:\n return parse_yaml(fd.read(), path)\n\n\ndef parse_yaml(text, path):\n try:\n import yaml\n\n return yaml.load(text, Loader=SafeLoader) or {}\n except yaml.error.YAMLError as exc:\n raise YAMLFileCorruptedError(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/yaml.py_parse_yaml_for_update_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/yaml.py_parse_yaml_for_update_", "embedding": null, "metadata": {"file_path": "dvc/utils/yaml.py", "file_name": "yaml.py", "file_type": "text/x-python", "category": "implementation", "start_line": 27, "end_line": 53, "span_ids": ["parse_yaml_for_update", "dump_yaml"], "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": "def parse_yaml_for_update(text, path):\n \"\"\"Parses text into Python structure.\n\n Unlike `parse_yaml()` 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_yaml()`.\n \"\"\"\n try:\n yaml = YAML()\n return yaml.load(text) or {}\n except YAMLError as exc:\n raise YAMLFileCorruptedError(path) from exc\n\n\ndef dump_yaml(path, data):\n with open(path, \"w\", encoding=\"utf-8\") as fd:\n yaml = YAML()\n yaml.default_flow_style = False\n # tell Dumper to represent OrderedDict as\n # normal dict\n yaml.Representer.add_representer(\n OrderedDict, yaml.Representer.represent_dict\n )\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/scripts/hooks/hook-pydrive2.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/hooks/hook-pydrive2.py__", "embedding": null, "metadata": {"file_path": "scripts/hooks/hook-pydrive2.py", "file_name": "hook-pydrive2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 7, "span_ids": ["imports"], "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 PyInstaller.utils.hooks import ( # pylint:disable=import-error\n copy_metadata,\n)\n\ndatas = copy_metadata(\"pydrive2\")\ndatas += copy_metadata(\"google-api-python-client\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_logging_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_logging_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": 93, "span_ids": ["TestDirFixture.mkdtemp", "TestDirFixture.__init__", "TestDirFixture._pushd", "TestDirFixture.setUp", "TestDirFixture.create", "imports", "TestDirFixture", "TestDirFixture._popd", "TestDirFixture.root_dir"], "tokens": 727}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\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\nlogger = logging.getLogger(\"dvc\")\n\n\nclass TestDirFixture:\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 self._saved_dir = None\n\n @property\n def root_dir(self):\n return self._root_dir\n\n def _pushd(self, d):\n if not 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 = f\"dvc-test.{os.getpid()}.\"\n suffix = f\".{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/func/conftest.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/conftest.py_os_", "embedding": null, "metadata": {"file_path": "tests/func/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 31, "span_ids": ["imports", "run_copy_metrics"], "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\n\nimport pytest\n\n\n@pytest.fixture\ndef run_copy_metrics(tmp_dir, run_copy):\n def run(file1, file2, commit=None, tag=None, single_stage=True, **kwargs):\n stage = tmp_dir.dvc.run(\n cmd=f\"python copy.py {file1} {file2}\",\n deps=[file1],\n single_stage=single_stage,\n **kwargs,\n )\n\n if hasattr(tmp_dir.dvc, \"scm\"):\n files = [stage.path]\n files += [\n os.fspath(out.path_info)\n for out in stage.outs\n if not out.use_cache\n ]\n tmp_dir.dvc.scm.add(files)\n if commit:\n tmp_dir.dvc.scm.commit(commit)\n if tag:\n tmp_dir.dvc.scm.tag(tag)\n return stage\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/tests/func/metrics/test_diff.py_test_metrics_diff_with_unchanged_test_metrics_diff_with_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_with_unchanged_test_metrics_diff_with_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": 130, "end_line": 147, "span_ids": ["test_metrics_diff_with_unchanged"], "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": "def test_metrics_diff_with_unchanged(tmp_dir, scm, dvc, run_copy_metrics):\n tmp_dir.gen(\"metrics_temp.yaml\", \"foo: 1\\nxyz: 10\")\n run_copy_metrics(\n \"metrics_temp.yaml\",\n \"metrics.yaml\",\n metrics_no_cache=[\"metrics.yaml\"],\n commit=\"1\",\n )\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_diff.py_test_no_commits_test_metrics_diff_dirty.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_no_commits_test_metrics_diff_dirty.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": 150, "end_line": 175, "span_ids": ["test_metrics_diff_dirty", "test_no_commits"], "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_no_commits(tmp_dir):\n from dvc.repo import Repo\n from dvc.scm.git import Git\n from tests.dir_helpers import git_init\n\n git_init(\".\")\n assert Git().no_commits\n\n assert Repo.init().metrics.diff() == {}\n\n\ndef test_metrics_diff_dirty(tmp_dir, scm, dvc, run_copy_metrics):\n def _gen(val):\n tmp_dir.gen({\"m_temp.yaml\": str(val)})\n run_copy_metrics(\"m_temp.yaml\", \"m.yaml\", metrics=[\"m.yaml\"])\n dvc.scm.commit(str(val))\n\n _gen(1)\n _gen(2)\n _gen(3)\n\n tmp_dir.gen({\"m.yaml\": \"4\"})\n\n expected = {\"m.yaml\": {\"\": {\"old\": 3, \"new\": 4, \"diff\": 1}}}\n\n assert dvc.metrics.diff() == 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_cli_": {"__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_cli_", "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": 178, "end_line": 199, "span_ids": ["test_metrics_diff_cli"], "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_metrics_diff_cli(tmp_dir, scm, dvc, run_copy_metrics, caplog, capsys):\n def _gen(val):\n tmp_dir.gen({\"m_temp.yaml\": f\"foo: {val}\"})\n run_copy_metrics(\"m_temp.yaml\", \"m.yaml\", metrics=[\"m.yaml\"])\n dvc.scm.commit(str(val))\n\n _gen(1.23456789)\n _gen(2.34567891011)\n _gen(3.45678910111213)\n\n caplog.clear()\n assert main([\"metrics\", \"diff\", \"HEAD~2\", \"--old\"]) == 0\n (info,) = [\n msg\n for name, level, msg in caplog.record_tuples\n if name.startswith(\"dvc\") and level == logging.INFO\n ]\n assert info == (\n \"Path Metric Old New Change\\n\"\n \"m.yaml foo 1.23457 3.45679 2.22222\"\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_os_test_show.assert_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_os_test_show.assert_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": 28, "span_ids": ["imports", "test_show_simple", "test_show_empty", "test_show"], "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\n\nimport pytest\n\nfrom dvc.repo import Repo\nfrom dvc.repo.metrics.show import NoMetricsError\nfrom dvc.utils.fs import remove\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, run_copy_metrics):\n tmp_dir.gen(\"metrics_t.yaml\", \"1.1\")\n run_copy_metrics(\n \"metrics_t.yaml\", \"metrics.yaml\", metrics=[\"metrics.yaml\"],\n )\n assert dvc.metrics.show() == {\"\": {\"metrics.yaml\": 1.1}}\n\n\ndef test_show(tmp_dir, dvc, run_copy_metrics):\n tmp_dir.gen(\"metrics_t.yaml\", \"foo: 1.1\")\n run_copy_metrics(\n \"metrics_t.yaml\", \"metrics.yaml\", metrics=[\"metrics.yaml\"],\n )\n assert dvc.metrics.show() == {\"\": {\"metrics.yaml\": {\"foo\": 1.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/metrics/test_show.py_test_show_multiple_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_test_show_multiple_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": 30, "end_line": 44, "span_ids": ["test_show_invalid_metric", "test_show_multiple"], "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": "def test_show_multiple(tmp_dir, dvc, run_copy_metrics):\n tmp_dir.gen(\"foo_temp\", \"foo: 1\\n\")\n tmp_dir.gen(\"baz_temp\", \"baz: 2\\n\")\n run_copy_metrics(\"foo_temp\", \"foo\", fname=\"foo.dvc\", metrics=[\"foo\"])\n run_copy_metrics(\"baz_temp\", \"baz\", 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, run_copy_metrics):\n tmp_dir.gen(\"metrics_temp.yaml\", \"foo:\\n- bar\\n- baz\\nxyz: string\")\n run_copy_metrics(\n \"metrics_temp.yaml\", \"metrics.yaml\", metrics=[\"metrics.yaml\"]\n )\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_test_show_branch.assert_dvc_metrics_show_r": {"__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_test_show_branch.assert_dvc_metrics_show_r", "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": 47, "end_line": 61, "span_ids": ["test_show_branch"], "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_show_branch(tmp_dir, scm, dvc, run_copy_metrics):\n tmp_dir.gen(\"metrics_temp.yaml\", \"foo: 1\")\n run_copy_metrics(\n \"metrics_temp.yaml\", \"metrics.yaml\", metrics_no_cache=[\"metrics.yaml\"]\n )\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 \"workspace\": {\"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_dirty_test_diff_dirty.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_dirty_test_diff_dirty.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": 38, "span_ids": ["test_diff_dirty"], "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_dirty(tmp_dir, scm, dvc):\n tmp_dir.gen(\"params.yaml\", \"foo: bar\")\n dvc.run(cmd=\"echo params.yaml\", params=[\"foo\"], single_stage=True)\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.gen(\"params.yaml\", \"foo: qux\")\n\n assert dvc.params.diff() == {\n \"params.yaml\": {\"foo\": {\"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_show.py_pytest_test_show_multiple.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_multiple.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": 33, "span_ids": ["imports", "test_show_empty", "test_show", "test_show_multiple"], "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": "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(cmd=\"echo params.yaml\", params=[\"foo\"], single_stage=True)\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(\n cmd=\"echo params.yaml\",\n fname=\"foo.dvc\",\n params=[\"foo\"],\n single_stage=True,\n )\n dvc.run(\n cmd=\"echo params.yaml\",\n fname=\"baz.dvc\",\n params=[\"baz\"],\n single_stage=True,\n )\n assert dvc.params.show() == {\n \"\": {\"params.yaml\": {\"foo\": \"bar\", \"baz\": \"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_show.py_test_show_list_test_show_branch.assert_dvc_params_show_re": {"__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_list_test_show_branch.assert_dvc_params_show_re", "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": 36, "end_line": 54, "span_ids": ["test_show_list", "test_show_branch"], "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_show_list(tmp_dir, dvc):\n tmp_dir.gen(\"params.yaml\", \"foo:\\n- bar\\n- baz\\n\")\n dvc.run(cmd=\"echo params.yaml\", params=[\"foo\"], single_stage=True)\n assert dvc.params.show() == {\"\": {\"params.yaml\": {\"foo\": [\"bar\", \"baz\"]}}}\n\n\ndef test_show_branch(tmp_dir, scm, dvc):\n tmp_dir.gen(\"params.yaml\", \"foo: bar\")\n dvc.run(cmd=\"echo params.yaml\", params=[\"foo\"], single_stage=True)\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 \"workspace\": {\"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/func/plots/conftest.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/conftest.py__", "embedding": null, "metadata": {"file_path": "tests/func/plots/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 13, "span_ids": ["imports", "custom_template"], "tokens": 57}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 shutil\n\nimport pytest\n\n\n@pytest.fixture()\ndef custom_template(tmp_dir, dvc):\n template = tmp_dir / \"custom_template.json\"\n shutil.copy(\n tmp_dir / \".dvc\" / \"plots\" / \"default.json\", template,\n )\n return template", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_diff.py_json_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_diff.py_json_", "embedding": null, "metadata": {"file_path": "tests/func/plots/test_diff.py", "file_name": "test_diff.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 56, "span_ids": ["test_diff_dirty", "imports"], "tokens": 565}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 .test_plots import PlotData, _write_json\n\n\ndef test_diff_dirty(tmp_dir, scm, dvc, run_copy_metrics):\n metric_1 = [{\"y\": 2}, {\"y\": 3}]\n _write_json(tmp_dir, metric_1, \"metric_t.json\")\n run_copy_metrics(\n \"metric_t.json\",\n \"metric.json\",\n plots_no_cache=[\"metric.json\"],\n commit=\"init\",\n )\n\n metric_2 = [{\"y\": 3}, {\"y\": 5}]\n _write_json(tmp_dir, metric_2, \"metric_t.json\")\n run_copy_metrics(\n \"metric_t.json\",\n \"metric.json\",\n plots_no_cache=[\"metric.json\"],\n commit=\"second\",\n )\n\n metric_3 = [{\"y\": 5}, {\"y\": 6}]\n _write_json(tmp_dir, metric_3, \"metric_t.json\")\n run_copy_metrics(\n \"metric_t.json\", \"metric.json\", plots_no_cache=[\"metric.json\"]\n )\n\n plot_string = dvc.plots.diff(props={\"fields\": {\"y\"}})[\"metric.json\"]\n\n plot_content = json.loads(plot_string)\n assert plot_content[\"data\"][\"values\"] == [\n {\"y\": 3, PlotData.INDEX_FIELD: 0, \"rev\": \"HEAD\"},\n {\"y\": 5, PlotData.INDEX_FIELD: 1, \"rev\": \"HEAD\"},\n {\"y\": 5, PlotData.INDEX_FIELD: 0, \"rev\": \"workspace\"},\n {\"y\": 6, PlotData.INDEX_FIELD: 1, \"rev\": \"workspace\"},\n ]\n assert plot_content[\"encoding\"][\"x\"][\"field\"] == PlotData.INDEX_FIELD\n assert plot_content[\"encoding\"][\"y\"][\"field\"] == \"y\"\n\n _write_json(tmp_dir, [{\"y\": 7}, {\"y\": 8}], \"metric.json\")\n\n plot_string = dvc.plots.diff(props={\"fields\": {\"y\"}})[\"metric.json\"]\n\n plot_content = json.loads(plot_string)\n assert plot_content[\"data\"][\"values\"] == [\n {\"y\": 3, PlotData.INDEX_FIELD: 0, \"rev\": \"HEAD\"},\n {\"y\": 5, PlotData.INDEX_FIELD: 1, \"rev\": \"HEAD\"},\n {\"y\": 7, PlotData.INDEX_FIELD: 0, \"rev\": \"workspace\"},\n {\"y\": 8, PlotData.INDEX_FIELD: 1, \"rev\": \"workspace\"},\n ]\n assert plot_content[\"encoding\"][\"x\"][\"field\"] == PlotData.INDEX_FIELD\n assert plot_content[\"encoding\"][\"y\"][\"field\"] == \"y\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_modify.py_pytest_test_plots_modify_existing_template.assert_stage_outs_0_plot": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_modify.py_pytest_test_plots_modify_existing_template.assert_stage_outs_0_plot", "embedding": null, "metadata": {"file_path": "tests/func/plots/test_modify.py", "file_name": "test_modify.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 27, "span_ids": ["imports", "test_plots_modify_existing_template"], "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": "import pytest\n\nfrom dvc.dvcfile import PIPELINE_LOCK\nfrom dvc.repo.plots import PropsNotFoundError\nfrom dvc.repo.plots.template import TemplateNotFoundError\nfrom dvc.utils import relpath\n\nfrom .test_plots import _write_json\n\n\ndef test_plots_modify_existing_template(\n tmp_dir, dvc, run_copy_metrics, custom_template\n):\n metric = [{\"a\": 1, \"b\": 2}, {\"a\": 2, \"b\": 3}]\n _write_json(tmp_dir, metric, \"metric_t.json\")\n stage = run_copy_metrics(\n \"metric_t.json\",\n \"metric.json\",\n plots_no_cache=[\"metric.json\"],\n name=\"copy-metrics\",\n single_stage=False,\n )\n dvc.plots.modify(\n \"metric.json\", props={\"template\": relpath(custom_template)}\n )\n stage = stage.reload()\n assert stage.outs[0].plot == {\"template\": relpath(custom_template)}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_modify.py_test_plots_modify_should_not_change_lockfile_test_plots_modify_should_not_change_lockfile.assert_not_tmp_dir_PIP": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_modify.py_test_plots_modify_should_not_change_lockfile_test_plots_modify_should_not_change_lockfile.assert_not_tmp_dir_PIP", "embedding": null, "metadata": {"file_path": "tests/func/plots/test_modify.py", "file_name": "test_modify.py", "file_type": "text/x-python", "category": "test", "start_line": 30, "end_line": 46, "span_ids": ["test_plots_modify_should_not_change_lockfile"], "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_plots_modify_should_not_change_lockfile(\n tmp_dir, dvc, run_copy_metrics, custom_template\n):\n _write_json(tmp_dir, [{\"a\": 1, \"b\": 2}], \"metric_t.json\")\n run_copy_metrics(\n \"metric_t.json\",\n \"metric.json\",\n plots_no_cache=[\"metric.json\"],\n name=\"copy-metrics\",\n single_stage=False,\n )\n\n (tmp_dir / PIPELINE_LOCK).unlink()\n dvc.plots.modify(\n \"metric.json\", props={\"template\": relpath(custom_template)}\n )\n assert not (tmp_dir / PIPELINE_LOCK).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/plots/test_modify.py_test_plots_modify_not_existing_template_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_modify.py_test_plots_modify_not_existing_template_", "embedding": null, "metadata": {"file_path": "tests/func/plots/test_modify.py", "file_name": "test_modify.py", "file_type": "text/x-python", "category": "test", "start_line": 49, "end_line": 71, "span_ids": ["test_unset_nonexistent", "test_plots_modify_not_existing_template"], "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_plots_modify_not_existing_template(dvc):\n with pytest.raises(TemplateNotFoundError):\n dvc.plots.modify(\n \"metric.json\", props={\"template\": \"not-existing-template.json\"}\n )\n\n\ndef test_unset_nonexistent(tmp_dir, dvc, run_copy_metrics, custom_template):\n metric = [{\"a\": 1, \"b\": 2}, {\"a\": 2, \"b\": 3}]\n _write_json(tmp_dir, metric, \"metric_t.json\")\n run_copy_metrics(\n \"metric_t.json\",\n \"metric.json\",\n plots_no_cache=[\"metric.json\"],\n name=\"copy-metrics\",\n single_stage=False,\n )\n\n with pytest.raises(PropsNotFoundError):\n dvc.plots.modify(\n \"metric.json\", unset=[\"nonexistent\"],\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/plots/test_plots.py_csv__write_json.tmp_dir_gen_filename_jso": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_csv__write_json.tmp_dir_gen_filename_jso", "embedding": null, "metadata": {"file_path": "tests/func/plots/test_plots.py", "file_name": "test_plots.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 42, "span_ids": ["imports", "_write_csv", "_write_json"], "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": "import csv\nimport json\nimport logging\nimport os\nimport shutil\nfrom collections import OrderedDict\n\nimport pytest\nimport yaml\nfrom funcy import first\n\nfrom dvc.repo.plots.data import (\n JSONPlotData,\n NoMetricInHistoryError,\n PlotData,\n PlotMetricTypeError,\n YAMLPlotData,\n)\nfrom dvc.repo.plots.template import (\n BadTemplateError,\n NoFieldInDataError,\n TemplateNotFoundError,\n)\n\n\ndef _write_csv(metric, filename, header=True):\n with open(filename, \"w\", newline=\"\") as csvobj:\n if header:\n writer = csv.DictWriter(\n csvobj, fieldnames=list(first(metric).keys())\n )\n writer.writeheader()\n writer.writerows(metric)\n else:\n writer = csv.writer(csvobj)\n for d in metric:\n assert len(d) == 1\n writer.writerow(list(d.values()))\n\n\ndef _write_json(tmp_dir, metric, filename):\n tmp_dir.gen(filename, json.dumps(metric, sort_keys=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/plots/test_plots.py_test_plot_csv_one_column_test_plot_csv_one_column.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_csv_one_column_test_plot_csv_one_column.None_5", "embedding": null, "metadata": {"file_path": "tests/func/plots/test_plots.py", "file_name": "test_plots.py", "file_type": "text/x-python", "category": "test", "start_line": 45, "end_line": 70, "span_ids": ["test_plot_csv_one_column"], "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": "def test_plot_csv_one_column(tmp_dir, scm, dvc, run_copy_metrics):\n # no header\n metric = [{\"val\": 2}, {\"val\": 3}]\n _write_csv(metric, \"metric_t.csv\", header=False)\n run_copy_metrics(\n \"metric_t.csv\", \"metric.csv\", plots_no_cache=[\"metric.csv\"]\n )\n\n props = {\n \"header\": False,\n \"x_label\": \"x_title\",\n \"y_label\": \"y_title\",\n \"title\": \"mytitle\",\n }\n plot_string = dvc.plots.show(props=props)[\"metric.csv\"]\n\n plot_content = json.loads(plot_string)\n assert plot_content[\"title\"] == \"mytitle\"\n assert plot_content[\"data\"][\"values\"] == [\n {\"0\": \"2\", PlotData.INDEX_FIELD: 0, \"rev\": \"workspace\"},\n {\"0\": \"3\", PlotData.INDEX_FIELD: 1, \"rev\": \"workspace\"},\n ]\n assert plot_content[\"encoding\"][\"x\"][\"field\"] == PlotData.INDEX_FIELD\n assert plot_content[\"encoding\"][\"y\"][\"field\"] == \"0\"\n assert plot_content[\"encoding\"][\"x\"][\"title\"] == \"x_title\"\n assert plot_content[\"encoding\"][\"y\"][\"title\"] == \"y_title\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_csv_multiple_columns_test_plot_csv_multiple_columns.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_csv_multiple_columns_test_plot_csv_multiple_columns.None_2", "embedding": null, "metadata": {"file_path": "tests/func/plots/test_plots.py", "file_name": "test_plots.py", "file_type": "text/x-python", "category": "test", "start_line": 73, "end_line": 103, "span_ids": ["test_plot_csv_multiple_columns"], "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_plot_csv_multiple_columns(tmp_dir, scm, dvc, run_copy_metrics):\n metric = [\n OrderedDict([(\"first_val\", 100), (\"second_val\", 100), (\"val\", 2)]),\n OrderedDict([(\"first_val\", 200), (\"second_val\", 300), (\"val\", 3)]),\n ]\n _write_csv(metric, \"metric_t.csv\")\n run_copy_metrics(\n \"metric_t.csv\", \"metric.csv\", plots_no_cache=[\"metric.csv\"]\n )\n\n plot_string = dvc.plots.show()[\"metric.csv\"]\n\n plot_content = json.loads(plot_string)\n assert plot_content[\"data\"][\"values\"] == [\n {\n \"val\": \"2\",\n PlotData.INDEX_FIELD: 0,\n \"rev\": \"workspace\",\n \"first_val\": \"100\",\n \"second_val\": \"100\",\n },\n {\n \"val\": \"3\",\n PlotData.INDEX_FIELD: 1,\n \"rev\": \"workspace\",\n \"first_val\": \"200\",\n \"second_val\": \"300\",\n },\n ]\n assert plot_content[\"encoding\"][\"x\"][\"field\"] == PlotData.INDEX_FIELD\n assert plot_content[\"encoding\"][\"y\"][\"field\"] == \"val\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_csv_choose_axes_test_plot_csv_choose_axes.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_csv_choose_axes_test_plot_csv_choose_axes.None_2", "embedding": null, "metadata": {"file_path": "tests/func/plots/test_plots.py", "file_name": "test_plots.py", "file_type": "text/x-python", "category": "test", "start_line": 106, "end_line": 135, "span_ids": ["test_plot_csv_choose_axes"], "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": "def test_plot_csv_choose_axes(tmp_dir, scm, dvc, run_copy_metrics):\n metric = [\n OrderedDict([(\"first_val\", 100), (\"second_val\", 100), (\"val\", 2)]),\n OrderedDict([(\"first_val\", 200), (\"second_val\", 300), (\"val\", 3)]),\n ]\n _write_csv(metric, \"metric_t.csv\")\n run_copy_metrics(\n \"metric_t.csv\", \"metric.csv\", plots_no_cache=[\"metric.csv\"]\n )\n\n props = {\"x\": \"first_val\", \"y\": \"second_val\"}\n plot_string = dvc.plots.show(props=props)[\"metric.csv\"]\n\n plot_content = json.loads(plot_string)\n assert plot_content[\"data\"][\"values\"] == [\n {\n \"val\": \"2\",\n \"rev\": \"workspace\",\n \"first_val\": \"100\",\n \"second_val\": \"100\",\n },\n {\n \"val\": \"3\",\n \"rev\": \"workspace\",\n \"first_val\": \"200\",\n \"second_val\": \"300\",\n },\n ]\n assert plot_content[\"encoding\"][\"x\"][\"field\"] == \"first_val\"\n assert plot_content[\"encoding\"][\"y\"][\"field\"] == \"second_val\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_json_single_val_test_plot_json_single_val.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_json_single_val_test_plot_json_single_val.None_2", "embedding": null, "metadata": {"file_path": "tests/func/plots/test_plots.py", "file_name": "test_plots.py", "file_type": "text/x-python", "category": "test", "start_line": 138, "end_line": 156, "span_ids": ["test_plot_json_single_val"], "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_plot_json_single_val(tmp_dir, scm, dvc, run_copy_metrics):\n metric = [{\"val\": 2}, {\"val\": 3}]\n _write_json(tmp_dir, metric, \"metric_t.json\")\n run_copy_metrics(\n \"metric_t.json\",\n \"metric.json\",\n plots_no_cache=[\"metric.json\"],\n commit=\"first run\",\n )\n\n plot_string = dvc.plots.show()[\"metric.json\"]\n\n plot_json = json.loads(plot_string)\n assert plot_json[\"data\"][\"values\"] == [\n {\"val\": 2, PlotData.INDEX_FIELD: 0, \"rev\": \"workspace\"},\n {\"val\": 3, PlotData.INDEX_FIELD: 1, \"rev\": \"workspace\"},\n ]\n assert plot_json[\"encoding\"][\"x\"][\"field\"] == PlotData.INDEX_FIELD\n assert plot_json[\"encoding\"][\"y\"][\"field\"] == \"val\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_json_multiple_val_test_plot_json_multiple_val.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_json_multiple_val_test_plot_json_multiple_val.None_2", "embedding": null, "metadata": {"file_path": "tests/func/plots/test_plots.py", "file_name": "test_plots.py", "file_type": "text/x-python", "category": "test", "start_line": 159, "end_line": 190, "span_ids": ["test_plot_json_multiple_val"], "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 test_plot_json_multiple_val(tmp_dir, scm, dvc, run_copy_metrics):\n metric = [\n {\"first_val\": 100, \"val\": 2},\n {\"first_val\": 200, \"val\": 3},\n ]\n _write_json(tmp_dir, metric, \"metric_t.json\")\n run_copy_metrics(\n \"metric_t.json\",\n \"metric.json\",\n plots_no_cache=[\"metric.json\"],\n commit=\"first run\",\n )\n\n plot_string = dvc.plots.show()[\"metric.json\"]\n\n plot_content = json.loads(plot_string)\n assert plot_content[\"data\"][\"values\"] == [\n {\n \"val\": 2,\n PlotData.INDEX_FIELD: 0,\n \"first_val\": 100,\n \"rev\": \"workspace\",\n },\n {\n \"val\": 3,\n PlotData.INDEX_FIELD: 1,\n \"first_val\": 200,\n \"rev\": \"workspace\",\n },\n ]\n assert plot_content[\"encoding\"][\"x\"][\"field\"] == PlotData.INDEX_FIELD\n assert plot_content[\"encoding\"][\"y\"][\"field\"] == \"val\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_confusion_test_plot_confusion.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_confusion_test_plot_confusion.None_2", "embedding": null, "metadata": {"file_path": "tests/func/plots/test_plots.py", "file_name": "test_plots.py", "file_type": "text/x-python", "category": "test", "start_line": 193, "end_line": 215, "span_ids": ["test_plot_confusion"], "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": "def test_plot_confusion(tmp_dir, dvc, run_copy_metrics):\n confusion_matrix = [\n {\"predicted\": \"B\", \"actual\": \"A\"},\n {\"predicted\": \"A\", \"actual\": \"A\"},\n ]\n _write_json(tmp_dir, confusion_matrix, \"metric_t.json\")\n run_copy_metrics(\n \"metric_t.json\",\n \"metric.json\",\n plots_no_cache=[\"metric.json\"],\n commit=\"first run\",\n )\n\n props = {\"template\": \"confusion\", \"x\": \"predicted\", \"y\": \"actual\"}\n plot_string = dvc.plots.show(props=props)[\"metric.json\"]\n\n plot_content = json.loads(plot_string)\n assert plot_content[\"data\"][\"values\"] == [\n {\"predicted\": \"B\", \"actual\": \"A\", \"rev\": \"workspace\"},\n {\"predicted\": \"A\", \"actual\": \"A\", \"rev\": \"workspace\"},\n ]\n assert plot_content[\"encoding\"][\"x\"][\"field\"] == \"predicted\"\n assert plot_content[\"encoding\"][\"y\"][\"field\"] == \"actual\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_multiple_revs_default_test_plot_multiple_revs_default.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_multiple_revs_default_test_plot_multiple_revs_default.None_2", "embedding": null, "metadata": {"file_path": "tests/func/plots/test_plots.py", "file_name": "test_plots.py", "file_type": "text/x-python", "category": "test", "start_line": 218, "end_line": 261, "span_ids": ["test_plot_multiple_revs_default"], "tokens": 451}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_plot_multiple_revs_default(tmp_dir, scm, dvc, run_copy_metrics):\n metric_1 = [{\"y\": 2}, {\"y\": 3}]\n _write_json(tmp_dir, metric_1, \"metric_t.json\")\n run_copy_metrics(\n \"metric_t.json\",\n \"metric.json\",\n plots_no_cache=[\"metric.json\"],\n commit=\"init\",\n tag=\"v1\",\n )\n\n metric_2 = [{\"y\": 3}, {\"y\": 5}]\n _write_json(tmp_dir, metric_2, \"metric_t.json\")\n run_copy_metrics(\n \"metric_t.json\",\n \"metric.json\",\n plots_no_cache=[\"metric.json\"],\n commit=\"second\",\n tag=\"v2\",\n )\n\n metric_3 = [{\"y\": 5}, {\"y\": 6}]\n _write_json(tmp_dir, metric_3, \"metric_t.json\")\n run_copy_metrics(\n \"metric_t.json\",\n \"metric.json\",\n plots_no_cache=[\"metric.json\"],\n commit=\"third\",\n )\n plot_string = dvc.plots.show(\n revs=[\"HEAD\", \"v2\", \"v1\"], props={\"fields\": {\"y\"}}\n )[\"metric.json\"]\n\n plot_content = json.loads(plot_string)\n assert plot_content[\"data\"][\"values\"] == [\n {\"y\": 5, PlotData.INDEX_FIELD: 0, \"rev\": \"HEAD\"},\n {\"y\": 6, PlotData.INDEX_FIELD: 1, \"rev\": \"HEAD\"},\n {\"y\": 3, PlotData.INDEX_FIELD: 0, \"rev\": \"v2\"},\n {\"y\": 5, PlotData.INDEX_FIELD: 1, \"rev\": \"v2\"},\n {\"y\": 2, PlotData.INDEX_FIELD: 0, \"rev\": \"v1\"},\n {\"y\": 3, PlotData.INDEX_FIELD: 1, \"rev\": \"v1\"},\n ]\n assert plot_content[\"encoding\"][\"x\"][\"field\"] == PlotData.INDEX_FIELD\n assert plot_content[\"encoding\"][\"y\"][\"field\"] == \"y\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_multiple_revs_test_plot_multiple_revs.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_multiple_revs_test_plot_multiple_revs.None_4", "embedding": null, "metadata": {"file_path": "tests/func/plots/test_plots.py", "file_name": "test_plots.py", "file_type": "text/x-python", "category": "test", "start_line": 264, "end_line": 309, "span_ids": ["test_plot_multiple_revs"], "tokens": 499}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_plot_multiple_revs(tmp_dir, scm, dvc, run_copy_metrics):\n templates_dir = dvc.plot_templates.templates_dir\n shutil.copy(\n os.path.join(templates_dir, \"default.json\"),\n os.path.join(templates_dir, \"template.json\"),\n )\n\n metric_1 = [{\"y\": 2}, {\"y\": 3}]\n _write_json(tmp_dir, metric_1, \"metric_t.json\")\n stage = run_copy_metrics(\n \"metric_t.json\",\n \"metric.json\",\n plots_no_cache=[\"metric.json\"],\n commit=\"init\",\n tag=\"v1\",\n )\n\n metric_2 = [{\"y\": 3}, {\"y\": 5}]\n _write_json(tmp_dir, metric_2, \"metric_t.json\")\n assert dvc.reproduce(stage.addressing) == [stage]\n scm.add([\"metric.json\", stage.path])\n scm.commit(\"second\")\n scm.tag(\"v2\")\n\n metric_3 = [{\"y\": 5}, {\"y\": 6}]\n _write_json(tmp_dir, metric_3, \"metric_t.json\")\n assert dvc.reproduce(stage.addressing) == [stage]\n scm.add([\"metric.json\", stage.path])\n scm.commit(\"third\")\n\n props = {\"template\": \"template.json\"}\n plot_string = dvc.plots.show(revs=[\"HEAD\", \"v2\", \"v1\"], props=props)[\n \"metric.json\"\n ]\n\n plot_content = json.loads(plot_string)\n assert plot_content[\"data\"][\"values\"] == [\n {\"y\": 5, PlotData.INDEX_FIELD: 0, \"rev\": \"HEAD\"},\n {\"y\": 6, PlotData.INDEX_FIELD: 1, \"rev\": \"HEAD\"},\n {\"y\": 3, PlotData.INDEX_FIELD: 0, \"rev\": \"v2\"},\n {\"y\": 5, PlotData.INDEX_FIELD: 1, \"rev\": \"v2\"},\n {\"y\": 2, PlotData.INDEX_FIELD: 0, \"rev\": \"v1\"},\n {\"y\": 3, PlotData.INDEX_FIELD: 1, \"rev\": \"v1\"},\n ]\n assert plot_content[\"encoding\"][\"x\"][\"field\"] == PlotData.INDEX_FIELD\n assert plot_content[\"encoding\"][\"y\"][\"field\"] == \"y\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_even_if_metric_missing_test_plot_even_if_metric_missing.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_even_if_metric_missing_test_plot_even_if_metric_missing.None_2", "embedding": null, "metadata": {"file_path": "tests/func/plots/test_plots.py", "file_name": "test_plots.py", "file_type": "text/x-python", "category": "test", "start_line": 312, "end_line": 342, "span_ids": ["test_plot_even_if_metric_missing"], "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": "def test_plot_even_if_metric_missing(\n tmp_dir, scm, dvc, caplog, run_copy_metrics\n):\n tmp_dir.scm_gen(\"some_file\", \"content\", commit=\"there is no metric\")\n scm.tag(\"v1\")\n\n metric = [{\"y\": 2}, {\"y\": 3}]\n _write_json(tmp_dir, metric, \"metric_t.json\")\n run_copy_metrics(\n \"metric_t.json\",\n \"metric.json\",\n plots_no_cache=[\"metric.json\"],\n commit=\"there is metric\",\n tag=\"v2\",\n )\n\n caplog.clear()\n with caplog.at_level(logging.WARNING, \"dvc\"):\n plots = dvc.plots.show(revs=[\"v1\", \"v2\"], targets=[\"metric.json\"])\n assert (\n \"File 'metric.json' was not found at: 'v1'. \"\n \"It will not be plotted.\" in caplog.text\n )\n\n plot_content = json.loads(plots[\"metric.json\"])\n assert plot_content[\"data\"][\"values\"] == [\n {\"y\": 2, PlotData.INDEX_FIELD: 0, \"rev\": \"v2\"},\n {\"y\": 3, PlotData.INDEX_FIELD: 1, \"rev\": \"v2\"},\n ]\n assert plot_content[\"encoding\"][\"x\"][\"field\"] == PlotData.INDEX_FIELD\n assert plot_content[\"encoding\"][\"y\"][\"field\"] == \"y\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_throw_on_no_metric_at_all_test_throw_on_no_metric_at_all.assert_str_error_value_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_throw_on_no_metric_at_all_test_throw_on_no_metric_at_all.assert_str_error_value_", "embedding": null, "metadata": {"file_path": "tests/func/plots/test_plots.py", "file_name": "test_plots.py", "file_type": "text/x-python", "category": "test", "start_line": 345, "end_line": 360, "span_ids": ["test_throw_on_no_metric_at_all"], "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_throw_on_no_metric_at_all(tmp_dir, scm, dvc, caplog):\n tmp_dir.scm_gen(\"some_file\", \"content\", commit=\"there is no metric\")\n scm.tag(\"v1\")\n\n tmp_dir.gen(\"some_file\", \"make repo dirty\")\n\n caplog.clear()\n with pytest.raises(NoMetricInHistoryError) as error, caplog.at_level(\n logging.WARNING, \"dvc\"\n ):\n dvc.plots.show(targets=\"metric.json\", revs=[\"v1\"])\n\n # do not warn if none found\n assert len(caplog.messages) == 0\n\n assert str(error.value) == \"Could not find 'metric.json'.\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_custom_template_test_custom_template.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_custom_template_test_custom_template.None_2", "embedding": null, "metadata": {"file_path": "tests/func/plots/test_plots.py", "file_name": "test_plots.py", "file_type": "text/x-python", "category": "test", "start_line": 363, "end_line": 383, "span_ids": ["test_custom_template"], "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_custom_template(tmp_dir, scm, dvc, custom_template, run_copy_metrics):\n metric = [{\"a\": 1, \"b\": 2}, {\"a\": 2, \"b\": 3}]\n _write_json(tmp_dir, metric, \"metric_t.json\")\n run_copy_metrics(\n \"metric_t.json\",\n \"metric.json\",\n plots_no_cache=[\"metric.json\"],\n commit=\"init\",\n tag=\"v1\",\n )\n\n props = {\"template\": os.fspath(custom_template), \"x\": \"a\", \"y\": \"b\"}\n plot_string = dvc.plots.show(props=props)[\"metric.json\"]\n\n plot_content = json.loads(plot_string)\n assert plot_content[\"data\"][\"values\"] == [\n {\"a\": 1, \"b\": 2, \"rev\": \"workspace\"},\n {\"a\": 2, \"b\": 3, \"rev\": \"workspace\"},\n ]\n assert plot_content[\"encoding\"][\"x\"][\"field\"] == \"a\"\n assert plot_content[\"encoding\"][\"y\"][\"field\"] == \"b\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py__replace_test_should_raise_on_no_template.with_pytest_raises_Templa.dvc_plots_show_metric_js": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py__replace_test_should_raise_on_no_template.with_pytest_raises_Templa.dvc_plots_show_metric_js", "embedding": null, "metadata": {"file_path": "tests/func/plots/test_plots.py", "file_name": "test_plots.py", "file_type": "text/x-python", "category": "test", "start_line": 386, "end_line": 409, "span_ids": ["_replace", "test_should_raise_on_no_template", "test_no_plots"], "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 _replace(path, src, dst):\n path.write_text(path.read_text().replace(src, dst))\n\n\ndef test_no_plots(tmp_dir, dvc):\n from dvc.exceptions import NoPlotsError\n\n with pytest.raises(NoPlotsError):\n dvc.plots.show()\n\n\ndef test_should_raise_on_no_template(tmp_dir, dvc, run_copy_metrics):\n metric = [{\"val\": 2}, {\"val\": 3}]\n _write_json(tmp_dir, metric, \"metric_t.json\")\n run_copy_metrics(\n \"metric_t.json\",\n \"metric.json\",\n plots_no_cache=[\"metric.json\"],\n commit=\"first run\",\n )\n\n with pytest.raises(TemplateNotFoundError):\n props = {\"template\": \"non_existing_template.json\"}\n dvc.plots.show(\"metric.json\", props=props)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_bad_template_test_plot_wrong_metric_type.with_pytest_raises_PlotMe.dvc_plots_show_targets_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_bad_template_test_plot_wrong_metric_type.with_pytest_raises_PlotMe.dvc_plots_show_targets_", "embedding": null, "metadata": {"file_path": "tests/func/plots/test_plots.py", "file_name": "test_plots.py", "file_type": "text/x-python", "category": "test", "start_line": 412, "end_line": 439, "span_ids": ["test_plot_wrong_metric_type", "test_bad_template"], "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_bad_template(tmp_dir, dvc, run_copy_metrics):\n metric = [{\"val\": 2}, {\"val\": 3}]\n _write_json(tmp_dir, metric, \"metric_t.json\")\n run_copy_metrics(\n \"metric_t.json\",\n \"metric.json\",\n plots_no_cache=[\"metric.json\"],\n commit=\"first run\",\n )\n\n tmp_dir.gen(\"template.json\", json.dumps({\"a\": \"b\", \"c\": \"d\"}))\n\n with pytest.raises(BadTemplateError):\n props = {\"template\": \"template.json\"}\n dvc.plots.show(\"metric.json\", props=props)\n\n\ndef test_plot_wrong_metric_type(tmp_dir, scm, dvc, run_copy_metrics):\n tmp_dir.gen(\"metric_t.txt\", \"some text\")\n run_copy_metrics(\n \"metric_t.txt\",\n \"metric.txt\",\n plots_no_cache=[\"metric.txt\"],\n commit=\"add text metric\",\n )\n\n with pytest.raises(PlotMetricTypeError):\n dvc.plots.show(targets=[\"metric.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/plots/test_plots.py_test_plot_choose_columns_test_plot_choose_columns.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_choose_columns_test_plot_choose_columns.None_2", "embedding": null, "metadata": {"file_path": "tests/func/plots/test_plots.py", "file_name": "test_plots.py", "file_type": "text/x-python", "category": "test", "start_line": 442, "end_line": 469, "span_ids": ["test_plot_choose_columns"], "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 test_plot_choose_columns(\n tmp_dir, scm, dvc, custom_template, run_copy_metrics\n):\n metric = [{\"a\": 1, \"b\": 2, \"c\": 3}, {\"a\": 2, \"b\": 3, \"c\": 4}]\n _write_json(tmp_dir, metric, \"metric_t.json\")\n run_copy_metrics(\n \"metric_t.json\",\n \"metric.json\",\n plots_no_cache=[\"metric.json\"],\n commit=\"init\",\n tag=\"v1\",\n )\n\n props = {\n \"template\": os.fspath(custom_template),\n \"fields\": {\"b\", \"c\"},\n \"x\": \"b\",\n \"y\": \"c\",\n }\n plot_string = dvc.plots.show(props=props)[\"metric.json\"]\n\n plot_content = json.loads(plot_string)\n assert plot_content[\"data\"][\"values\"] == [\n {\"b\": 2, \"c\": 3, \"rev\": \"workspace\"},\n {\"b\": 3, \"c\": 4, \"rev\": \"workspace\"},\n ]\n assert plot_content[\"encoding\"][\"x\"][\"field\"] == \"b\"\n assert plot_content[\"encoding\"][\"y\"][\"field\"] == \"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/plots/test_plots.py_test_plot_default_choose_column_test_plot_default_choose_column.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_default_choose_column_test_plot_default_choose_column.None_2", "embedding": null, "metadata": {"file_path": "tests/func/plots/test_plots.py", "file_name": "test_plots.py", "file_type": "text/x-python", "category": "test", "start_line": 472, "end_line": 491, "span_ids": ["test_plot_default_choose_column"], "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_plot_default_choose_column(tmp_dir, scm, dvc, run_copy_metrics):\n metric = [{\"a\": 1, \"b\": 2, \"c\": 3}, {\"a\": 2, \"b\": 3, \"c\": 4}]\n _write_json(tmp_dir, metric, \"metric_t.json\")\n run_copy_metrics(\n \"metric_t.json\",\n \"metric.json\",\n plots_no_cache=[\"metric.json\"],\n commit=\"init\",\n tag=\"v1\",\n )\n\n plot_string = dvc.plots.show(props={\"fields\": {\"b\"}})[\"metric.json\"]\n\n plot_content = json.loads(plot_string)\n assert plot_content[\"data\"][\"values\"] == [\n {PlotData.INDEX_FIELD: 0, \"b\": 2, \"rev\": \"workspace\"},\n {PlotData.INDEX_FIELD: 1, \"b\": 3, \"rev\": \"workspace\"},\n ]\n assert plot_content[\"encoding\"][\"x\"][\"field\"] == PlotData.INDEX_FIELD\n assert plot_content[\"encoding\"][\"y\"][\"field\"] == \"b\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_yaml_test_plot_yaml.assert_plot_content_data": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_plot_yaml_test_plot_yaml.assert_plot_content_data", "embedding": null, "metadata": {"file_path": "tests/func/plots/test_plots.py", "file_name": "test_plots.py", "file_type": "text/x-python", "category": "test", "start_line": 494, "end_line": 509, "span_ids": ["test_plot_yaml"], "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_plot_yaml(tmp_dir, scm, dvc, run_copy_metrics):\n metric = [{\"val\": 2}, {\"val\": 3}]\n with open(\"metric_t.yaml\", \"w\") as fobj:\n yaml.dump(metric, fobj)\n\n run_copy_metrics(\n \"metric_t.yaml\", \"metric.yaml\", plots_no_cache=[\"metric.yaml\"]\n )\n\n plot_string = dvc.plots.show()[\"metric.yaml\"]\n\n plot_content = json.loads(plot_string)\n assert plot_content[\"data\"][\"values\"] == [\n {\"val\": 2, PlotData.INDEX_FIELD: 0, \"rev\": \"workspace\"},\n {\"val\": 3, PlotData.INDEX_FIELD: 1, \"rev\": \"workspace\"},\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/plots/test_plots.py_test_raise_on_wrong_field_test_raise_on_wrong_field.None_1.dvc_plots_show_metric_js": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_raise_on_wrong_field_test_raise_on_wrong_field.None_1.dvc_plots_show_metric_js", "embedding": null, "metadata": {"file_path": "tests/func/plots/test_plots.py", "file_name": "test_plots.py", "file_type": "text/x-python", "category": "test", "start_line": 512, "end_line": 526, "span_ids": ["test_raise_on_wrong_field"], "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 test_raise_on_wrong_field(tmp_dir, scm, dvc, run_copy_metrics):\n metric = [{\"val\": 2}, {\"val\": 3}]\n _write_json(tmp_dir, metric, \"metric_t.json\")\n run_copy_metrics(\n \"metric_t.json\",\n \"metric.json\",\n plots_no_cache=[\"metric.json\"],\n commit=\"first run\",\n )\n\n with pytest.raises(NoFieldInDataError):\n dvc.plots.show(\"metric.json\", props={\"x\": \"no_val\"})\n\n with pytest.raises(NoFieldInDataError):\n dvc.plots.show(\"metric.json\", props={\"y\": \"no_val\"})", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_load_metric_from_dict_json_test_load_metric_from_dict_yaml.assert_list_map_dict_plo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_load_metric_from_dict_json_test_load_metric_from_dict_yaml.assert_list_map_dict_plo", "embedding": null, "metadata": {"file_path": "tests/func/plots/test_plots.py", "file_name": "test_plots.py", "file_type": "text/x-python", "category": "test", "start_line": 529, "end_line": 552, "span_ids": ["test_load_metric_from_dict_json", "test_load_metric_from_dict_yaml"], "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_load_metric_from_dict_json(tmp_dir):\n metric = [{\"acccuracy\": 1, \"loss\": 2}, {\"accuracy\": 3, \"loss\": 4}]\n dmetric = {\"train\": metric}\n\n plot_data = JSONPlotData(\"-\", \"revision\", json.dumps(dmetric))\n\n expected = metric\n for d in expected:\n d[\"rev\"] = \"revision\"\n\n assert list(map(dict, plot_data.to_datapoints())) == expected\n\n\ndef test_load_metric_from_dict_yaml(tmp_dir):\n metric = [{\"acccuracy\": 1, \"loss\": 2}, {\"accuracy\": 3, \"loss\": 4}]\n dmetric = {\"train\": metric}\n\n plot_data = YAMLPlotData(\"-\", \"revision\", yaml.dump(dmetric))\n\n expected = metric\n for d in expected:\n d[\"rev\"] = \"revision\"\n\n assert list(map(dict, plot_data.to_datapoints())) == 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/plots/test_plots.py_test_multiple_plots_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/plots/test_plots.py_test_multiple_plots_", "embedding": null, "metadata": {"file_path": "tests/func/plots/test_plots.py", "file_name": "test_plots.py", "file_type": "text/x-python", "category": "test", "start_line": 555, "end_line": 574, "span_ids": ["test_multiple_plots"], "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": "def test_multiple_plots(tmp_dir, scm, dvc, run_copy_metrics):\n metric1 = [\n OrderedDict([(\"first_val\", 100), (\"second_val\", 100), (\"val\", 2)]),\n OrderedDict([(\"first_val\", 200), (\"second_val\", 300), (\"val\", 3)]),\n ]\n metric2 = [\n OrderedDict([(\"first_val\", 100), (\"second_val\", 100), (\"val\", 2)]),\n OrderedDict([(\"first_val\", 200), (\"second_val\", 300), (\"val\", 3)]),\n ]\n _write_csv(metric1, \"metric_t1.csv\")\n _write_json(tmp_dir, metric2, \"metric_t2.json\")\n run_copy_metrics(\n \"metric_t1.csv\", \"metric1.csv\", plots_no_cache=[\"metric1.csv\"]\n )\n run_copy_metrics(\n \"metric_t2.json\", \"metric2.json\", plots_no_cache=[\"metric2.json\"]\n )\n\n assert len(dvc.plots.show().keys()) == 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/remote/test_index.py_os_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_os_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": 28, "span_ids": ["imports", "remote"], "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 os\n\nimport pytest\n\nfrom dvc.exceptions import DownloadError, UploadError\nfrom dvc.remote.base import Remote\nfrom dvc.remote.index import RemoteIndex\nfrom dvc.remote.local import LocalRemote, LocalRemoteTree\nfrom dvc.utils.fs import remove\n\n\n@pytest.fixture(scope=\"function\")\ndef remote(tmp_dir, dvc, tmp_path_factory, mocker):\n url = os.fspath(tmp_path_factory.mktemp(\"upstream\"))\n dvc.config[\"remote\"][\"upstream\"] = {\"url\": url}\n dvc.config[\"core\"][\"remote\"] = \"upstream\"\n\n # patch hashes_exist since the LocalRemote normally overrides\n # BaseRemoteTree.hashes_exist.\n def hashes_exist(self, *args, **kwargs):\n return Remote.hashes_exist(self, *args, **kwargs)\n\n mocker.patch.object(LocalRemote, \"hashes_exist\", hashes_exist)\n\n # patch index class since LocalRemote normally overrides index class\n mocker.patch.object(LocalRemote, \"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/test_add.py_test_add_test_add.assert_load_yaml_foo_dvc": {"__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_load_yaml_foo_dvc", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 35, "end_line": 51, "span_ids": ["test_add"], "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_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 is None\n\n assert load_yaml(\"foo.dvc\") == {\n \"outs\": [{\"md5\": \"acbd18db4cc2f85cedef654fccc4a4d8\", \"path\": \"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_add.py_TestAddDirectoryWithForwardSlash_test_add_tracked_file.with_pytest_raises_Output.dvc_add_path_": {"__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_path_", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 118, "end_line": 140, "span_ids": ["test_add_tracked_file", "TestAddDirectoryWithForwardSlash.test", "TestAddDirectoryWithForwardSlash"], "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 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 path = \"tracked_file\"\n tmp_dir.scm_gen(path, \"...\", commit=\"add tracked file\")\n msg = f\"\"\" output '{path}' is already tracked by SCM \\\\(e.g. Git\\\\).\n You can remove it from Git, then add to DVC.\n To stop tracking from Git:\n git rm -r --cached '{path}'\n git commit -m \"stop tracking {path}\" \"\"\"\n\n with pytest.raises(OutputAlreadyTrackedError, match=msg):\n dvc.add(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_TestAddCommit_test_should_collect_dir_cache_only_once.assert_get_dir_hash_count": {"__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_hash_count", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 328, "end_line": 352, "span_ids": ["test_should_collect_dir_cache_only_once", "TestAddCommit", "TestAddCommit.test"], "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": "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_hash_counter = mocker.spy(LocalRemoteTree, \"get_dir_hash\")\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_hash_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_analytics.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_analytics.py_os_", "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": 46, "span_ids": ["test_main_analytics", "test_scm_subrepo", "imports", "test_scm_dvc_only", "test_daemon_analytics", "test_scm_git"], "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": "import os\n\nimport mock\n\nfrom dvc.analytics import _scm_in_use\nfrom dvc.main import main\nfrom dvc.repo import Repo\n\n\n@mock.patch(\"dvc.analytics.send\")\ndef test_daemon_analytics(mock_send, tmp_path):\n report = os.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_cache.py_os_TestCache.test_get.self_assertEqual_os_fspat": {"__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_os_fspat", "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": 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 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.tree.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.hash_to_path_info(self.cache1_md5)\n self.assertEqual(os.fspath(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_checkout.py_TestCheckoutSuggestGit_TestCheckoutSuggestGit.test.None_2.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_2.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": 403, "end_line": 428, "span_ids": ["TestCheckoutSuggestGit", "TestCheckoutSuggestGit.test"], "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 TestCheckoutSuggestGit(TestRepro):\n def test(self):\n # pylint: disable=no-member\n\n try:\n self.dvc.checkout(targets=\"gitbranch\")\n except DvcException as exc:\n self.assertIsInstance(exc, CheckoutErrorSuggestGit)\n self.assertIsInstance(exc.__cause__, NoOutputOrStageError)\n self.assertIsInstance(\n exc.__cause__.__cause__, StageFileDoesNotExistError\n )\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__, NoOutputOrStageError)\n self.assertIsNone(exc.__cause__.__cause__)\n\n try:\n self.dvc.checkout(targets=\"looks-like-dvcfile.dvc\")\n except DvcException as exc:\n self.assertIsInstance(exc, CheckoutErrorSuggestGit)\n self.assertIsInstance(exc.__cause__, StageFileDoesNotExistError)\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_test_checkouts_with_different_addressing_test_checkouts_with_different_addressing.assert_dvc_checkout_bar_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_checkouts_with_different_addressing_test_checkouts_with_different_addressing.assert_dvc_checkout_bar_", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 781, "end_line": 811, "span_ids": ["test_checkouts_with_different_addressing"], "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": "def test_checkouts_with_different_addressing(tmp_dir, dvc, run_copy):\n tmp_dir.gen({\"foo\": \"foo\", \"lorem\": \"lorem\"})\n run_copy(\"foo\", \"bar\", name=\"copy-foo-bar\")\n run_copy(\"lorem\", \"ipsum\", name=\"copy-lorem-ipsum\")\n\n (tmp_dir / \"bar\").unlink()\n (tmp_dir / \"ipsum\").unlink()\n assert set(dvc.checkout(PIPELINE_FILE)[\"added\"]) == {\"bar\", \"ipsum\"}\n\n (tmp_dir / \"bar\").unlink()\n (tmp_dir / \"ipsum\").unlink()\n assert set(dvc.checkout(\":\")[\"added\"]) == {\"bar\", \"ipsum\"}\n\n (tmp_dir / \"bar\").unlink()\n assert dvc.checkout(\"copy-foo-bar\")[\"added\"] == [\"bar\"]\n\n (tmp_dir / \"bar\").unlink()\n assert dvc.checkout(\"dvc.yaml:copy-foo-bar\")[\"added\"] == [\"bar\"]\n\n (tmp_dir / \"bar\").unlink()\n assert dvc.checkout(\":copy-foo-bar\")[\"added\"] == [\"bar\"]\n\n (tmp_dir / \"bar\").unlink()\n (tmp_dir / \"data\").mkdir()\n with (tmp_dir / \"data\").chdir():\n assert dvc.checkout(relpath(tmp_dir / \"dvc.yaml\") + \":copy-foo-bar\")[\n \"added\"\n ] == [relpath(tmp_dir / \"bar\")]\n\n (tmp_dir / \"bar\").unlink()\n assert dvc.checkout(\"bar\")[\"added\"] == [\"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_checkouts_on_same_stage_name_and_output_name_test_checkouts_on_same_stage_name_and_output_name.assert_dvc_checkout_co": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_test_checkouts_on_same_stage_name_and_output_name_test_checkouts_on_same_stage_name_and_output_name.assert_dvc_checkout_co", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 814, "end_line": 822, "span_ids": ["test_checkouts_on_same_stage_name_and_output_name"], "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": "def test_checkouts_on_same_stage_name_and_output_name(tmp_dir, dvc, run_copy):\n tmp_dir.gen(\"foo\", \"foo\")\n run_copy(\"foo\", \"bar\", name=\"copy-foo-bar\")\n run_copy(\"foo\", \"copy-foo-bar\", name=\"make_collision\")\n\n (tmp_dir / \"bar\").unlink()\n (tmp_dir / \"copy-foo-bar\").unlink()\n assert dvc.checkout(\"copy-foo-bar\")[\"added\"] == [\"bar\"]\n assert dvc.checkout(\"./copy-foo-bar\")[\"added\"] == [\"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_commit.py_test_commit_with_deps_test_commit_with_deps.None_1.assert_not_stage_outs_0_": {"__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_test_commit_with_deps.None_1.assert_not_stage_outs_0_", "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": 59, "span_ids": ["test_commit_with_deps"], "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(\"run_kw\", [{\"single_stage\": True}, {\"name\": \"copy\"}])\ndef test_commit_with_deps(tmp_dir, dvc, run_copy, run_kw):\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, **run_kw)\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()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\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_changed_md5_test_commit_no_exec.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_commit.py_test_commit_changed_md5_test_commit_no_exec.None_1", "embedding": null, "metadata": {"file_path": "tests/func/test_commit.py", "file_name": "test_commit.py", "file_type": "text/x-python", "category": "test", "start_line": 62, "end_line": 84, "span_ids": ["test_commit_changed_md5", "test_commit_no_exec"], "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": "def 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_yaml(stage.path)\n stage_file_content[\"md5\"] = \"1111111111\"\n dump_yaml(stage.path, stage_file_content)\n\n with pytest.raises(StageCommitError):\n dvc.commit(stage.path)\n\n dvc.commit(stage.path, force=True)\n assert \"md5\" not in load_yaml(stage.path)\n\n\ndef test_commit_no_exec(tmp_dir, dvc):\n tmp_dir.gen({\"dep\": \"dep\", \"out\": \"out\"})\n stage = dvc.run(\n name=\"my\", cmd=\"mycmd\", deps=[\"dep\"], outs=[\"out\"], no_exec=True\n )\n assert dvc.status(stage.path)\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_pipeline_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_pipeline_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": 87, "end_line": 98, "span_ids": ["test_commit_pipeline_stage"], "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": "def test_commit_pipeline_stage(tmp_dir, dvc, run_copy):\n tmp_dir.gen(\"foo\", \"foo\")\n stage = run_copy(\"foo\", \"bar\", no_commit=True, name=\"copy-foo-bar\")\n assert dvc.status(stage.addressing)\n assert dvc.commit(stage.addressing, force=True) == [stage]\n assert not dvc.status(stage.addressing)\n\n # just to confirm different variants work\n assert dvc.commit(f\":{stage.addressing}\") == [stage]\n assert dvc.commit(f\"{PIPELINE_FILE}:{stage.addressing}\") == [stage]\n assert dvc.commit(PIPELINE_FILE) == [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_data_cloud.py_test_cloud_cli_test_cloud_cli.None_25": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_test_cloud_cli_test_cloud_cli.None_25", "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": 98, "end_line": 158, "span_ids": ["test_cloud_cli"], "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": "@pytest.mark.parametrize(\"remote\", all_clouds, indirect=True)\ndef test_cloud_cli(tmp_dir, dvc, remote):\n args = [\"-v\", \"-j\", \"2\"]\n\n (stage,) = tmp_dir.dvc_gen(\"foo\", \"foo\")\n cache = stage.outs[0].cache_path\n\n (stage_dir,) = tmp_dir.dvc_gen(\n {\n \"data_dir\": {\n \"data_sub_dir\": {\"data_sub\": \"data_sub\"},\n \"data\": \"data\",\n }\n }\n )\n assert stage_dir is not None\n cache_dir = stage_dir.outs[0].cache_path\n\n # FIXME check status output\n\n assert main([\"push\"] + args) == 0\n assert os.path.exists(cache)\n assert os.path.isfile(cache)\n assert os.path.isfile(cache_dir)\n\n remove(dvc.cache.local.cache_dir)\n\n assert main([\"fetch\"] + args) == 0\n assert os.path.exists(cache)\n assert os.path.isfile(cache)\n assert os.path.isfile(cache_dir)\n\n assert main([\"pull\"] + args) == 0\n assert os.path.exists(cache)\n assert os.path.isfile(cache)\n assert os.path.isfile(cache_dir)\n assert os.path.isfile(\"foo\")\n assert os.path.isdir(\"data_dir\")\n\n with open(cache) as fd:\n assert fd.read() == \"foo\"\n assert os.path.isfile(cache_dir)\n\n # NOTE: http doesn't support gc yet\n if remote.url.startswith(\"http\"):\n return\n\n # NOTE: check if remote gc works correctly on directories\n assert main([\"gc\", \"-cw\", \"-f\"] + args) == 0\n shutil.move(\n dvc.cache.local.cache_dir, dvc.cache.local.cache_dir + \".back\",\n )\n\n assert main([\"fetch\"] + args) == 0\n\n assert main([\"pull\", \"-f\"] + args) == 0\n assert os.path.exists(cache)\n assert os.path.isfile(cache)\n assert os.path.isfile(cache_dir)\n assert os.path.isfile(\"foo\")\n assert os.path.isdir(\"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_data_cloud.py_test_hash_recalculation_test_hash_recalculation.assert_test_get_file_hash": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_test_hash_recalculation_test_hash_recalculation.assert_test_get_file_hash", "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": 197, "end_line": 208, "span_ids": ["test_hash_recalculation"], "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 test_hash_recalculation(mocker, dvc, tmp_dir, local_remote):\n tmp_dir.gen({\"foo\": \"foo\"})\n test_get_file_hash = mocker.spy(LocalRemoteTree, \"get_file_hash\")\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\", \"--single-stage\", \"-d\", \"foo\", \"echo foo\"])\n assert ret == 0\n assert test_get_file_hash.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_test_verify_hashes_test_verify_hashes.None_2": {"__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_hashes_test_verify_hashes.None_2", "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": 261, "end_line": 284, "span_ids": ["test_verify_hashes"], "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_verify_hashes(\n tmp_dir, scm, dvc, mocker, tmp_path_factory, local_remote\n):\n tmp_dir.dvc_gen({\"file\": \"file1 content\"}, commit=\"add file\")\n tmp_dir.dvc_gen({\"dir\": {\"subfile\": \"file2 content\"}}, commit=\"add dir\")\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 hash_spy = mocker.spy(dvc.cache.local.tree, \"get_file_hash\")\n\n dvc.pull()\n assert hash_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\"][\"upstream\"][\"verify\"] = True\n\n dvc.pull()\n assert hash_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_stats_test_pull_stats.assert_Everything_is_up_": {"__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_stats_test_pull_stats.assert_Everything_is_up_", "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": 467, "end_line": 482, "span_ids": ["test_pull_stats"], "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_pull_stats(tmp_dir, dvc, caplog, local_remote):\n tmp_dir.dvc_gen({\"foo\": \"foo\", \"bar\": \"bar\"})\n dvc.push()\n clean([\"foo\", \"bar\"], dvc)\n (tmp_dir / \"bar\").write_text(\"foobar\")\n caplog.clear()\n with caplog.at_level(level=logging.INFO, logger=\"dvc\"):\n main([\"pull\", \"--force\"])\n assert \"M\\tbar\" in caplog.text\n assert \"A\\tfoo\" in caplog.text\n assert \"2 files fetched\" in caplog.text\n assert \"1 file added\" in caplog.text\n assert \"1 file modified\" in caplog.text\n with caplog.at_level(level=logging.INFO, logger=\"dvc\"):\n main([\"pull\"])\n assert \"Everything is up to date.\" 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_data_cloud.py_test_push_pull_all_test_push_pull_all.assert_dvc_pull_key_T": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_test_push_pull_all_test_push_pull_all.assert_dvc_pull_key_T", "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": 485, "end_line": 501, "span_ids": ["test_push_pull_all"], "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": "@pytest.mark.parametrize(\n \"key,expected\", [(\"all_tags\", 2), (\"all_branches\", 3), (\"all_commits\", 3)]\n)\ndef test_push_pull_all(tmp_dir, scm, dvc, local_remote, key, expected):\n tmp_dir.dvc_gen({\"foo\": \"foo\"}, commit=\"first\")\n scm.tag(\"v1\")\n dvc.remove(\"foo.dvc\")\n tmp_dir.dvc_gen({\"bar\": \"bar\"}, commit=\"second\")\n scm.tag(\"v2\")\n with tmp_dir.branch(\"branch\", new=True):\n dvc.remove(\"bar.dvc\")\n tmp_dir.dvc_gen({\"baz\": \"baz\"}, commit=\"branch\")\n\n assert dvc.push(**{key: True}) == expected\n\n clean([\"foo\", \"bar\", \"baz\"], dvc)\n assert dvc.pull(**{key: True})[\"fetched\"] == 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/test_data_cloud.py_test_push_pull_fetch_pipeline_stages_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_test_push_pull_fetch_pipeline_stages_", "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": 504, "end_line": 522, "span_ids": ["test_push_pull_fetch_pipeline_stages"], "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_push_pull_fetch_pipeline_stages(tmp_dir, dvc, run_copy, local_remote):\n tmp_dir.dvc_gen(\"foo\", \"foo\")\n run_copy(\"foo\", \"bar\", no_commit=True, name=\"copy-foo-bar\")\n\n dvc.push(\"copy-foo-bar\")\n assert len(recurse_list_dir(local_remote.url)) == 1\n # pushing everything so as we can check pull/fetch only downloads\n # from specified targets\n dvc.push()\n clean([\"foo\", \"bar\"], dvc)\n\n dvc.pull(\"copy-foo-bar\")\n assert (tmp_dir / \"bar\").exists()\n assert len(recurse_list_dir(dvc.cache.local.cache_dir)) == 1\n clean([\"bar\"], dvc)\n\n dvc.fetch(\"copy-foo-bar\")\n assert len(recurse_list_dir(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_dvcfile.py_test_run_load_one_for_multistage_non_existing_test_run_load_one_for_multistage_non_existing_stage_name.with_pytest_raises_StageN.assert_Dvcfile_dvc_stage": {"__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_for_multistage_non_existing_stage_name.with_pytest_raises_StageN.assert_Dvcfile_dvc_stage", "embedding": null, "metadata": {"file_path": "tests/func/test_dvcfile.py", "file_name": "test_dvcfile.py", "file_type": "text/x-python", "category": "test", "start_line": 35, "end_line": 50, "span_ids": ["test_run_load_one_for_multistage_non_existing", "test_run_load_one_for_multistage_non_existing_stage_name"], "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_run_load_one_for_multistage_non_existing(tmp_dir, dvc):\n with pytest.raises(StageFileDoesNotExistError):\n assert Dvcfile(dvc, PIPELINE_FILE).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\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\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_on_single_stage_test_run_load_one_on_single_stage.None_2": {"__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_on_single_stage_test_run_load_one_on_single_stage.None_2", "embedding": null, "metadata": {"file_path": "tests/func/test_dvcfile.py", "file_name": "test_dvcfile.py", "file_type": "text/x-python", "category": "test", "start_line": 53, "end_line": 64, "span_ids": ["test_run_load_one_on_single_stage"], "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_run_load_one_on_single_stage(tmp_dir, dvc):\n tmp_dir.gen(\"foo\", \"foo\")\n stage = dvc.run(\n cmd=\"cp foo foo2\",\n deps=[\"foo\"],\n metrics=[\"foo2\"],\n always_changed=True,\n single_stage=True,\n )\n assert isinstance(Dvcfile(dvc, stage.path), SingleStageFile)\n assert Dvcfile(dvc, stage.path).stages.get(\"random-name\") == stage\n assert Dvcfile(dvc, stage.path).stage == 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_remove_stage_test_remove_stage.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_remove_stage_test_remove_stage.None_5", "embedding": null, "metadata": {"file_path": "tests/func/test_dvcfile.py", "file_name": "test_dvcfile.py", "file_type": "text/x-python", "category": "test", "start_line": 163, "end_line": 185, "span_ids": ["test_remove_stage"], "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": "def test_remove_stage(tmp_dir, dvc, run_copy):\n tmp_dir.gen(\"foo\", \"foo\")\n stage = run_copy(\"foo\", \"bar\", name=\"copy-foo-bar\")\n stage2 = run_copy(\"bar\", \"foobar\", name=\"copy-bar-foobar\")\n\n dvc_file = Dvcfile(dvc, PIPELINE_FILE)\n assert dvc_file.exists()\n assert {\"copy-bar-foobar\", \"copy-foo-bar\"} == set(\n dvc_file._load()[0][\"stages\"].keys()\n )\n\n dvc_file.remove_stage(stage)\n\n assert [\"copy-bar-foobar\"] == list(dvc_file._load()[0][\"stages\"].keys())\n\n # sanity check\n stage2.reload()\n\n # re-check to see if it fails if there's no stage entry\n dvc_file.remove_stage(stage)\n dvc_file.remove(force=True)\n # should not fail when there's no file at all.\n dvc_file.remove_stage(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_remove_stage_lockfile_test_remove_stage_lockfile.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_remove_stage_lockfile_test_remove_stage_lockfile.None_5", "embedding": null, "metadata": {"file_path": "tests/func/test_dvcfile.py", "file_name": "test_dvcfile.py", "file_type": "text/x-python", "category": "test", "start_line": 188, "end_line": 209, "span_ids": ["test_remove_stage_lockfile"], "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": "def test_remove_stage_lockfile(tmp_dir, dvc, run_copy):\n tmp_dir.gen(\"foo\", \"foo\")\n stage = run_copy(\"foo\", \"bar\", name=\"copy-foo-bar\")\n stage2 = run_copy(\"bar\", \"foobar\", name=\"copy-bar-foobar\")\n\n dvc_file = Dvcfile(dvc, PIPELINE_FILE)\n lock_file = dvc_file._lockfile\n assert dvc_file.exists()\n assert lock_file.exists()\n assert {\"copy-bar-foobar\", \"copy-foo-bar\"} == set(lock_file.load().keys())\n lock_file.remove_stage(stage)\n\n assert [\"copy-bar-foobar\"] == list(lock_file.load().keys())\n\n # sanity check\n stage2.reload()\n\n # re-check to see if it fails if there's no stage entry\n lock_file.remove_stage(stage)\n lock_file.remove()\n # should not fail when there's no file at all.\n lock_file.remove_stage(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_remove_stage_dvcfiles_test_remove_stage_dvcfiles.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_remove_stage_dvcfiles_test_remove_stage_dvcfiles.None_4", "embedding": null, "metadata": {"file_path": "tests/func/test_dvcfile.py", "file_name": "test_dvcfile.py", "file_type": "text/x-python", "category": "test", "start_line": 212, "end_line": 226, "span_ids": ["test_remove_stage_dvcfiles"], "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_remove_stage_dvcfiles(tmp_dir, dvc, run_copy):\n tmp_dir.gen(\"foo\", \"foo\")\n stage = run_copy(\"foo\", \"bar\", single_stage=True)\n\n dvc_file = Dvcfile(dvc, stage.path)\n assert dvc_file.exists()\n dvc_file.remove_stage(stage)\n assert not dvc_file.exists()\n\n # re-check to see if it fails if there's no stage entry\n dvc_file.remove_stage(stage)\n dvc_file.remove(force=True)\n\n # should not fail when there's no file at all.\n dvc_file.remove_stage(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_remove_stage_on_lockfile_format_error_test_remove_stage_on_lockfile_format_error.None_1.dvc_file_remove_stage_sta": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_remove_stage_on_lockfile_format_error_test_remove_stage_on_lockfile_format_error.None_1.dvc_file_remove_stage_sta", "embedding": null, "metadata": {"file_path": "tests/func/test_dvcfile.py", "file_name": "test_dvcfile.py", "file_type": "text/x-python", "category": "test", "start_line": 229, "end_line": 248, "span_ids": ["test_remove_stage_on_lockfile_format_error"], "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_remove_stage_on_lockfile_format_error(tmp_dir, dvc, run_copy):\n tmp_dir.gen(\"foo\", \"foo\")\n stage = run_copy(\"foo\", \"bar\", name=\"copy-foo-bar\")\n dvc_file = Dvcfile(dvc, stage.path)\n lock_file = dvc_file._lockfile\n\n data = dvc_file._load()[0]\n lock_data = lock_file.load()\n lock_data[\"gibberish\"] = True\n data[\"gibberish\"] = True\n dump_yaml(lock_file.relpath, lock_data)\n with pytest.raises(StageFileFormatError):\n dvc_file.remove_stage(stage)\n\n lock_file.remove()\n dvc_file.dump(stage)\n\n dump_yaml(dvc_file.relpath, data)\n with pytest.raises(StageFileFormatError):\n dvc_file.remove_stage(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_remove_stage_preserves_comment_test_remove_stage_preserves_comment.assert_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_remove_stage_preserves_comment_test_remove_stage_preserves_comment.assert_", "embedding": null, "metadata": {"file_path": "tests/func/test_dvcfile.py", "file_name": "test_dvcfile.py", "file_type": "text/x-python", "category": "test", "start_line": 251, "end_line": 284, "span_ids": ["test_remove_stage_preserves_comment"], "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": "def test_remove_stage_preserves_comment(tmp_dir, dvc, run_copy):\n tmp_dir.gen(\n \"dvc.yaml\",\n textwrap.dedent(\n \"\"\"\\\n stages:\n generate-foo:\n cmd: \"echo foo > foo\"\n # This copies 'foo' text to 'foo' file.\n outs:\n - foo\n copy-foo-bar:\n cmd: \"python copy.py foo bar\"\n deps:\n - foo\n outs:\n - bar\"\"\"\n ),\n )\n\n dvc.reproduce(PIPELINE_FILE)\n\n dvc_file = Dvcfile(dvc, PIPELINE_FILE)\n\n assert dvc_file.exists()\n assert (tmp_dir / PIPELINE_LOCK).exists()\n assert (tmp_dir / \"foo\").exists()\n assert (tmp_dir / \"bar\").exists()\n\n dvc_file.remove_stage(dvc_file.stages[\"copy-foo-bar\"])\n assert (\n \"# This copies 'foo' text to 'foo' file.\"\n in (tmp_dir / PIPELINE_FILE).read_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/tests/func/test_dvcfile.py_test_dvcfile_dump_preserves_meta_test_dvcfile_dump_preserves_meta.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_dvcfile_dump_preserves_meta_test_dvcfile_dump_preserves_meta.None_2", "embedding": null, "metadata": {"file_path": "tests/func/test_dvcfile.py", "file_name": "test_dvcfile.py", "file_type": "text/x-python", "category": "test", "start_line": 287, "end_line": 299, "span_ids": ["test_dvcfile_dump_preserves_meta"], "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_dvcfile_dump_preserves_meta(tmp_dir, dvc, run_copy):\n tmp_dir.gen(\"foo\", \"foo\")\n stage = run_copy(\"foo\", \"bar\", name=\"run_copy\")\n dvcfile = stage.dvcfile\n\n data = dvcfile._load()[0]\n metadata = {\"name\": \"copy-file\"}\n data[\"stages\"][\"run_copy\"][\"meta\"] = metadata\n dump_yaml(dvcfile.path, data)\n\n dvcfile.dump(stage, update_pipeline=True)\n assert dvcfile._load()[0] == data\n assert dvcfile._load()[0][\"stages\"][\"run_copy\"][\"meta\"] == metadata", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\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_dvcfile_dump_preserves_comments_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dvcfile.py_test_dvcfile_dump_preserves_comments_", "embedding": null, "metadata": {"file_path": "tests/func/test_dvcfile.py", "file_name": "test_dvcfile.py", "file_type": "text/x-python", "category": "test", "start_line": 302, "end_line": 319, "span_ids": ["test_dvcfile_dump_preserves_comments"], "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_dvcfile_dump_preserves_comments(tmp_dir, dvc):\n text = textwrap.dedent(\n \"\"\"\\\n stages:\n generate-foo:\n cmd: echo foo > foo\n # This copies 'foo' text to 'foo' file.\n outs:\n - foo\"\"\"\n )\n tmp_dir.gen(\"dvc.yaml\", text)\n stage = dvc.get_stage(name=\"generate-foo\")\n stage.outs[0].use_cache = False\n dvcfile = stage.dvcfile\n\n dvcfile.dump(stage, update_pipeline=True)\n assert dvcfile._load()[1] == (text + \":\\n\\tcache: false\\n\".expandtabs())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\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": 67, "end_line": 99, "span_ids": ["test_known_sha", "test_pull_subdir_file"], "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": "def test_known_sha(erepo_dir):\n erepo_dir.scm.commit(\"init\")\n\n url = f\"file://{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(os.fspath(erepo_dir)) as repo:\n _, _, save_infos = repo.fetch_external(\n [os.path.join(\"subdir\", \"file\")]\n )\n repo.cache.local.checkout(PathInfo(dest), save_infos[0])\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_gc.py_test_gc_no_dir_cache__count_files.return.sum_len_files_for_____": {"__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__count_files.return.sum_len_files_for_____", "embedding": null, "metadata": {"file_path": "tests/func/test_gc.py", "file_name": "test_gc.py", "file_type": "text/x-python", "category": "test", "start_line": 196, "end_line": 211, "span_ids": ["_count_files", "test_gc_no_dir_cache"], "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_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\n\n\ndef _count_files(path):\n return sum(len(files) for _, _, files in os.walk(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_gc.py_test_gc_no_unpacked_dir_test_gc_no_unpacked_dir.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_gc.py_test_gc_no_unpacked_dir_test_gc_no_unpacked_dir.assert_not_os_path_exists", "embedding": null, "metadata": {"file_path": "tests/func/test_gc.py", "file_name": "test_gc.py", "file_type": "text/x-python", "category": "test", "start_line": 214, "end_line": 228, "span_ids": ["test_gc_no_unpacked_dir"], "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_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 + LocalRemoteTree.UNPACKED_DIR_SUFFIX\n )\n\n # older (pre 1.0) versions of dvc used to generate this dir\n shutil.copytree(\"dir\", unpackeddir)\n assert os.path.exists(unpackeddir)\n\n dvc.gc(force=True, workspace=True)\n assert not os.path.exists(unpackeddir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\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_raises_error_test_gc_cloud_with_or_without_specifier.None_4": {"__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_raises_error_test_gc_cloud_with_or_without_specifier.None_4", "embedding": null, "metadata": {"file_path": "tests/func/test_gc.py", "file_name": "test_gc.py", "file_type": "text/x-python", "category": "test", "start_line": 231, "end_line": 254, "span_ids": ["test_gc_cloud_with_or_without_specifier", "test_gc_without_workspace_raises_error"], "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": "def 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)\n\n\ndef test_gc_cloud_with_or_without_specifier(tmp_dir, erepo_dir, local_cloud):\n erepo_dir.add_remote(config=local_cloud.config)\n dvc = erepo_dir.dvc\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_get.py_test_get_repo_rev_test_get_a_dvc_file.with_pytest_raises_GetDVC.Repo_get_os_fspath_erepo_": {"__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_os_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": 81, "end_line": 98, "span_ids": ["test_get_from_non_dvc_repo", "test_get_repo_rev", "test_get_a_dvc_file"], "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 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(os.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(os.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(os.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_None_1_test_unknown_path.with_pytest_raises_PathMi.Repo_get_os_fspath_erepo_": {"__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_os_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": 136, "end_line": 149, "span_ids": ["test_unknown_path", "test_non_cached_output", "test_absolute_file_outside_repo", "test_absolute_file_outside_git_repo"], "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": "# 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(os.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(os.fspath(git_dir), \"/root/\")\n\n\ndef test_unknown_path(tmp_dir, erepo_dir):\n with pytest.raises(PathMissingError):\n Repo.get(os.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_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_to_dir_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": 152, "end_line": 172, "span_ids": ["test_get_to_dir", "test_get_from_non_dvc_master"], "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(\"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(os.fspath(erepo_dir), \"file\", dname)\n\n assert (tmp_dir / dname).is_dir()\n assert (tmp_dir / dname / \"file\").read_text() == \"contents\"\n\n\ndef test_get_from_non_dvc_master(tmp_dir, git_dir):\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 Repo.get(os.fspath(git_dir), \"some_file\", out=\"some_dst\", rev=\"branch\")\n\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_import.py_test_import_cached_file_test_import_cached_file.assert_filecmp_cmp_erepo_": {"__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_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": 49, "end_line": 64, "span_ids": ["test_import_cached_file"], "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_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(os.fspath(erepo_dir), src, dst)\n\n assert (tmp_dir / dst).is_file()\n assert filecmp.cmp(erepo_dir / src, tmp_dir / dst, 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_import.py_test_import_from_bare_git_repo_test_import_from_bare_git_repo.with_dvc_repo_chdir_.dvc_repo_dvc_imp_os_fspat": {"__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_test_import_from_bare_git_repo.with_dvc_repo_chdir_.dvc_repo_dvc_imp_os_fspat", "embedding": null, "metadata": {"file_path": "tests/func/test_import.py", "file_name": "test_import.py", "file_type": "text/x-python", "category": "test", "start_line": 309, "end_line": 326, "span_ids": ["test_import_from_bare_git_repo"], "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_import_from_bare_git_repo(\n tmp_dir, make_tmp_dir, erepo_dir, local_cloud\n):\n import git\n\n git.Repo.init(os.fspath(tmp_dir), bare=True)\n\n erepo_dir.add_remote(config=local_cloud.config)\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\", os.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(os.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_TestImportFilename_TestImportFilename.test.None_5": {"__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_5", "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": 72, "span_ids": ["TestImportFilename.setUp", "TestImportFilename.test", "TestImportFilename"], "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": "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\", \"--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_lockfile.py_from_collections_import_O_assert_eq_lockfile.assert_previous_new": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_lockfile.py_from_collections_import_O_assert_eq_lockfile.assert_previous_new", "embedding": null, "metadata": {"file_path": "tests/func/test_lockfile.py", "file_name": "test_lockfile.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 33, "span_ids": ["imports", "read_lock_file", "assert_eq_lockfile"], "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": "from collections import OrderedDict\nfrom operator import itemgetter\n\nimport yaml\n\nfrom dvc.dvcfile import PIPELINE_LOCK\nfrom dvc.stage.utils import split_params_deps\nfrom dvc.utils.fs import remove\nfrom dvc.utils.yaml import parse_yaml_for_update\nfrom tests.func.test_run_multistage import supported_params\n\nFS_STRUCTURE = {\n \"foo\": \"bar\\nfoobar\",\n \"bar\": \"foo\\nfoobar\",\n \"foobar\": \"foobar\\nbar\",\n \"params.yaml\": yaml.dump(supported_params),\n \"params2.yaml\": yaml.dump(supported_params),\n}\n\n\ndef read_lock_file(file=PIPELINE_LOCK):\n with open(file) as f:\n data = parse_yaml_for_update(f.read(), file)\n assert isinstance(data, OrderedDict)\n return data\n\n\ndef assert_eq_lockfile(previous, new):\n for content in (previous, new):\n assert isinstance(content, OrderedDict)\n\n # if they both are OrderedDict, then `==` will also check for order\n assert previous == new", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\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_dvc_only_recursive_test_ls_repo_dvc_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_dvc_only_recursive_test_ls_repo_dvc_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": 129, "end_line": 142, "span_ids": ["test_ls_repo_dvc_only_recursive"], "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_repo_dvc_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(os.fspath(tmp_dir), recursive=True, dvc_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_dvc_only_empty.with_pytest_raises_PathMi.Repo_ls_os_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_dvc_only_empty.with_pytest_raises_PathMi.Repo_ls_os_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": 145, "end_line": 168, "span_ids": ["test_ls_repo_with_path_dir_dvc_only_empty", "test_ls_repo_with_path_dir"], "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": "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(os.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_dvc_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(os.fspath(tmp_dir), path=\"folder\", dvc_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_dvc_only_test_ls_repo_with_path_subdir_dvc_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_dvc_only_test_ls_repo_with_path_subdir_dvc_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": 188, "end_line": 205, "span_ids": ["test_ls_repo_with_path_subdir_dvc_only_recursive", "test_ls_repo_with_path_subdir_dvc_only"], "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": "def test_ls_repo_with_path_subdir_dvc_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(os.fspath(tmp_dir), path, dvc_only=True)\n match_files(files, (((\"data.xml\",), True), ((\"statistics\",), False),))\n\n\ndef test_ls_repo_with_path_subdir_dvc_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(os.fspath(tmp_dir), path, dvc_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_remote.py_test_dir_hash_should_be_key_order_agnostic_test_dir_hash_should_be_key_order_agnostic.assert_hash1_hash2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_dir_hash_should_be_key_order_agnostic_test_dir_hash_should_be_key_order_agnostic.assert_hash1_hash2", "embedding": null, "metadata": {"file_path": "tests/func/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 148, "end_line": 173, "span_ids": ["test_dir_hash_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_hash_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 BaseRemoteTree,\n \"_collect_dir\",\n return_value=[\n {\"relpath\": \"1\", \"md5\": \"1\"},\n {\"relpath\": \"2\", \"md5\": \"2\"},\n ],\n ):\n hash1 = dvc.cache.local.get_hash(path_info)\n\n with patch.object(\n BaseRemoteTree,\n \"_collect_dir\",\n return_value=[\n {\"md5\": \"1\", \"relpath\": \"1\"},\n {\"md5\": \"2\", \"relpath\": \"2\"},\n ],\n ):\n hash2 = dvc.cache.local.get_hash(path_info)\n\n assert hash1 == hash2", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\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_external_dir_resource_on_no_cache_test_external_dir_resource_on_no_cache.with_pytest_raises_Remote.dvc_run_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_external_dir_resource_on_no_cache_test_external_dir_resource_on_no_cache.with_pytest_raises_Remote.dvc_run_", "embedding": null, "metadata": {"file_path": "tests/func/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 231, "end_line": 243, "span_ids": ["test_external_dir_resource_on_no_cache"], "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_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(\n cmd=\"echo hello world\",\n deps=[os.fspath(external_dir)],\n single_stage=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_remote.py_test_push_order_test_remote_modify_validation.assert_unsupported_config": {"__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_remote_modify_validation.assert_unsupported_config", "embedding": null, "metadata": {"file_path": "tests/func/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 246, "end_line": 271, "span_ids": ["test_remote_modify_validation", "test_push_order"], "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_push_order(tmp_dir, dvc, tmp_path_factory, mocker, local_remote):\n tmp_dir.dvc_gen({\"foo\": {\"bar\": \"bar content\"}})\n tmp_dir.dvc_gen({\"baz\": \"baz content\"})\n\n mocked_upload = mocker.patch.object(\n LocalRemoteTree, \"_upload\", return_value=0\n )\n dvc.push()\n # last uploaded file should be dir checksum\n assert mocked_upload.call_args[0][0].endswith(\".dir\")\n\n\ndef 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[f'remote \"{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_remote.py_test_remote_modify_unset_test_remote_modify_unset.None_5": {"__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_unset_test_remote_modify_unset.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": 274, "end_line": 294, "span_ids": ["test_remote_modify_unset"], "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_remote_modify_unset(dvc):\n assert main([\"remote\", \"add\", \"-d\", \"myremote\", \"gdrive://test/test\"]) == 0\n config = configobj.ConfigObj(dvc.config.files[\"repo\"])\n assert config['remote \"myremote\"'] == {\"url\": \"gdrive://test/test\"}\n\n assert (\n main([\"remote\", \"modify\", \"myremote\", \"gdrive_client_id\", \"something\"])\n == 0\n )\n config = configobj.ConfigObj(dvc.config.files[\"repo\"])\n assert config['remote \"myremote\"'] == {\n \"url\": \"gdrive://test/test\",\n \"gdrive_client_id\": \"something\",\n }\n\n assert (\n main([\"remote\", \"modify\", \"myremote\", \"gdrive_client_id\", \"--unset\"])\n == 0\n )\n config = configobj.ConfigObj(dvc.config.files[\"repo\"])\n assert config['remote \"myremote\"'] == {\"url\": \"gdrive://test/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_remote.py_test_remote_modify_default_test_remote_modify_default.assert_local_config_core": {"__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_default_test_remote_modify_default.assert_local_config_core", "embedding": null, "metadata": {"file_path": "tests/func/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 297, "end_line": 312, "span_ids": ["test_remote_modify_default"], "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_remote_modify_default(dvc):\n remote_repo = \"repo_level\"\n remote_local = \"local_level\"\n wrong_name = \"anything\"\n assert main([\"remote\", \"add\", remote_repo, \"s3://bucket/repo\"]) == 0\n assert main([\"remote\", \"add\", remote_local, \"s3://bucket/local\"]) == 0\n\n assert main([\"remote\", \"default\", wrong_name]) == 251\n assert main([\"remote\", \"default\", remote_repo]) == 0\n assert main([\"remote\", \"default\", \"--local\", remote_local]) == 0\n\n repo_config = configobj.ConfigObj(dvc.config.files[\"repo\"])\n local_config = configobj.ConfigObj(dvc.config.files[\"local\"])\n\n assert repo_config[\"core\"][\"remote\"] == remote_repo\n assert local_config[\"core\"][\"remote\"] == remote_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_remote.py_test_remote_rename_test_remote_rename.assert_config_remote_n": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_remote_rename_test_remote_rename.assert_config_remote_n", "embedding": null, "metadata": {"file_path": "tests/func/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 315, "end_line": 337, "span_ids": ["test_remote_rename"], "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": "def test_remote_rename(dvc):\n remote_name = \"drive\"\n remote_url = \"gdrive://test/test\"\n new_name = \"new\"\n other_name = \"other\"\n # prepare\n assert main([\"remote\", \"add\", remote_name, remote_url]) == 0\n config = dvc.config.load_one(\"repo\")\n assert config[\"remote\"][remote_name][\"url\"] == remote_url\n assert new_name not in config.get(\"remote\", {})\n\n # rename failed\n assert main([\"remote\", \"rename\", remote_name]) == 254\n assert main([\"remote\", \"rename\", new_name, other_name]) == 251\n config = dvc.config.load_one(\"repo\")\n assert config[\"remote\"][remote_name][\"url\"] == remote_url\n assert new_name not in config.get(\"remote\", {})\n\n # rename success\n assert main([\"remote\", \"rename\", remote_name, new_name]) == 0\n config = dvc.config.load_one(\"repo\")\n assert remote_name not in config.get(\"remote\", {})\n assert config[\"remote\"][new_name][\"url\"] == remote_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_remote.py_test_remote_duplicated_test_remote_duplicated.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_remote_duplicated_test_remote_duplicated.None_6", "embedding": null, "metadata": {"file_path": "tests/func/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 340, "end_line": 358, "span_ids": ["test_remote_duplicated"], "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_remote_duplicated(dvc):\n remote_name = \"drive\"\n remote_url = \"gdrive://test/test\"\n used_name = \"overlap\"\n another_url = \"gdrive://test/test1\"\n # prepare\n assert main([\"remote\", \"add\", remote_name, remote_url]) == 0\n assert main([\"remote\", \"add\", \"--local\", used_name, another_url]) == 0\n config = dvc.config.load_one(\"repo\")\n assert config[\"remote\"][remote_name][\"url\"] == remote_url\n local_config = dvc.config.load_one(\"local\")\n assert local_config[\"remote\"][used_name][\"url\"] == another_url\n\n # rename duplicated\n assert main([\"remote\", \"rename\", remote_name, used_name]) == 251\n config = dvc.config.load_one(\"repo\")\n assert config[\"remote\"][remote_name][\"url\"] == remote_url\n local_config = dvc.config.load_one(\"local\")\n assert local_config[\"remote\"][used_name][\"url\"] == another_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_remote.py_test_remote_default_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_remote_default_", "embedding": null, "metadata": {"file_path": "tests/func/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 361, "end_line": 395, "span_ids": ["test_remote_default", "test_protect_local_remote"], "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": "def test_remote_default(dvc):\n remote_name = \"drive\"\n remote_url = \"gdrive://test/test\"\n new_name = \"new\"\n # prepare\n assert main([\"remote\", \"add\", \"-d\", remote_name, remote_url]) == 0\n assert main([\"remote\", \"default\", \"--local\", remote_name]) == 0\n config = dvc.config.load_one(\"repo\")\n assert config[\"core\"][\"remote\"] == remote_name\n assert config[\"remote\"][remote_name][\"url\"] == remote_url\n assert new_name not in config.get(\"remote\", {})\n local_config = dvc.config.load_one(\"local\")\n assert local_config[\"core\"][\"remote\"] == remote_name\n\n # rename success\n assert main([\"remote\", \"rename\", remote_name, new_name]) == 0\n config = dvc.config.load_one(\"repo\")\n assert remote_name not in config.get(\"remote\", {})\n assert config[\"core\"][\"remote\"] == new_name\n assert config[\"remote\"][new_name][\"url\"] == remote_url\n assert remote_name not in config.get(\"remote\", {})\n local_config = dvc.config.load_one(\"local\")\n assert local_config[\"core\"][\"remote\"] == new_name\n\n\ndef test_protect_local_remote(tmp_dir, dvc, local_remote):\n (stage,) = tmp_dir.dvc_gen(\"file\", \"file content\")\n\n dvc.push()\n remote = dvc.cloud.get_remote(\"upstream\")\n remote_cache_file = remote.hash_to_path_info(stage.outs[0].checksum)\n\n assert os.path.exists(remote_cache_file)\n assert stat.S_IMODE(os.stat(remote_cache_file).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_remove.py_test_remove_non_existent_file_test_remove_broken_symlink.assert_not_tmp_dir_sta": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remove.py_test_remove_non_existent_file_test_remove_broken_symlink.assert_not_tmp_dir_sta", "embedding": null, "metadata": {"file_path": "tests/func/test_remove.py", "file_name": "test_remove.py", "file_type": "text/x-python", "category": "test", "start_line": 28, "end_line": 50, "span_ids": ["test_remove_non_existent_file", "test_remove_broken_symlink"], "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_remove_non_existent_file(tmp_dir, dvc):\n with pytest.raises(StageFileDoesNotExistError):\n dvc.remove(\"non_existent_dvc_file.dvc\")\n with pytest.raises(StageFileDoesNotExistError):\n dvc.remove(\"non_existent_stage_name\")\n\n\ndef test_remove_broken_symlink(tmp_dir, dvc):\n tmp_dir.gen(\"foo\", \"foo\")\n dvc.cache.local.cache_types = [\"symlink\"]\n\n (stage,) = dvc.add(\"foo\")\n remove(dvc.cache.local.cache_dir)\n assert System.is_symlink(\"foo\")\n\n with pytest.raises(DvcException):\n dvc.remove(stage.addressing)\n assert os.path.lexists(\"foo\")\n assert (tmp_dir / stage.relpath).exists()\n\n dvc.remove(stage.addressing, outs=True)\n assert not os.path.lexists(\"foo\")\n assert not (tmp_dir / stage.relpath).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_remove.py_test_cmd_remove_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remove.py_test_cmd_remove_", "embedding": null, "metadata": {"file_path": "tests/func/test_remove.py", "file_name": "test_remove.py", "file_type": "text/x-python", "category": "test", "start_line": 53, "end_line": 65, "span_ids": ["test_cmd_remove"], "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": "def test_cmd_remove(tmp_dir, dvc):\n assert main([\"remove\", \"non-existing-dvc-file\"]) == 1\n\n (stage,) = tmp_dir.dvc_gen(\"foo\", \"foo\")\n assert main([\"remove\", stage.addressing]) == 0\n assert not (tmp_dir / stage.relpath).exists()\n assert (tmp_dir / \"foo\").exists()\n\n (stage,) = tmp_dir.dvc_gen(\"foo\", \"foo\")\n assert main([\"remove\", stage.addressing, \"--outs\"]) == 0\n assert not (tmp_dir / stage.relpath).exists()\n assert not (tmp_dir / \"foo\").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_repo.py_test_collect_test_collect.None_10": {"__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_10", "embedding": null, "metadata": {"file_path": "tests/func/test_repo.py", "file_name": "test_repo.py", "file_type": "text/x-python", "category": "test", "start_line": 70, "end_line": 115, "span_ids": ["test_collect"], "tokens": 431}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 {\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\", single_stage=True)\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\", single_stage=True)\n scm.add([\".gitignore\", \"buzz.dvc\"])\n scm.commit(\"Add buzz\")\n\n assert collect_outs(\"bar.dvc\", with_deps=True) == {\"foo\", \"bar\"}\n assert collect_outs(\"buzz.dvc\", with_deps=True) == {\"foo\", \"bar\", \"buzz\"}\n assert collect_outs(\"buzz.dvc\", with_deps=False) == {\"buzz\"}\n\n run_copy(\"foo\", \"foobar\", name=\"copy-foo-foobar\")\n assert collect_outs(\":copy-foo-foobar\") == {\"foobar\"}\n assert collect_outs(\":copy-foo-foobar\", with_deps=True) == {\n \"foobar\",\n \"foo\",\n }\n assert collect_outs(\"dvc.yaml:copy-foo-foobar\", recursive=True) == {\n \"foobar\"\n }\n assert collect_outs(\"copy-foo-foobar\") == {\"foobar\"}\n assert collect_outs(\"copy-foo-foobar\", with_deps=True) == {\n \"foobar\",\n \"foo\",\n }\n assert collect_outs(\"copy-foo-foobar\", recursive=True) == {\"foobar\"}\n\n run_copy(\"foobar\", \"baz\", name=\"copy-foobar-baz\")\n assert collect_outs(\"dvc.yaml\") == {\"foobar\", \"baz\"}\n assert collect_outs(\"dvc.yaml\", with_deps=True) == {\n \"foobar\",\n \"baz\",\n \"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_repo.py_test_collect_dir_recursive_test_collect_with_not_existing_output_or_stage_name.with_pytest_raises_StageN.dvc_collect_some_file_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_test_collect_dir_recursive_test_collect_with_not_existing_output_or_stage_name.with_pytest_raises_StageN.dvc_collect_some_file_", "embedding": null, "metadata": {"file_path": "tests/func/test_repo.py", "file_name": "test_repo.py", "file_type": "text/x-python", "category": "test", "start_line": 118, "end_line": 135, "span_ids": ["test_collect_dir_recursive", "test_collect_with_not_existing_output_or_stage_name"], "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 test_collect_dir_recursive(tmp_dir, dvc, run_head):\n tmp_dir.gen({\"dir\": {\"foo\": \"foo\"}})\n (stage1,) = dvc.add(\"dir\", recursive=True)\n with (tmp_dir / \"dir\").chdir():\n stage2 = run_head(\"foo\", name=\"copy-foo-bar\")\n stage3 = run_head(\"foo-1\", single_stage=True)\n assert set(dvc.collect(\"dir\", recursive=True)) == {stage1, stage2, stage3}\n\n\ndef test_collect_with_not_existing_output_or_stage_name(\n tmp_dir, dvc, run_copy\n):\n with pytest.raises(StageFileDoesNotExistError):\n dvc.collect(\"some_file\")\n tmp_dir.dvc_gen(\"foo\", \"foo\")\n run_copy(\"foo\", \"bar\", name=\"copy-foo-bar\")\n with pytest.raises(StageNotFound):\n dvc.collect(\"some_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_repo.py_stages_test_collect_granular_with_no_target.assert_list_map_itemgette": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_stages_test_collect_granular_with_no_target.assert_list_map_itemgette", "embedding": null, "metadata": {"file_path": "tests/func/test_repo.py", "file_name": "test_repo.py", "file_type": "text/x-python", "category": "test", "start_line": 155, "end_line": 173, "span_ids": ["test_collect_granular_with_no_target", "stages"], "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.fixture\ndef stages(tmp_dir, run_copy):\n stage1, stage2 = tmp_dir.dvc_gen({\"foo\": \"foo\", \"lorem\": \"lorem\"})\n return {\n \"foo-generate\": stage1,\n \"lorem-generate\": stage2,\n \"copy-foo-bar\": run_copy(\"foo\", \"bar\", single_stage=True),\n \"copy-bar-foobar\": run_copy(\"bar\", \"foobar\", name=\"copy-bar-foobar\"),\n \"copy-lorem-ipsum\": run_copy(\"lorem\", \"ipsum\", name=\"lorem-ipsum\"),\n }\n\n\ndef test_collect_granular_with_no_target(tmp_dir, dvc, stages):\n assert set(map(itemgetter(0), dvc.collect_granular())) == set(\n stages.values()\n )\n assert list(map(itemgetter(1), dvc.collect_granular())) == [None] * len(\n stages\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_repo.py_test_collect_granular_with_target_test_collect_granular_with_target.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_test_collect_granular_with_target_test_collect_granular_with_target.None_6", "embedding": null, "metadata": {"file_path": "tests/func/test_repo.py", "file_name": "test_repo.py", "file_type": "text/x-python", "category": "test", "start_line": 176, "end_line": 203, "span_ids": ["test_collect_granular_with_target"], "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": "def test_collect_granular_with_target(tmp_dir, dvc, stages):\n assert dvc.collect_granular(\"bar.dvc\") == [(stages[\"copy-foo-bar\"], None)]\n assert dvc.collect_granular(PIPELINE_FILE) == [\n (stages[\"copy-bar-foobar\"], None),\n (stages[\"copy-lorem-ipsum\"], None),\n ]\n assert dvc.collect_granular(\":\") == [\n (stages[\"copy-bar-foobar\"], None),\n (stages[\"copy-lorem-ipsum\"], None),\n ]\n assert dvc.collect_granular(\"copy-bar-foobar\") == [\n (stages[\"copy-bar-foobar\"], None)\n ]\n assert dvc.collect_granular(\":copy-bar-foobar\") == [\n (stages[\"copy-bar-foobar\"], None)\n ]\n assert dvc.collect_granular(\"dvc.yaml:copy-bar-foobar\") == [\n (stages[\"copy-bar-foobar\"], None)\n ]\n\n with (tmp_dir / dvc.DVC_DIR).chdir():\n assert dvc.collect_granular(\n relpath(tmp_dir / PIPELINE_FILE) + \":copy-bar-foobar\"\n ) == [(stages[\"copy-bar-foobar\"], None)]\n\n assert dvc.collect_granular(\"foobar\") == [\n (stages[\"copy-bar-foobar\"], PathInfo(tmp_dir / \"foobar\"))\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_repo.py_test_collect_with_not_existing_dvcfile_test_collect_granular_with_not_existing_output_or_stage_name.None_1.dvc_collect_granular_som": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_test_collect_with_not_existing_dvcfile_test_collect_granular_with_not_existing_output_or_stage_name.None_1.dvc_collect_granular_som", "embedding": null, "metadata": {"file_path": "tests/func/test_repo.py", "file_name": "test_repo.py", "file_type": "text/x-python", "category": "test", "start_line": 206, "end_line": 226, "span_ids": ["test_collect_granular_with_not_existing_output_or_stage_name", "test_collect_with_not_existing_dvcfile"], "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": "@pytest.mark.parametrize(\n \"target\",\n [\n \"not_existing.dvc\",\n \"not_existing.dvc:stage_name\",\n \"not_existing/dvc.yaml\",\n \"not_existing/dvc.yaml:stage_name\",\n ],\n)\ndef test_collect_with_not_existing_dvcfile(tmp_dir, dvc, target):\n with pytest.raises(StageFileDoesNotExistError):\n dvc.collect_granular(target)\n with pytest.raises(StageFileDoesNotExistError):\n dvc.collect(target)\n\n\ndef test_collect_granular_with_not_existing_output_or_stage_name(tmp_dir, dvc):\n with pytest.raises(NoOutputOrStageError):\n dvc.collect_granular(\"some_file\")\n with pytest.raises(NoOutputOrStageError):\n dvc.collect_granular(\"some_file\", 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_repo.py_test_collect_granular_with_deps_test_collect_granular_with_deps.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_granular_with_deps_test_collect_granular_with_deps.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": 229, "end_line": 247, "span_ids": ["test_collect_granular_with_deps"], "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_collect_granular_with_deps(tmp_dir, dvc, stages):\n assert set(\n map(itemgetter(0), dvc.collect_granular(\"bar.dvc\", with_deps=True))\n ) == {stages[\"copy-foo-bar\"], stages[\"foo-generate\"]}\n assert set(\n map(\n itemgetter(0),\n dvc.collect_granular(\"copy-bar-foobar\", with_deps=True),\n )\n ) == {\n stages[\"copy-bar-foobar\"],\n stages[\"copy-foo-bar\"],\n stages[\"foo-generate\"],\n }\n assert set(\n map(\n itemgetter(0), dvc.collect_granular(PIPELINE_FILE, with_deps=True),\n )\n ) == set(stages.values())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\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_granular_same_output_name_stage_name_test_collect_granular_same_output_name_stage_name.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_test_collect_granular_same_output_name_stage_name_test_collect_granular_same_output_name_stage_name.None_6", "embedding": null, "metadata": {"file_path": "tests/func/test_repo.py", "file_name": "test_repo.py", "file_type": "text/x-python", "category": "test", "start_line": 250, "end_line": 266, "span_ids": ["test_collect_granular_same_output_name_stage_name"], "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_collect_granular_same_output_name_stage_name(tmp_dir, dvc, run_copy):\n (stage1,) = tmp_dir.dvc_gen(\"foo\", \"foo\")\n (stage2,) = tmp_dir.dvc_gen(\"copy-foo-bar\", \"copy-foo-bar\")\n stage3 = run_copy(\"foo\", \"bar\", name=\"copy-foo-bar\")\n\n assert dvc.collect_granular(\"copy-foo-bar\") == [(stage3, None)]\n\n coll = dvc.collect_granular(\"copy-foo-bar\", with_deps=True)\n assert set(map(itemgetter(0), coll)) == {stage3, stage1}\n assert list(map(itemgetter(1), coll)) == [None] * 2\n\n assert dvc.collect_granular(\"./copy-foo-bar\") == [\n (stage2, PathInfo(tmp_dir / \"copy-foo-bar\"))\n ]\n assert dvc.collect_granular(\"./copy-foo-bar\", with_deps=True) == [\n (stage2, PathInfo(tmp_dir / \"copy-foo-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_repo.py_test_collect_granular_priority_on_collision_test_collect_granular_priority_on_collision.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_test_collect_granular_priority_on_collision_test_collect_granular_priority_on_collision.None_4", "embedding": null, "metadata": {"file_path": "tests/func/test_repo.py", "file_name": "test_repo.py", "file_type": "text/x-python", "category": "test", "start_line": 269, "end_line": 280, "span_ids": ["test_collect_granular_priority_on_collision"], "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_collect_granular_priority_on_collision(tmp_dir, dvc, run_copy):\n tmp_dir.gen({\"dir\": {\"foo\": \"foo\"}, \"foo\": \"foo\"})\n (stage1,) = dvc.add(\"dir\", recursive=True)\n stage2 = run_copy(\"foo\", \"bar\", name=\"dir\")\n\n assert dvc.collect_granular(\"dir\") == [(stage2, None)]\n assert dvc.collect_granular(\"dir\", recursive=True) == [(stage1, None)]\n\n remove(tmp_dir / \"dir\")\n\n assert dvc.collect_granular(\"dir\") == [(stage2, None)]\n assert dvc.collect_granular(\"dir\", recursive=True) == [(stage2, 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_repo.py_test_collect_granular_collision_output_dir_stage_name_test_collect_granular_collision_output_dir_stage_name.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_test_collect_granular_collision_output_dir_stage_name_test_collect_granular_collision_output_dir_stage_name.None_3", "embedding": null, "metadata": {"file_path": "tests/func/test_repo.py", "file_name": "test_repo.py", "file_type": "text/x-python", "category": "test", "start_line": 283, "end_line": 293, "span_ids": ["test_collect_granular_collision_output_dir_stage_name"], "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_collect_granular_collision_output_dir_stage_name(\n tmp_dir, dvc, run_copy\n):\n stage1, *_ = tmp_dir.dvc_gen({\"dir\": {\"foo\": \"foo\"}, \"foo\": \"foo\"})\n stage3 = run_copy(\"foo\", \"bar\", name=\"dir\")\n\n assert dvc.collect_granular(\"dir\") == [(stage3, None)]\n assert not dvc.collect_granular(\"dir\", recursive=True)\n assert dvc.collect_granular(\"./dir\") == [\n (stage1, PathInfo(tmp_dir / \"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_repo.py_test_collect_granular_not_existing_stage_name_test_collect_granular_not_existing_stage_name.with_pytest_raises_StageN.dvc_collect_granular_dvc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_test_collect_granular_not_existing_stage_name_test_collect_granular_not_existing_stage_name.with_pytest_raises_StageN.dvc_collect_granular_dvc", "embedding": null, "metadata": {"file_path": "tests/func/test_repo.py", "file_name": "test_repo.py", "file_type": "text/x-python", "category": "test", "start_line": 296, "end_line": 305, "span_ids": ["test_collect_granular_not_existing_stage_name"], "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_collect_granular_not_existing_stage_name(tmp_dir, dvc, run_copy):\n tmp_dir.dvc_gen(\"foo\", \"foo\")\n (stage,) = tmp_dir.dvc_gen(\"copy-foo-bar\", \"copy-foo-bar\")\n run_copy(\"foo\", \"bar\", name=\"copy-foo-bar\")\n\n assert dvc.collect_granular(\"copy-foo-bar.dvc:stage_name_not_needed\") == [\n (stage, None)\n ]\n with pytest.raises(StageNotFound):\n dvc.collect_granular(\"dvc.yaml:does-not-exist\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\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_get_stages_test_get_stages.with_pytest_raises_StageN.dvc_get_stages_path_PIPEL": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_test_get_stages_test_get_stages.with_pytest_raises_StageN.dvc_get_stages_path_PIPEL", "embedding": null, "metadata": {"file_path": "tests/func/test_repo.py", "file_name": "test_repo.py", "file_type": "text/x-python", "category": "test", "start_line": 308, "end_line": 327, "span_ids": ["test_get_stages"], "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": "def test_get_stages(tmp_dir, dvc, run_copy):\n with pytest.raises(StageFileDoesNotExistError):\n dvc.get_stages()\n\n tmp_dir.gen(\"foo\", \"foo\")\n stage1 = run_copy(\"foo\", \"bar\", name=\"copy-foo-bar\")\n stage2 = run_copy(\"bar\", \"foobar\", name=\"copy-bar-foobar\")\n\n assert set(dvc.get_stages()) == {stage1, stage2}\n assert set(dvc.get_stages(path=PIPELINE_FILE)) == {stage1, stage2}\n assert set(dvc.get_stages(name=\"copy-bar-foobar\")) == {stage2}\n assert set(dvc.get_stages(path=PIPELINE_FILE, name=\"copy-bar-foobar\")) == {\n stage2\n }\n\n with pytest.raises(StageFileDoesNotExistError):\n dvc.get_stages(path=relpath(tmp_dir / \"..\" / PIPELINE_FILE))\n\n with pytest.raises(StageNotFound):\n dvc.get_stages(path=PIPELINE_FILE, name=\"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_repo.py_test_get_stages_old_dvcfile_test_get_stages_old_dvcfile.with_pytest_raises_StageF.dvc_get_stages_path_relpa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_test_get_stages_old_dvcfile_test_get_stages_old_dvcfile.with_pytest_raises_StageF.dvc_get_stages_path_relpa", "embedding": null, "metadata": {"file_path": "tests/func/test_repo.py", "file_name": "test_repo.py", "file_type": "text/x-python", "category": "test", "start_line": 330, "end_line": 336, "span_ids": ["test_get_stages_old_dvcfile"], "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_get_stages_old_dvcfile(tmp_dir, dvc):\n (stage1,) = tmp_dir.dvc_gen(\"foo\", \"foo\")\n assert set(dvc.get_stages(\"foo.dvc\")) == {stage1}\n assert set(dvc.get_stages(\"foo.dvc\", name=\"foo-generate\")) == {stage1}\n\n with pytest.raises(StageFileDoesNotExistError):\n dvc.get_stages(path=relpath(tmp_dir / \"..\" / \"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_repo.py_test_get_stage_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_test_get_stage_", "embedding": null, "metadata": {"file_path": "tests/func/test_repo.py", "file_name": "test_repo.py", "file_type": "text/x-python", "category": "test", "start_line": 339, "end_line": 365, "span_ids": ["test_get_stage_single_stage_dvcfile", "test_get_stage"], "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_get_stage(tmp_dir, dvc, run_copy):\n tmp_dir.gen(\"foo\", \"foo\")\n stage1 = run_copy(\"foo\", \"bar\", name=\"copy-foo-bar\")\n\n with pytest.raises(StageNameUnspecified):\n dvc.get_stage()\n\n with pytest.raises(StageNameUnspecified):\n dvc.get_stage(path=PIPELINE_FILE)\n\n assert dvc.get_stage(path=PIPELINE_FILE, name=\"copy-foo-bar\") == stage1\n assert dvc.get_stage(name=\"copy-foo-bar\") == stage1\n\n with pytest.raises(StageFileDoesNotExistError):\n dvc.get_stage(path=\"something.yaml\", name=\"name\")\n\n with pytest.raises(StageNotFound):\n dvc.get_stage(name=\"random_name\")\n\n\ndef test_get_stage_single_stage_dvcfile(tmp_dir, dvc):\n (stage1,) = tmp_dir.dvc_gen(\"foo\", \"foo\")\n assert dvc.get_stage(\"foo.dvc\") == stage1\n assert dvc.get_stage(\"foo.dvc\", name=\"jpt\") == stage1\n with pytest.raises(StageFileDoesNotExistError):\n dvc.get_stage(path=\"bar.dvc\", name=\"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_addressing": {"__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_addressing", "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": 36, "span_ids": ["imports", "SingleStageRun._run", "SingleStageRun", "SingleStageRun._get_stage_target"], "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": "import filecmp\nimport os\nimport re\nimport shutil\nfrom pathlib import Path\n\nimport pytest\nfrom mock import patch\n\nfrom dvc.dvcfile import DVC_FILE, Dvcfile\nfrom dvc.exceptions import (\n CyclicGraphError,\n ReproductionError,\n StagePathAsOutputError,\n)\nfrom dvc.main import main\nfrom dvc.output.base import BaseOutput\nfrom dvc.remote.local import LocalRemoteTree\nfrom dvc.stage import Stage\nfrom dvc.stage.exceptions import StageFileDoesNotExistError\nfrom dvc.system import System\nfrom dvc.utils import file_md5, relpath\nfrom dvc.utils.fs import remove\nfrom dvc.utils.yaml import dump_yaml, load_yaml\nfrom tests.basic_env import TestDvc\n\n\nclass SingleStageRun:\n def _run(self, **kwargs):\n kwargs[\"single_stage\"] = True\n kwargs.pop(\"name\", None)\n return self.dvc.run(**kwargs) # noqa, pylint: disable=no-member\n\n @staticmethod\n def _get_stage_target(stage):\n return stage.addressing", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\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_TestReproForceDownstream_TestReproForceDownstream.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_TestReproForceDownstream_TestReproForceDownstream.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": 451, "end_line": 497, "span_ids": ["TestReproForceDownstream.test", "TestReproForceDownstream"], "tokens": 393}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproForceDownstream(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=f\"python {code1} {self.FOO} {file1}\",\n single_stage=True,\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=f\"python {code2} {file1} {file2}\",\n single_stage=True,\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=f\"python {code3} {file2} {file3}\",\n single_stage=True,\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, force_downstream=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_TestReproFrozen_TestReproFrozen.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_TestReproFrozen_TestReproFrozen.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": 557, "end_line": 580, "span_ids": ["TestReproFrozen.test", "TestReproFrozen"], "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 TestReproFrozen(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=f\"python {self.CODE} {self.file1} {file2}\",\n name=\"copy-file1-file2\",\n )\n\n self.swap_foo_with_bar()\n\n ret = main([\"freeze\", 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([\"unfreeze\", 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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\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_TestReproFrozen.test_non_existing_TestReproFrozen.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_TestReproFrozen.test_non_existing_TestReproFrozen.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": 582, "end_line": 593, "span_ids": ["TestReproFrozen.test_non_existing"], "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 TestReproFrozen(TestReproChangedData):\n\n def test_non_existing(self):\n with self.assertRaises(StageFileDoesNotExistError):\n self.dvc.freeze(\"Dvcfile\")\n self.dvc.freeze(\"pipelines.yaml\")\n self.dvc.freeze(\"pipelines.yaml:name\")\n self.dvc.freeze(\"Dvcfile:name\")\n self.dvc.freeze(\"stage.dvc\")\n self.dvc.freeze(\"stage.dvc:name\")\n self.dvc.freeze(\"not-existing-stage.json\")\n\n ret = main([\"freeze\", \"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_TestReproFrozenCallback_TestReproFrozenUnchanged.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_TestReproFrozenCallback_TestReproFrozenUnchanged.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": 596, "end_line": 634, "span_ids": ["TestReproFrozenUnchanged.test", "TestReproFrozenCallback", "TestReproFrozenCallback.test", "TestReproFrozenUnchanged"], "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": "class TestReproFrozenCallback(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=f\"python {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.freeze(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.unfreeze(self._get_stage_target(stage))\n stages = self.dvc.reproduce(self._get_stage_target(stage))\n self.assertEqual(len(stages), 1)\n\n\nclass TestReproFrozenUnchanged(TestRepro):\n def test(self):\n \"\"\"\n Check that freezing/unfreezing doesn't affect stage state\n \"\"\"\n target = self._get_stage_target(self.stage)\n self.dvc.freeze(target)\n stages = self.dvc.reproduce(target)\n self.assertEqual(len(stages), 0)\n\n self.dvc.unfreeze(target)\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_test_repro_when_cmd_changes_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_repro_when_cmd_changes_", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1785, "end_line": 1805, "span_ids": ["test_repro_when_cmd_changes"], "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": "def test_repro_when_cmd_changes(tmp_dir, dvc, run_copy, mocker):\n from dvc.dvcfile import SingleStageFile\n\n tmp_dir.gen(\"foo\", \"foo\")\n stage = run_copy(\"foo\", \"bar\", single_stage=True)\n assert not dvc.reproduce(stage.addressing)\n\n from dvc.stage.run import cmd_run\n\n m = mocker.patch(\"dvc.stage.run.cmd_run\", wraps=cmd_run)\n\n data = SingleStageFile(dvc, stage.path)._load()[0]\n data[\"cmd\"] = \" \".join(stage.cmd.split()) # change cmd spacing by two\n dump_yaml(stage.path, data)\n\n assert dvc.status([stage.addressing]) == {\n stage.addressing: [\"changed checksum\"]\n }\n assert dvc.reproduce(stage.addressing)[0] == stage\n m.assert_called_once_with(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_TestReproChangedDirDataMultiStage_test_non_existing_stage_name.assert_main_freeze_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro_multistage.py_TestReproChangedDirDataMultiStage_test_non_existing_stage_name.assert_main_freeze_", "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": 156, "end_line": 171, "span_ids": ["test_non_existing_stage_name", "TestReproChangedDirDataMultiStage"], "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 TestReproChangedDirDataMultiStage(\n MultiStageRun, test_repro.TestReproChangedDirData\n):\n pass\n\n\ndef 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.freeze(\":copy-file1-file3\")\n\n assert main([\"freeze\", \":copy-file1-file3\"]) != 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_multistage.py_test_repro_when_cmd_changes_test_repro_when_cmd_changes.m_assert_called_once_with": {"__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.m_assert_called_once_with", "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": 310, "end_line": 326, "span_ids": ["test_repro_when_cmd_changes"], "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_repro_when_cmd_changes(tmp_dir, dvc, run_copy, mocker):\n from dvc.dvcfile import PipelineFile\n\n tmp_dir.gen(\"foo\", \"foo\")\n stage = run_copy(\"foo\", \"bar\", name=\"copy-file\")\n target = \"copy-file\"\n assert not dvc.reproduce(target)\n\n from dvc.stage.run import cmd_run\n\n m = mocker.patch(\"dvc.stage.run.cmd_run\", wraps=cmd_run)\n stage.cmd = \" \".join(stage.cmd.split()) # change cmd spacing by two\n PipelineFile(dvc, PIPELINE_FILE)._dump_pipeline_file(stage)\n\n assert dvc.status([target]) == {target: [\"changed command\"]}\n assert dvc.reproduce(target)[0] == stage\n m.assert_called_once_with(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_run_cache.py_os_test_push_pull.with_erepo_dir_chdir_.assert_os_listdir_erepo_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_cache.py_os_test_push_pull.with_erepo_dir_chdir_.assert_os_listdir_erepo_d", "embedding": null, "metadata": {"file_path": "tests/func/test_run_cache.py", "file_name": "test_run_cache.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 19, "span_ids": ["imports", "test_push_pull", "_recurse_count_files"], "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 os\n\nfrom dvc.dvcfile import PIPELINE_LOCK\nfrom dvc.utils import relpath\n\n\ndef _recurse_count_files(path):\n return len([os.path.join(r, f) for r, _, fs in os.walk(path) for f in fs])\n\n\ndef test_push_pull(tmp_dir, dvc, erepo_dir, run_copy, local_remote):\n tmp_dir.gen(\"foo\", \"foo\")\n run_copy(\"foo\", \"bar\", name=\"copy-foo-bar\")\n assert dvc.push(run_cache=True) == 2\n erepo_dir.add_remote(config=local_remote.config)\n with erepo_dir.chdir():\n assert not os.path.exists(erepo_dir.dvc.stage_cache.cache_dir)\n assert erepo_dir.dvc.pull(run_cache=True)[\"fetched\"] == 2\n assert os.listdir(erepo_dir.dvc.stage_cache.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_run_cache.py_test_restore_test_restore.assert_tmp_dir_PIPELIN": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_cache.py_test_restore_test_restore.assert_tmp_dir_PIPELIN", "embedding": null, "metadata": {"file_path": "tests/func/test_run_cache.py", "file_name": "test_run_cache.py", "file_type": "text/x-python", "category": "test", "start_line": 22, "end_line": 38, "span_ids": ["test_restore"], "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_restore(tmp_dir, dvc, run_copy, mocker):\n tmp_dir.gen(\"foo\", \"foo\")\n run_copy(\"foo\", \"bar\", name=\"copy-foo-bar\")\n\n mock_restore = mocker.spy(dvc.stage_cache, \"restore\")\n mock_run = mocker.patch(\"dvc.stage.run.cmd_run\")\n\n # removing any information that `dvc` could use to re-generate from\n (tmp_dir / \"bar\").unlink()\n (tmp_dir / PIPELINE_LOCK).unlink()\n\n (stage,) = dvc.reproduce(\"copy-foo-bar\")\n\n mock_restore.assert_called_once_with(stage)\n mock_run.assert_not_called()\n assert (tmp_dir / \"bar\").exists() and not (tmp_dir / \"foo\").unlink()\n assert (tmp_dir / PIPELINE_LOCK).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_run_cache.py_test_save_test_uncached_outs_are_cached.assert_os_path_exists_rel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_cache.py_test_save_test_uncached_outs_are_cached.assert_os_path_exists_rel", "embedding": null, "metadata": {"file_path": "tests/func/test_run_cache.py", "file_name": "test_run_cache.py", "file_type": "text/x-python", "category": "test", "start_line": 41, "end_line": 80, "span_ids": ["test_do_not_save_on_no_exec_and_dry", "test_save", "test_uncached_outs_are_cached"], "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": "def test_save(tmp_dir, dvc, run_copy):\n run_cache_dir = dvc.stage_cache.cache_dir\n assert not os.path.exists(run_cache_dir)\n\n tmp_dir.gen(\"foo\", \"foo\")\n stage = run_copy(\"foo\", \"bar\", name=\"copy-foo-bar\")\n assert _recurse_count_files(run_cache_dir) == 1\n with dvc.state:\n assert dvc.stage_cache.is_cached(stage)\n\n\ndef test_do_not_save_on_no_exec_and_dry(tmp_dir, dvc, run_copy):\n run_cache_dir = dvc.stage_cache.cache_dir\n assert not os.path.exists(run_cache_dir)\n\n tmp_dir.gen(\"foo\", \"foo\")\n stage = run_copy(\"foo\", \"bar\", name=\"copy-foo-bar\", no_exec=True)\n\n assert _recurse_count_files(run_cache_dir) == 0\n with dvc.state:\n assert not dvc.stage_cache.is_cached(stage)\n\n (stage,) = dvc.reproduce(\"copy-foo-bar\", dry=True)\n\n assert _recurse_count_files(run_cache_dir) == 0\n with dvc.state:\n assert not dvc.stage_cache.is_cached(stage)\n\n\ndef test_uncached_outs_are_cached(tmp_dir, dvc, run_copy):\n tmp_dir.gen(\"foo\", \"foo\")\n stage = dvc.run(\n deps=[\"foo\"],\n cmd=\"cp foo bar\",\n outs_no_cache=[\"bar\"],\n name=\"copy-foo-bar\",\n )\n with dvc.state:\n stage.outs[0].checksum = stage.outs[0].get_checksum()\n assert os.path.exists(relpath(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_run_cache.py_test_memory_for_multiple_runs_of_same_stage_test_memory_for_multiple_runs_of_same_stage.None_8": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_cache.py_test_memory_for_multiple_runs_of_same_stage_test_memory_for_multiple_runs_of_same_stage.None_8", "embedding": null, "metadata": {"file_path": "tests/func/test_run_cache.py", "file_name": "test_run_cache.py", "file_type": "text/x-python", "category": "test", "start_line": 83, "end_line": 117, "span_ids": ["test_memory_for_multiple_runs_of_same_stage"], "tokens": 346}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_memory_for_multiple_runs_of_same_stage(\n tmp_dir, dvc, run_copy, mocker\n):\n tmp_dir.gen(\"foo\", \"foo\")\n assert not os.path.exists(dvc.stage_cache.cache_dir)\n run_copy(\"foo\", \"bar\", name=\"copy-foo-bar\")\n assert _recurse_count_files(dvc.stage_cache.cache_dir) == 1\n tmp_dir.gen(\"foo\", \"foobar\")\n run_copy(\"foo\", \"bar\", name=\"copy-foo-bar\")\n assert _recurse_count_files(dvc.stage_cache.cache_dir) == 2\n\n from dvc.stage import run as _run\n\n mock_restore = mocker.spy(dvc.stage_cache, \"restore\")\n mock_run = mocker.spy(_run, \"cmd_run\")\n\n (tmp_dir / \"bar\").unlink()\n (tmp_dir / PIPELINE_LOCK).unlink()\n (stage,) = dvc.reproduce(\"copy-foo-bar\")\n\n assert (tmp_dir / PIPELINE_LOCK).exists()\n assert (tmp_dir / \"bar\").read_text() == \"foobar\"\n mock_run.assert_not_called()\n mock_restore.assert_called_once_with(stage)\n mock_restore.reset_mock()\n\n (tmp_dir / PIPELINE_LOCK).unlink()\n tmp_dir.gen(\"foo\", \"foo\")\n dvc.reproduce(\"copy-foo-bar\")\n\n assert (tmp_dir / \"bar\").read_text() == \"foo\"\n mock_run.assert_not_called()\n mock_restore.assert_called_once_with(stage)\n assert (tmp_dir / \"bar\").exists() and not (tmp_dir / \"foo\").unlink()\n assert (tmp_dir / PIPELINE_LOCK).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_run_cache.py_test_memory_runs_of_multiple_stages_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run_cache.py_test_memory_runs_of_multiple_stages_", "embedding": null, "metadata": {"file_path": "tests/func/test_run_cache.py", "file_name": "test_run_cache.py", "file_type": "text/x-python", "category": "test", "start_line": 120, "end_line": 153, "span_ids": ["test_memory_runs_of_multiple_stages"], "tokens": 319}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_memory_runs_of_multiple_stages(tmp_dir, dvc, run_copy, mocker):\n tmp_dir.gen(\"foo\", \"foo\")\n assert not os.path.exists(dvc.stage_cache.cache_dir)\n\n run_copy(\"foo\", \"foo.bak\", name=\"backup-foo\")\n assert _recurse_count_files(dvc.stage_cache.cache_dir) == 1\n\n tmp_dir.gen(\"bar\", \"bar\")\n run_copy(\"bar\", \"bar.bak\", name=\"backup-bar\")\n assert _recurse_count_files(dvc.stage_cache.cache_dir) == 2\n\n from dvc.stage import run as _run\n\n mock_restore = mocker.spy(dvc.stage_cache, \"restore\")\n mock_run = mocker.spy(_run, \"cmd_run\")\n\n (tmp_dir / \"foo.bak\").unlink()\n (tmp_dir / \"bar.bak\").unlink()\n (tmp_dir / PIPELINE_LOCK).unlink()\n (stage,) = dvc.reproduce(\"backup-foo\")\n\n assert (tmp_dir / \"foo.bak\").read_text() == \"foo\"\n assert (tmp_dir / PIPELINE_LOCK).exists()\n mock_run.assert_not_called()\n mock_restore.assert_called_once_with(stage)\n mock_restore.reset_mock()\n\n (stage,) = dvc.reproduce(\"backup-bar\")\n\n assert (tmp_dir / \"bar.bak\").read_text() == \"bar\"\n assert (tmp_dir / PIPELINE_LOCK).exists()\n mock_run.assert_not_called()\n mock_restore.assert_called_once_with(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_run_multistage.py_test_run_no_exec_test_run_no_exec.assert_data_": {"__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_no_exec_test_run_no_exec.assert_data_", "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": 26, "end_line": 47, "span_ids": ["test_run_no_exec"], "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": "def test_run_no_exec(tmp_dir, dvc, run_copy):\n from dvc.stage import PipelineStage\n from dvc.dvcfile import PIPELINE_FILE, PIPELINE_LOCK\n\n tmp_dir.dvc_gen(\"foo\", \"foo\")\n assert not os.path.exists(PIPELINE_FILE)\n stage = run_copy(\"foo\", \"bar\", name=\"copy-foo-to-bar\", no_exec=True)\n assert isinstance(stage, PipelineStage)\n assert stage.name == \"copy-foo-to-bar\"\n assert os.path.exists(PIPELINE_FILE)\n assert not os.path.exists(PIPELINE_LOCK)\n\n data, _ = stage.dvcfile._load()\n assert data == {\n \"stages\": {\n \"copy-foo-to-bar\": {\n \"cmd\": \"python copy.py foo bar\",\n \"deps\": [\"copy.py\", \"foo\"],\n \"outs\": [\"bar\"],\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_run_multistage.py_test_run_multi_stage_repeat_test_run_multi_stage_repeat.assert_stage_name_for_st": {"__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_stage_name_for_st", "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": 64, "end_line": 79, "span_ids": ["test_run_multi_stage_repeat"], "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_run_multi_stage_repeat(tmp_dir, dvc, run_copy):\n from dvc.stage import PipelineStage\n from dvc.dvcfile import Dvcfile, PIPELINE_FILE\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\", single_stage=True)\n\n stages = list(Dvcfile(dvc, PIPELINE_FILE).stages.values())\n assert len(stages) == 2\n assert all(isinstance(stage, PipelineStage) for stage in stages)\n assert {stage.name for stage in stages} == {\n \"copy-foo-foo1\",\n \"copy-foo1-foo2\",\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_run_params_custom_file_test_run_params_custom_file.assert_data_stages_re": {"__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_params_custom_file_test_run_params_custom_file.assert_data_stages_re", "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": 261, "end_line": 283, "span_ids": ["test_run_params_custom_file"], "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": "def test_run_params_custom_file(tmp_dir, dvc):\n from dvc.dependency import ParamsDependency\n\n with (tmp_dir / \"params2.yaml\").open(\"w+\") as f:\n yaml.dump(supported_params, f)\n\n stage = dvc.run(\n name=\"read_params\",\n params=[\"params2.yaml:lists\"],\n cmd=\"cat params2.yaml\",\n )\n\n isinstance(stage.deps[0], ParamsDependency)\n assert stage.deps[0].params == [\"lists\"]\n lockfile = stage.dvcfile._lockfile\n assert lockfile.load()[\"read_params\"][\"params\"] == {\n \"params2.yaml\": {\"lists\": [42, 42.0, \"42\"]}\n }\n\n data, _ = stage.dvcfile._load()\n assert data[\"stages\"][\"read_params\"][\"params\"] == [\n {\"params2.yaml\": [\"lists\"]}\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_run_params_no_exec_test_run_params_no_exec.assert_data_stages_re": {"__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_params_no_exec_test_run_params_no_exec.assert_data_stages_re", "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": 286, "end_line": 306, "span_ids": ["test_run_params_no_exec"], "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_run_params_no_exec(tmp_dir, dvc):\n from dvc.dependency import ParamsDependency\n\n with (tmp_dir / \"params2.yaml\").open(\"w+\") as f:\n yaml.dump(supported_params, f)\n\n stage = dvc.run(\n name=\"read_params\",\n params=[\"params2.yaml:lists\"],\n cmd=\"cat params2.yaml\",\n no_exec=True,\n )\n\n isinstance(stage.deps[0], ParamsDependency)\n assert stage.deps[0].params == [\"lists\"]\n assert not stage.dvcfile._lockfile.exists()\n\n data, _ = stage.dvcfile._load()\n assert data[\"stages\"][\"read_params\"][\"params\"] == [\n {\"params2.yaml\": [\"lists\"]}\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_run_without_cmd_test_run_overwrite_order.assert_list_data_stages_": {"__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_without_cmd_test_run_overwrite_order.assert_list_data_stages_", "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": 309, "end_line": 334, "span_ids": ["test_run_without_cmd", "test_run_overwrite_order"], "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": "@pytest.mark.parametrize(\n \"kwargs\",\n [\n {\"outs\": [\"foo\"], \"deps\": [\"bar\"]},\n {\"outs\": [\"foo\"], \"deps\": [\"bar\"], \"name\": \"copy-foo-bar\"},\n ],\n)\ndef test_run_without_cmd(kwargs):\n with pytest.raises(InvalidArgumentError) as exc:\n Repo().run(**kwargs)\n assert \"command is not specified\" == str(exc.value)\n\n\ndef test_run_overwrite_order(tmp_dir, dvc, run_copy):\n from dvc.dvcfile import PIPELINE_FILE\n\n tmp_dir.gen({\"foo\": \"foo\", \"foo1\": \"foo1\"})\n run_copy(\"foo\", \"bar\", name=\"copy-foo-bar\")\n run_copy(\"bar\", \"foobar\", name=\"copy-bar-foobar\")\n\n run_copy(\"foo1\", \"bar1\", name=\"copy-foo-bar\", force=True)\n\n data = parse_yaml_for_update(\n (tmp_dir / PIPELINE_FILE).read_text(), PIPELINE_FILE\n )\n assert list(data[\"stages\"].keys()) == [\"copy-foo-bar\", \"copy-bar-foobar\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\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.with_open_gitignore_a.self_assertEqual_fobj_rea": {"__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.with_open_gitignore_a.self_assertEqual_fobj_rea", "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": 77, "end_line": 115, "span_ids": ["TestRunNoExec.test", "TestRunMissingDep", "TestRunEmpty", "TestRunNoExec", "TestRunEmpty.test", "TestRunMissingDep.test"], "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": "class TestRunEmpty(TestDvc):\n def test(self):\n self.dvc.run(\n cmd=\"echo hello world\",\n deps=[],\n outs=[],\n outs_no_cache=[],\n fname=\"empty.dvc\",\n single_stage=True,\n )\n\n\nclass TestRunMissingDep(TestDvc):\n def test(self):\n from dvc.dependency.base import DependencyDoesNotExistError\n\n with self.assertRaises(DependencyDoesNotExistError):\n self.dvc.run(\n cmd=\"command\",\n deps=[\"non-existing-dep\"],\n outs=[],\n outs_no_cache=[],\n fname=\"empty.dvc\",\n single_stage=True,\n )\n\n\nclass TestRunNoExec(TestDvcGit):\n def test(self):\n self.dvc.run(\n cmd=\"python {} {} {}\".format(self.CODE, self.FOO, \"out\"),\n deps=[self.CODE, self.FOO],\n outs=[\"out\"],\n no_exec=True,\n single_stage=True,\n )\n self.assertFalse(os.path.exists(\"out\"))\n with open(\".gitignore\") as fobj:\n self.assertEqual(fobj.read(), \"/out\\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_command": {"__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_command", "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": 247, "span_ids": ["TestRunStageInsideOutput.test_cwd", "TestRunBadCwd.test", "TestRunStageInsideOutput", "TestRunStageInsideOutput.test_file_name", "TestRunBadCwd", "TestRunBadCwd.test_same_prefix"], "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": "class TestRunStageInsideOutput(TestDvc):\n def test_cwd(self):\n self.dvc.run(\n cmd=f\"mkdir {self.DATA_DIR}\",\n deps=[],\n outs=[self.DATA_DIR],\n single_stage=True,\n )\n\n with self.assertRaises(StagePathAsOutputError):\n self.dvc.run(\n cmd=\"command\",\n fname=os.path.join(self.DATA_DIR, \"inside-cwd.dvc\"),\n single_stage=True,\n )\n\n def test_file_name(self):\n self.dvc.run(\n cmd=f\"mkdir {self.DATA_DIR}\",\n deps=[],\n outs=[self.DATA_DIR],\n single_stage=True,\n )\n\n with self.assertRaises(StagePathAsOutputError):\n self.dvc.run(\n cmd=\"command\",\n outs=[self.FOO],\n fname=os.path.join(self.DATA_DIR, \"inside-cwd.dvc\"),\n single_stage=True,\n )\n\n\nclass TestRunBadCwd(TestDvc):\n def test(self):\n with self.assertRaises(StagePathOutsideError):\n self.dvc.run(cmd=\"command\", wdir=self.mkdtemp(), single_stage=True)\n\n def test_same_prefix(self):\n with self.assertRaises(StagePathOutsideError):\n path = f\"{self._root_dir}-{uuid.uuid4()}\"\n os.mkdir(path)\n self.dvc.run(cmd=\"command\", wdir=path, single_stage=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_run_single_stage.py_test_rerun_deterministic_test_rerun_changed_out.with_pytest_raises_StageF.run_copy_foo_out_fo": {"__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_fo", "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": 663, "end_line": 720, "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": 478}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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\", single_stage=True) is not None\n assert run_copy(\"foo\", \"out\", single_stage=True) 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\", single_stage=True) is not None\n assert (\n run_copy(\"foo\", \"out\", run_cache=False, single_stage=True) is not None\n )\n\n\ndef test_rerun_callback(dvc):\n def run_callback(force=False):\n return dvc.run(\n cmd=\"echo content > out\",\n outs=[\"out\"],\n deps=[],\n force=force,\n single_stage=True,\n )\n\n assert run_callback() is not None\n with pytest.raises(StageFileAlreadyExistsError):\n assert run_callback() is not None\n assert run_callback(force=True) 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\", single_stage=True) is not None\n\n tmp_dir.gen(\"foo\", \"changed content\")\n with pytest.raises(StageFileAlreadyExistsError):\n run_copy(\"foo\", \"out\", force=False, single_stage=True)\n assert run_copy(\"foo\", \"out\", force=True, single_stage=True)\n\n\ndef test_rerun_changed_stage(tmp_dir, run_copy):\n tmp_dir.gen(\"foo\", \"foo content\")\n assert run_copy(\"foo\", \"out\", single_stage=True) is not None\n\n tmp_dir.gen(\"bar\", \"bar content\")\n with pytest.raises(StageFileAlreadyExistsError):\n run_copy(\"bar\", \"out\", force=False, single_stage=True)\n\n\ndef test_rerun_changed_out(tmp_dir, run_copy):\n tmp_dir.gen(\"foo\", \"foo content\")\n assert run_copy(\"foo\", \"out\", single_stage=True) is not None\n\n Path(\"out\").write_text(\"modification\")\n with pytest.raises(StageFileAlreadyExistsError):\n run_copy(\"foo\", \"out\", force=False, single_stage=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_run_single_stage.py_TestPersistentOutput_TestPersistentOutput.test_ignore_run_cache.with_open_greetings_as.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_run_cache.with_open_greetings_as.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": 941, "end_line": 969, "span_ids": ["TestPersistentOutput", "TestPersistentOutput.test_ignore_run_cache"], "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 TestPersistentOutput(TestDvc):\n def test_ignore_run_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 \"--force\",\n \"--single-stage\",\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\") 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_test_should_raise_on_stage_output.with_pytest_raises_Output.run_copy_foo_name_dvc": {"__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_test_should_raise_on_stage_output.with_pytest_raises_Output.run_copy_foo_name_dvc", "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": 972, "end_line": 992, "span_ids": ["test_should_raise_on_stage_output", "test_bad_stage_fname", "test_should_raise_on_stage_dependency"], "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": "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\", single_stage=True)\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\", single_stage=True)\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\", single_stage=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_run_single_stage.py_TestRunDirMetrics_TestRunDirMetrics.test_metrics_dir_not_cached.with_pytest_raises_IsADir.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_TestRunDirMetrics_TestRunDirMetrics.test_metrics_dir_not_cached.with_pytest_raises_IsADir.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": 995, "end_line": 1020, "span_ids": ["TestRunDirMetrics.setup", "TestRunDirMetrics.test_metrics_dir_cached", "TestRunDirMetrics.test_metrics_dir_not_cached", "TestRunDirMetrics"], "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 TestRunDirMetrics:\n @pytest.fixture(autouse=True)\n def setup(self, dvc):\n with open(\"script.py\", \"w+\") as fobj:\n fobj.write(\"import sys\\n\")\n fobj.write(\"import os\\n\")\n fobj.write(\"os.makedirs(sys.argv[1])\\n\")\n fobj.write(\n \"with open(os.path.join(sys.argv[1], \"\n \"'metrics.json'), 'a+') as fobj:\\n\"\n )\n fobj.write(\" fobj.write('foo')\\n\")\n\n def test_metrics_dir_cached(self, dvc):\n with pytest.raises(IsADirectoryError):\n dvc.run(\n cmd=\"python script.py dir\", metrics=[\"dir\"], single_stage=True,\n )\n\n def test_metrics_dir_not_cached(self, dvc):\n with pytest.raises(IsADirectoryError):\n dvc.run(\n cmd=\"python script.py dir\",\n metrics_no_cache=[\"dir\"],\n single_stage=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_run_single_stage.py_test_run_force_doesnot_preserve_comments_and_meta_": {"__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_run_force_doesnot_preserve_comments_and_meta_", "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": 1023, "end_line": 1050, "span_ids": ["test_run_force_doesnot_preserve_comments_and_meta"], "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 test_run_force_doesnot_preserve_comments_and_meta(tmp_dir, dvc, run_copy):\n \"\"\"Depends on loading of stage on `run` where we don't check the file\n for stage already exists, so we don't copy `stage_text` over due to which\n `meta` and `comments` don't get preserved.\"\"\"\n tmp_dir.gen({\"foo\": \"foo\", \"foo1\": \"foo1\"})\n text = textwrap.dedent(\n \"\"\"\\\n cmd: python copy.py foo bar\n deps:\n - path: copy.py\n - path: foo\n outs:\n # comment not preserved\n - path: bar\n meta:\n name: copy-foo-bar\n \"\"\"\n )\n (tmp_dir / \"bar.dvc\").write_text(text)\n dvc.reproduce(\"bar.dvc\")\n assert \"comment\" in (tmp_dir / \"bar.dvc\").read_text()\n assert \"meta\" in (tmp_dir / \"bar.dvc\").read_text()\n\n run_copy(\"foo1\", \"bar1\", single_stage=True, force=True, fname=\"bar.dvc\")\n\n assert \"comment\" not in (tmp_dir / \"bar.dvc\").read_text()\n assert \"meta\" not in (tmp_dir / \"bar.dvc\").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_from_functools_import_wra_test_copy_singlepart_preserve_etag.S3RemoteTree__copy_s3_fr": {"__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.S3RemoteTree__copy_s3_fr", "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": 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": "from functools import wraps\n\nimport boto3\nimport moto.s3.models as s3model\nimport pytest\nfrom moto import mock_s3\n\nfrom dvc.remote.base import CloudCache\nfrom dvc.remote.s3 import S3RemoteTree\nfrom tests.remotes import S3\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 = S3RemoteTree.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 S3RemoteTree._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_s3.py_test_link_created_on_non_nested_path_test_makedirs_doesnot_try_on_top_level_paths.tree_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.tree_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": 75, "span_ids": ["test_link_created_on_non_nested_path", "test_makedirs_doesnot_try_on_top_level_paths"], "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": "@mock_s3\n@pytest.mark.parametrize(\n \"base_info\",\n [\n S3RemoteTree.PATH_CLS(\"s3://bucket/\"),\n S3RemoteTree.PATH_CLS(\"s3://bucket/ns/\"),\n ],\n)\ndef test_link_created_on_non_nested_path(base_info, tmp_dir, dvc, scm):\n tree = S3RemoteTree(dvc, {\"url\": str(base_info.parent)})\n cache = CloudCache(tree)\n s3 = cache.tree.s3\n s3.create_bucket(Bucket=base_info.bucket)\n s3.put_object(\n Bucket=base_info.bucket, Key=(base_info / \"from\").path, Body=\"data\"\n )\n cache.link(base_info / \"from\", base_info / \"to\")\n\n assert cache.tree.exists(base_info / \"from\")\n assert cache.tree.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 = S3RemoteTree.PATH_CLS(\"s3://bucket/\")\n tree = S3RemoteTree(dvc, {\"url\": str(base_info)})\n tree.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/func/test_scm.py_os_test_init_sub_dir.assert_scm_root_dir_os": {"__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_os", "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": 33, "span_ids": ["test_init_none", "test_init_sub_dir", "imports", "test_init_git", "test_init_no_git"], "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": "import os\n\nimport pytest\nfrom git import Repo\n\nfrom dvc.scm import SCM, Git, NoSCM\nfrom dvc.scm.base import SCMError\nfrom dvc.system import System\nfrom tests.basic_env import TestGit, TestGitSubmodule\nfrom tests.utils import get_gitignore_content\n\n\ndef test_init_none(tmp_dir):\n assert isinstance(SCM(os.fspath(tmp_dir), no_scm=True), NoSCM)\n\n\ndef test_init_git(tmp_dir):\n Repo.init(os.fspath(tmp_dir))\n assert isinstance(SCM(os.fspath(tmp_dir)), Git)\n\n\ndef test_init_no_git(tmp_dir):\n with pytest.raises(SCMError):\n SCM(os.fspath(tmp_dir))\n\n\ndef test_init_sub_dir(tmp_dir):\n Repo.init(os.fspath(tmp_dir))\n subdir = tmp_dir / \"dir\"\n subdir.mkdir()\n\n scm = SCM(os.fspath(subdir))\n assert scm.root_dir == os.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_o": {"__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_o", "embedding": null, "metadata": {"file_path": "tests/func/test_scm.py", "file_name": "test_scm.py", "file_type": "text/x-python", "category": "test", "start_line": 59, "end_line": 96, "span_ids": ["test_ignored", "TestSCMGitSubmodule.test_git_submodule", "TestSCMGitSubmodule.test_commit_in_submodule", "_count_gitignore_entries", "test_ignore", "TestSCMGitSubmodule"], "tokens": 296}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 = os.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(os.fspath(tmp_dir / \"dir1\" / \"file1.jpg\"))\n assert not scm._ignored(os.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_os_fs": {"__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_os_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": 99, "end_line": 121, "span_ids": ["test_get_gitignore", "test_get_gitignore_symlink"], "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_get_gitignore(tmp_dir, scm):\n tmp_dir.gen({\"file1\": \"contents\", \"dir\": {}})\n\n data_dir = os.fspath(tmp_dir / \"file1\")\n entry, gitignore = scm._get_gitignore(data_dir)\n assert entry == \"/file1\"\n assert gitignore == os.fspath(tmp_dir / \".gitignore\")\n\n data_dir = os.fspath(tmp_dir / \"dir\")\n entry, gitignore = scm._get_gitignore(data_dir)\n\n assert entry == \"/dir\"\n assert gitignore == os.fspath(tmp_dir / \".gitignore\")\n\n\ndef test_get_gitignore_symlink(tmp_dir, scm):\n tmp_dir.gen({\"dir\": {\"subdir\": {\"data\": \"contents\"}}})\n link = os.fspath(tmp_dir / \"link\")\n target = os.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 == os.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_stage.py_test_parent_repo_collect_stages_test_parent_repo_collect_stages.assert_deep_subrepo_stage": {"__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_test_parent_repo_collect_stages.assert_deep_subrepo_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": 183, "end_line": 205, "span_ids": ["test_parent_repo_collect_stages"], "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": "def test_parent_repo_collect_stages(tmp_dir, scm, dvc):\n tmp_dir.gen({\"subdir\": {}})\n tmp_dir.gen({\"deep\": {\"dir\": {}}})\n subrepo_dir = tmp_dir / \"subdir\"\n deep_subrepo_dir = tmp_dir / \"deep\" / \"dir\"\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 with deep_subrepo_dir.chdir():\n deep_subrepo = Repo.init(subdir=True)\n deep_subrepo_dir.gen(\"subrepo_file\", \"subrepo file content\")\n deep_subrepo.add(\"subrepo_file\")\n\n stages = dvc.collect(None)\n subrepo_stages = subrepo.collect(None)\n deep_subrepo_stages = deep_subrepo.collect(None)\n\n assert stages == []\n assert subrepo_stages != []\n assert deep_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_stage.py_test_stage_strings_representation_test_stage_strings_representation.with_folder_chdir_.assert_str_stage2_f_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_test_stage_strings_representation_test_stage_strings_representation.with_folder_chdir_.assert_str_stage2_f_s", "embedding": null, "metadata": {"file_path": "tests/func/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 208, "end_line": 235, "span_ids": ["test_stage_strings_representation"], "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 test_stage_strings_representation(tmp_dir, dvc, run_copy):\n tmp_dir.dvc_gen(\"foo\", \"foo\")\n stage1 = run_copy(\"foo\", \"bar\", single_stage=True)\n assert stage1.addressing == \"bar.dvc\"\n assert repr(stage1) == \"Stage: 'bar.dvc'\"\n assert str(stage1) == \"stage: 'bar.dvc'\"\n\n stage2 = run_copy(\"bar\", \"baz\", name=\"copy-bar-baz\")\n assert stage2.addressing == \"copy-bar-baz\"\n assert repr(stage2) == \"Stage: 'copy-bar-baz'\"\n assert str(stage2) == \"stage: 'copy-bar-baz'\"\n\n folder = tmp_dir / \"dir\"\n folder.mkdir()\n with folder.chdir():\n # `Stage` caches `relpath` results, forcing it to reset\n stage1.path = stage1.path\n stage2.path = stage2.path\n\n rel_path = os.path.relpath(stage1.path)\n assert stage1.addressing == rel_path\n assert repr(stage1) == f\"Stage: '{rel_path}'\"\n assert str(stage1) == f\"stage: '{rel_path}'\"\n\n rel_path = os.path.relpath(stage2.path)\n assert stage2.addressing == f\"{rel_path}:{stage2.name}\"\n assert repr(stage2) == f\"Stage: '{rel_path}:{stage2.name}'\"\n assert str(stage2) == f\"stage: '{rel_path}:{stage2.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_stage.py_test_stage_on_no_path_string_repr_test_stage_on_no_path_string_repr.assert_str_p_stage_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_test_stage_on_no_path_string_repr_test_stage_on_no_path_string_repr.assert_str_p_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": 238, "end_line": 247, "span_ids": ["test_stage_on_no_path_string_repr"], "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": "def test_stage_on_no_path_string_repr(tmp_dir, dvc):\n s = Stage(dvc)\n assert s.addressing == \"No path\"\n assert repr(s) == \"Stage: 'No path'\"\n assert str(s) == \"stage: 'No path'\"\n\n p = PipelineStage(dvc, name=\"stage_name\")\n assert p.addressing == \"No path:stage_name\"\n assert repr(p) == \"Stage: 'No path:stage_name'\"\n assert str(p) == \"stage: 'No path:stage_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_stage.py_test_stage_remove_pipeline_stage_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_test_stage_remove_pipeline_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": 250, "end_line": 277, "span_ids": ["test_stage_remove_pointer_stage", "test_stage_remove_pipeline_stage"], "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_stage_remove_pipeline_stage(tmp_dir, dvc, run_copy):\n tmp_dir.gen(\"foo\", \"foo\")\n stage = run_copy(\"foo\", \"bar\", name=\"copy-foo-bar\")\n run_copy(\"bar\", \"foobar\", name=\"copy-bar-foobar\")\n\n dvc_file = stage.dvcfile\n with dvc.lock:\n stage.remove(purge=False)\n assert stage.name in dvc_file.stages\n\n with dvc.lock:\n stage.remove()\n assert stage.name not in dvc_file.stages\n assert \"copy-bar-foobar\" in dvc_file.stages\n\n\ndef test_stage_remove_pointer_stage(tmp_dir, dvc, run_copy):\n (stage,) = tmp_dir.dvc_gen(\"foo\", \"foo\")\n\n with dvc.lock:\n stage.remove(purge=False)\n assert not (tmp_dir / \"foo\").exists()\n assert (tmp_dir / stage.relpath).exists()\n\n with dvc.lock:\n stage.remove()\n assert not (tmp_dir / stage.relpath).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_tree.py_TestWalkInGit.test_branch_TestWalkInGit.test_branch.None_3": {"__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_TestWalkInGit.test_branch.None_3", "embedding": null, "metadata": {"file_path": "tests/func/test_tree.py", "file_name": "test_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 153, "end_line": 179, "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_tree.py_test_repotree_walk_fetch_test_repotree_walk_fetch.for_entry_in_out_dir_cach.assert_os_path_exists_dvc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_test_repotree_walk_fetch_test_repotree_walk_fetch.for_entry_in_out_dir_cach.assert_os_path_exists_dvc", "embedding": null, "metadata": {"file_path": "tests/func/test_tree.py", "file_name": "test_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 183, "end_line": 196, "span_ids": ["test_repotree_walk_fetch"], "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_repotree_walk_fetch(tmp_dir, dvc, scm, local_remote):\n out = tmp_dir.dvc_gen({\"dir\": {\"foo\": \"foo\"}}, commit=\"init\")[0].outs[0]\n dvc.push()\n remove(dvc.cache.local.cache_dir)\n\n tree = RepoTree(dvc, fetch=True)\n with dvc.state:\n for _, _, _ in tree.walk(\"dir\"):\n pass\n\n assert os.path.exists(out.cache_path)\n for entry in out.dir_cache:\n hash_ = entry[out.remote.tree.PARAM_CHECKSUM]\n assert os.path.exists(dvc.cache.local.hash_to_path_info(hash_))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\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_test_repotree_cache_save_test_repotree_cache_save.for_hash__in_expected_.assert_os_path_exists_cac": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_test_repotree_cache_save_test_repotree_cache_save.for_hash__in_expected_.assert_os_path_exists_cac", "embedding": null, "metadata": {"file_path": "tests/func/test_tree.py", "file_name": "test_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 199, "end_line": 223, "span_ids": ["test_repotree_cache_save"], "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_repotree_cache_save(tmp_dir, dvc, scm, erepo_dir, local_cloud):\n with erepo_dir.chdir():\n erepo_dir.gen({\"dir\": {\"subdir\": {\"foo\": \"foo\"}, \"bar\": \"bar\"}})\n erepo_dir.dvc_add(\"dir/subdir\", commit=\"subdir\")\n erepo_dir.scm_add(\"dir\", commit=\"dir\")\n erepo_dir.add_remote(config=local_cloud.config)\n erepo_dir.dvc.push()\n\n # test only cares that either fetch or stream are set so that DVC dirs are\n # walked.\n #\n # for this test, all file objects are being opened() and copied from tree\n # into dvc.cache, not fetched or streamed from a remote\n tree = RepoTree(erepo_dir.dvc, stream=True)\n expected = [\n tree.get_file_hash(erepo_dir / path)\n for path in (\"dir/bar\", \"dir/subdir/foo\")\n ]\n\n with erepo_dir.dvc.state:\n cache = dvc.cache.local\n with cache.state:\n cache.save(PathInfo(erepo_dir / \"dir\"), tree, None)\n for hash_ in expected:\n assert os.path.exists(cache.hash_to_path_info(hash_))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\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_test_cleantree_subrepo_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_test_cleantree_subrepo_", "embedding": null, "metadata": {"file_path": "tests/func/test_tree.py", "file_name": "test_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 226, "end_line": 244, "span_ids": ["test_cleantree_subrepo"], "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_cleantree_subrepo(tmp_dir, dvc, scm, monkeypatch):\n tmp_dir.gen({\"subdir\": {}})\n subrepo_dir = tmp_dir / \"subdir\"\n with subrepo_dir.chdir():\n subrepo = Repo.init(subdir=True)\n subrepo_dir.gen({\"foo\": \"foo\", \"dir\": {\"bar\": \"bar\"}})\n\n assert isinstance(dvc.tree, CleanTree)\n assert not dvc.tree.exists(subrepo_dir / \"foo\")\n assert not dvc.tree.isfile(subrepo_dir / \"foo\")\n assert not dvc.tree.exists(subrepo_dir / \"dir\")\n assert not dvc.tree.isdir(subrepo_dir / \"dir\")\n\n assert isinstance(subrepo.tree, CleanTree)\n assert subrepo.tree.exists(subrepo_dir / \"foo\")\n assert subrepo.tree.isfile(subrepo_dir / \"foo\")\n assert subrepo.tree.exists(subrepo_dir / \"dir\")\n assert subrepo.tree.isdir(subrepo_dir / \"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_utils.py_from_dvc_import_utils_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_utils.py_from_dvc_import_utils_", "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": 43, "span_ids": ["test_dict_md5", "imports", "test_file_md5_crlf", "test_boxify"], "tokens": 329}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 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/remotes/gs.py_GCP_GCP.should_test.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/gs.py_GCP_GCP.should_test.return.True", "embedding": null, "metadata": {"file_path": "tests/remotes/gs.py", "file_name": "gs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 25, "end_line": 49, "span_ids": ["GCP", "GCP.should_test"], "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": "class GCP(Base, CloudURLInfo):\n @staticmethod\n def should_test():\n from subprocess import CalledProcessError, check_output\n\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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/gs.py_GCP.config_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/gs.py_GCP.config_", "embedding": null, "metadata": {"file_path": "tests/remotes/gs.py", "file_name": "gs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 51, "end_line": 123, "span_ids": ["GCP.exists", "GCP.is_dir", "gs", "GCP.mkdir", "GCP.write_text", "GCP.config", "GCP._get_storagepath", "GCP._bucket", "GCP.get_url", "GCP.read_text", "GCP.read_bytes", "GCP.is_file", "GCP.write_bytes", "GCP._gc", "GCP._blob"], "tokens": 419}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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(Base, CloudURLInfo):\n\n @cached_property\n def config(self):\n return {\n \"url\": self.url,\n \"credentialpath\": TEST_GCP_CREDS_FILE,\n }\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 @property\n def _gc(self):\n from google.cloud.storage import Client\n\n return Client.from_service_account_json(TEST_GCP_CREDS_FILE)\n\n @property\n def _bucket(self):\n return self._gc.bucket(self.bucket)\n\n @property\n def _blob(self):\n return self._bucket.blob(self.path)\n\n def is_file(self):\n if self.path.endswith(\"/\"):\n return False\n\n return self._blob.exists()\n\n def is_dir(self):\n dir_path = self / \"\"\n return bool(list(self._bucket.list_blobs(prefix=dir_path.path)))\n\n def exists(self):\n return self.is_file() or self.is_dir()\n\n def mkdir(self, mode=0o777, parents=False, exist_ok=False):\n assert mode == 0o777\n assert parents\n assert not exist_ok\n\n def write_bytes(self, contents):\n assert isinstance(contents, bytes)\n self._blob.upload_from_string(contents)\n\n def write_text(self, contents, encoding=None, errors=None):\n if not encoding:\n encoding = locale.getpreferredencoding(False)\n assert errors is None\n self.write_bytes(contents.encode(encoding))\n\n def read_bytes(self):\n return self._blob.download_as_string()\n\n def read_text(self, encoding=None, errors=None):\n if not encoding:\n encoding = locale.getpreferredencoding(False)\n assert errors is None\n return self.read_bytes().decode(encoding)\n\n\n@pytest.fixture\ndef gs():\n if not GCP.should_test():\n pytest.skip(\"no gs\")\n yield GCP(GCP.get_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/ssh.py_ssh_server_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/ssh.py_ssh_server_", "embedding": null, "metadata": {"file_path": "tests/remotes/ssh.py", "file_name": "ssh.py", "file_type": "text/x-python", "category": "implementation", "start_line": 137, "end_line": 166, "span_ids": ["ssh", "ssh_server", "ssh_connection"], "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": "@pytest.fixture\ndef ssh_server():\n import mockssh\n\n users = {TEST_SSH_USER: TEST_SSH_KEY_PATH}\n with mockssh.Server(users) as s:\n yield s\n\n\n@pytest.fixture\ndef ssh_connection(ssh_server):\n from dvc.remote.ssh.connection import SSHConnection\n\n yield SSHConnection(\n host=ssh_server.host,\n port=ssh_server.port,\n username=TEST_SSH_USER,\n key_filename=TEST_SSH_KEY_PATH,\n )\n\n\n@pytest.fixture\ndef ssh(ssh_server, monkeypatch):\n from dvc.remote.ssh import SSHRemoteTree\n\n # NOTE: see http://github.com/iterative/dvc/pull/3501\n monkeypatch.setattr(SSHRemoteTree, \"CAN_TRAVERSE\", False)\n\n return SSHMocked(SSHMocked.get_url(TEST_SSH_USER, ssh_server.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/test_dag.py_nx_test_dag.assert_cmd_run_0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_dag.py_nx_test_dag.assert_cmd_run_0", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_dag.py", "file_name": "test_dag.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 22, "span_ids": ["imports", "test_dag"], "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 networkx as nx\nimport pytest\n\nfrom dvc.cli import parse_args\nfrom dvc.command.dag import CmdDAG, _build, _show_ascii, _show_dot\n\n\n@pytest.mark.parametrize(\"fmt\", [None, \"--dot\"])\ndef test_dag(tmp_dir, dvc, mocker, fmt):\n tmp_dir.dvc_gen(\"foo\", \"foo\")\n\n args = [\"dag\", \"--full\", \"foo.dvc\"]\n if fmt:\n args.append(fmt)\n cli_args = parse_args(args)\n assert cli_args.func == CmdDAG\n\n cmd = cli_args.func(cli_args)\n\n mocker.patch(\"dvc.command.dag._build\", return_value=dvc.graph)\n\n assert cmd.run() == 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/command/test_dag.py_graph_graph.return.dvc_graph": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_dag.py_graph_graph.return.dvc_graph", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_dag.py", "file_name": "test_dag.py", "file_type": "text/x-python", "category": "test", "start_line": 25, "end_line": 45, "span_ids": ["graph"], "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": "@pytest.fixture\ndef graph(tmp_dir, dvc):\n tmp_dir.dvc_gen(\"a\", \"a\")\n tmp_dir.dvc_gen(\"b\", \"b\")\n\n dvc.run(\n no_exec=True, deps=[\"a\", \"c\"], outs=[\"d\", \"e\"], cmd=\"cmd1\", name=\"1\"\n )\n dvc.run(\n no_exec=True, deps=[\"b\", \"c\"], outs=[\"f\", \"g\"], cmd=\"cmd2\", name=\"2\"\n )\n dvc.run(\n no_exec=True,\n deps=[\"a\", \"b\", \"c\"],\n outs=[\"h\", \"i\"],\n cmd=\"cmd3\",\n name=\"3\",\n )\n dvc.run(no_exec=True, deps=[\"a\", \"h\"], outs=[\"j\"], cmd=\"cmd4\", name=\"4\")\n\n return dvc.graph", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_dag.py_test_build_test_build_full.assert_nx_is_isomorphic_G": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_dag.py_test_build_test_build_full.assert_nx_is_isomorphic_G", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_dag.py", "file_name": "test_dag.py", "file_type": "text/x-python", "category": "test", "start_line": 48, "end_line": 66, "span_ids": ["test_build", "test_build_full", "test_build_target"], "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": "def test_build(graph):\n assert nx.is_isomorphic(_build(graph), graph)\n\n\ndef test_build_target(graph):\n (stage,) = filter(\n lambda s: hasattr(s, \"name\") and s.name == \"3\", graph.nodes()\n )\n G = _build(graph, target=stage)\n assert set(G.nodes()) == {\"3\", \"b.dvc\", \"a.dvc\"}\n assert set(G.edges()) == {(\"3\", \"a.dvc\"), (\"3\", \"b.dvc\")}\n\n\ndef test_build_full(graph):\n (stage,) = filter(\n lambda s: hasattr(s, \"name\") and s.name == \"3\", graph.nodes()\n )\n G = _build(graph, target=stage, full=True)\n assert nx.is_isomorphic(G, graph)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_dag.py_test_show_ascii_test_show_ascii.assert_line_rstrip_for": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_dag.py_test_show_ascii_test_show_ascii.assert_line_rstrip_for", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_dag.py", "file_name": "test_dag.py", "file_type": "text/x-python", "category": "test", "start_line": 69, "end_line": 86, "span_ids": ["test_show_ascii"], "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_show_ascii(graph):\n assert [line.rstrip() for line in _show_ascii(graph).splitlines()] == [\n \" +----------------+ +----------------+\", # noqa: E501\n \" | stage: 'a.dvc' | | stage: 'b.dvc' |\", # noqa: E501\n \" *+----------------+**** +----------------+\", # noqa: E501\n \" ***** * ***** *** ***\", # noqa: E501\n \" **** * ***** ** **\", # noqa: E501\n \" *** * *** ** **\", # noqa: E501\n \"+------------+ ** +------------+ +------------+\", # noqa: E501\n \"| stage: '1' | ** | stage: '3' | | stage: '2' |\", # noqa: E501\n \"+------------+ *** +------------+ +------------+\", # noqa: E501\n \" ** ***\",\n \" ** **\",\n \" ** **\",\n \" +------------+\",\n \" | stage: '4' |\",\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/unit/command/test_dag.py_test_show_dot_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_dag.py_test_show_dot_", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_dag.py", "file_name": "test_dag.py", "file_type": "text/x-python", "category": "test", "start_line": 89, "end_line": 106, "span_ids": ["test_show_dot"], "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": "def test_show_dot(graph):\n assert _show_dot(graph) == (\n \"strict digraph {\\n\"\n \"stage;\\n\"\n \"stage;\\n\"\n \"stage;\\n\"\n \"stage;\\n\"\n \"stage;\\n\"\n \"stage;\\n\"\n \"\\\"stage: '1'\\\" -> \\\"stage: 'a.dvc'\\\";\\n\"\n \"\\\"stage: '2'\\\" -> \\\"stage: 'b.dvc'\\\";\\n\"\n \"\\\"stage: '3'\\\" -> \\\"stage: 'a.dvc'\\\";\\n\"\n \"\\\"stage: '3'\\\" -> \\\"stage: 'b.dvc'\\\";\\n\"\n \"\\\"stage: '4'\\\" -> \\\"stage: 'a.dvc'\\\";\\n\"\n \"\\\"stage: '4'\\\" -> \\\"stage: '3'\\\";\\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/unit/command/test_metrics.py_test_metrics_show_test_metrics_show.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_test_metrics_show_test_metrics_show.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": 98, "end_line": 125, "span_ids": ["test_metrics_show"], "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_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 )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_precision_test_metrics_diff_precision.assert__show_diff_diff_p": {"__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_precision_test_metrics_diff_precision.assert__show_diff_diff_p", "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": 128, "end_line": 149, "span_ids": ["test_metrics_diff_precision"], "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": "def test_metrics_diff_precision():\n diff = {\n \"other.json\": {\n \"a.b\": {\n \"old\": 0.1234567,\n \"new\": 0.765432101234567,\n \"diff\": 0.641975401234567,\n }\n }\n }\n\n assert _show_diff(diff) == textwrap.dedent(\n \"\"\"\\\n Path Metric Value Change\n other.json a.b 0.76543 0.64198\"\"\"\n )\n\n assert _show_diff(diff, precision=10) == textwrap.dedent(\n \"\"\"\\\n Path Metric Value Change\n other.json a.b 0.7654321012 0.6419754012\"\"\"\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_markdown_test_metrics_diff_markdown.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_diff_markdown_test_metrics_diff_markdown.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": 179, "end_line": 197, "span_ids": ["test_metrics_diff_markdown"], "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_markdown():\n assert _show_diff(\n {\n \"metrics.yaml\": {\n \"x.b\": {\"old\": 5, \"new\": 6},\n \"a.d.e\": {\"old\": 3, \"new\": 4, \"diff\": 1},\n \"a.b.c\": {\"old\": 1, \"new\": 2, \"diff\": 1},\n }\n },\n markdown=True,\n ) == textwrap.dedent(\n \"\"\"\\\n | Path | Metric | Value | Change |\n |--------------|----------|---------|--------------------|\n | metrics.yaml | a.b.c | 2 | 1 |\n | metrics.yaml | a.d.e | 4 | 1 |\n | metrics.yaml | x.b | 6 | diff not supported |\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/unit/command/test_metrics.py_test_metrics_diff_no_path_test_metrics_diff_no_path.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_diff_no_path_test_metrics_diff_no_path.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": 198, "end_line": 214, "span_ids": ["test_metrics_diff_no_path"], "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_no_path():\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 no_path=True,\n ) == textwrap.dedent(\n \"\"\"\\\n Metric Value Change\n a.b.c 2 1\n a.d.e 4 1\n 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/command/test_metrics.py_test_metrics_diff_with_old_": {"__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_with_old_", "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": 217, "end_line": 234, "span_ids": ["test_metrics_diff_with_old"], "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_metrics_diff_with_old():\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 old=True,\n ) == textwrap.dedent(\n \"\"\"\\\n Path Metric Old New Change\n metrics.yaml a.b.c 1 2 1\n metrics.yaml a.d.e 3 4 1\n metrics.yaml x.b 5 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/command/test_params.py_test_params_diff_markdown_test_params_diff_markdown.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_markdown_test_params_diff_markdown.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": 137, "end_line": 155, "span_ids": ["test_params_diff_markdown"], "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_params_diff_markdown():\n assert _show_diff(\n {\n \"params.yaml\": {\n \"x.b\": {\"old\": 5, \"new\": 6},\n \"a.d.e\": {\"old\": None, \"new\": 4},\n \"a.b.c\": {\"old\": 1, \"new\": None},\n }\n },\n markdown=True,\n ) == textwrap.dedent(\n \"\"\"\\\n | Path | Param | Old | New |\n |-------------|---------|-------|-------|\n | params.yaml | a.b.c | 1 | None |\n | params.yaml | a.d.e | None | 4 |\n | params.yaml | x.b | 5 | 6 |\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/unit/command/test_params.py_test_params_diff_no_path_": {"__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_no_path_", "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": 156, "end_line": 173, "span_ids": ["test_params_diff_no_path"], "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_params_diff_no_path():\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 no_path=True,\n ) == textwrap.dedent(\n \"\"\"\\\n Param Old New\n a.b.c 1 2\n a.d.e 3 4\n 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_plots.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_plots.py_from_dvc_cli_import_parse_test_metrics_diff.m_assert_called_once_with", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_plots.py", "file_name": "test_plots.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 53, "span_ids": ["imports", "test_metrics_diff"], "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": "from dvc.cli import parse_args\nfrom dvc.command.plots import CmdPlotsDiff, CmdPlotsShow\n\n\ndef test_metrics_diff(dvc, mocker):\n cli_args = parse_args(\n [\n \"plots\",\n \"diff\",\n \"--out\",\n \"result.extension\",\n \"-t\",\n \"template\",\n \"--targets\",\n \"datafile\",\n \"--show-vega\",\n \"-x\",\n \"x_field\",\n \"-y\",\n \"y_field\",\n \"--title\",\n \"my_title\",\n \"--x-label\",\n \"x_title\",\n \"--y-label\",\n \"y_title\",\n \"HEAD\",\n \"tag1\",\n \"tag2\",\n ]\n )\n assert cli_args.func == CmdPlotsDiff\n\n cmd = cli_args.func(cli_args)\n m = mocker.patch(\n \"dvc.repo.plots.diff.diff\", return_value={\"datafile\": \"filledtemplate\"}\n )\n\n assert cmd.run() == 0\n\n m.assert_called_once_with(\n cmd.repo,\n targets=[\"datafile\"],\n revs=[\"HEAD\", \"tag1\", \"tag2\"],\n props={\n \"template\": \"template\",\n \"x\": \"x_field\",\n \"y\": \"y_field\",\n \"title\": \"my_title\",\n \"x_label\": \"x_title\",\n \"y_label\": \"y_title\",\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/unit/command/test_plots.py_test_metrics_show_test_metrics_show.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_plots.py_test_metrics_show_test_metrics_show.m_assert_called_once_with", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_plots.py", "file_name": "test_plots.py", "file_type": "text/x-python", "category": "test", "start_line": 56, "end_line": 83, "span_ids": ["test_metrics_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": "def test_metrics_show(dvc, mocker):\n cli_args = parse_args(\n [\n \"plots\",\n \"show\",\n \"-o\",\n \"result.extension\",\n \"-t\",\n \"template\",\n \"--show-vega\",\n \"--no-header\",\n \"datafile\",\n ]\n )\n assert cli_args.func == CmdPlotsShow\n\n cmd = cli_args.func(cli_args)\n\n m = mocker.patch(\n \"dvc.repo.plots.Plots.show\",\n return_value={\"datafile\": \"filledtemplate\"},\n )\n\n assert cmd.run() == 0\n\n m.assert_called_once_with(\n targets=[\"datafile\"], props={\"template\": \"template\", \"header\": 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/unit/command/test_plots.py_test_plots_show_vega_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_plots.py_test_plots_show_vega_", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_plots.py", "file_name": "test_plots.py", "file_type": "text/x-python", "category": "test", "start_line": 86, "end_line": 104, "span_ids": ["test_plots_show_vega"], "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 test_plots_show_vega(dvc, mocker, caplog):\n cli_args = parse_args(\n [\n \"plots\",\n \"diff\",\n \"HEAD~10\",\n \"HEAD~1\",\n \"--show-vega\",\n \"--targets\",\n \"plots.csv\",\n ]\n )\n cmd = cli_args.func(cli_args)\n mocker.patch(\n \"dvc.repo.plots.diff.diff\", return_value={\"plots.csv\": \"plothtml\"}\n )\n assert cmd.run() == 0\n assert \"plothtml\" 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_status.py_json_test_cloud_status.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_status.py_json_test_cloud_status.m_assert_called_once_with", "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": 44, "span_ids": ["imports", "test_cloud_status"], "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": "import json\n\nimport pytest\n\nfrom 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 \"--recursive\",\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 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_status.py_test_status_show_json_test_status_show_json.assert_caplog_messages_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_status.py_test_status_show_json_test_status_show_json.assert_caplog_messages_", "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": 47, "end_line": 57, "span_ids": ["test_status_show_json"], "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": "@pytest.mark.parametrize(\"status\", [{}, {\"a\": \"b\", \"c\": [1, 2, 3]}, [1, 2, 3]])\ndef test_status_show_json(mocker, caplog, status):\n cli_args = parse_args([\"status\", \"--show-json\"])\n assert cli_args.func == CmdDataStatus\n\n cmd = cli_args.func(cli_args)\n\n mocker.patch.object(cmd.repo, \"status\", autospec=True, return_value=status)\n caplog.clear()\n assert cmd.run() == 0\n assert caplog.messages == [json.dumps(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/unit/command/test_status.py_test_status_quiet_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_status.py_test_status_quiet_", "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": 60, "end_line": 76, "span_ids": ["test_status_quiet"], "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.mark.parametrize(\n \"status, ret\", [({}, 0), ({\"a\": \"b\", \"c\": [1, 2, 3]}, 1), ([1, 2, 3], 1)]\n)\ndef test_status_quiet(mocker, caplog, capsys, status, ret):\n cli_args = parse_args([\"status\", \"-q\"])\n assert cli_args.func == CmdDataStatus\n\n cmd = cli_args.func(cli_args)\n\n mocker.patch.object(cmd.repo, \"status\", autospec=True, return_value=status)\n caplog.clear()\n assert cmd.run() == ret\n assert not caplog.messages\n captured = capsys.readouterr()\n assert not captured.err\n assert not 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/dependency/test_azure.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_azure.py__", "embedding": null, "metadata": {"file_path": "tests/unit/dependency/test_azure.py", "file_name": "test_azure.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 8, "span_ids": ["imports", "TestAzureDependency._get_cls", "TestAzureDependency"], "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.azure import AzureDependency\nfrom tests.unit.dependency.test_local import TestLocalDependency\n\n\nclass TestAzureDependency(TestLocalDependency):\n def _get_cls(self):\n return AzureDependency", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_pytest_test_loads_params.assert_deps_2_info_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_params.py_pytest_test_loads_params.assert_deps_2_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": 44, "span_ids": ["imports", "test_loads_params"], "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": "import pytest\nimport yaml\n\nfrom dvc.dependency import ParamsDependency, loadd_from, loads_params\nfrom dvc.dependency.param import BadParamFileError, MissingParamsError\nfrom dvc.stage import Stage\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(\n stage,\n [\n \"foo\",\n \"bar\",\n {\"a_file\": [\"baz\", \"bat\"]},\n {\"b_file\": [\"cat\"]},\n {},\n {\"a_file\": [\"foobar\"]},\n ],\n )\n assert len(deps) == 3\n\n assert isinstance(deps[0], ParamsDependency)\n assert deps[0].def_path == ParamsDependency.DEFAULT_PARAMS_FILE\n assert deps[0].params == [\"foo\", \"bar\"]\n assert deps[0].info == {}\n\n assert isinstance(deps[1], ParamsDependency)\n assert deps[1].def_path == \"a_file\"\n assert deps[1].params == [\"baz\", \"bat\", \"foobar\"]\n assert deps[1].info == {}\n\n assert isinstance(deps[2], ParamsDependency)\n assert deps[2].def_path == \"b_file\"\n assert deps[2].params == [\"cat\"]\n assert deps[2].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/output/test_load.py_test_load_from_pipeline_accumulates_flag_test_load_from_pipeline_accumulates_flag.assert_not_outs_1_use_ca": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_load.py_test_load_from_pipeline_accumulates_flag_test_load_from_pipeline_accumulates_flag.assert_not_outs_1_use_ca", "embedding": null, "metadata": {"file_path": "tests/unit/output/test_load.py", "file_name": "test_load.py", "file_type": "text/x-python", "category": "test", "start_line": 44, "end_line": 61, "span_ids": ["test_load_from_pipeline_accumulates_flag"], "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_load_from_pipeline_accumulates_flag(dvc):\n outs = output.load_from_pipeline(\n Stage(dvc),\n [\n \"file1\",\n {\"file2\": {\"cache\": False}},\n {\"file1\": {\"persist\": False}},\n {\"file2\": {\"persist\": True}},\n ],\n \"outs\",\n )\n for out in outs:\n assert isinstance(out, LocalOutput)\n assert not out.plot and not out.metric\n assert out.info == {}\n\n assert outs[0].use_cache and not outs[0].persist\n assert not outs[1].use_cache and outs[1].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/unit/output/test_load.py_test_load_remote_files_from_pipeline_test_load_from_pipeline_illegal_type.None_1.output_load_from_pipeline": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_load.py_test_load_remote_files_from_pipeline_test_load_from_pipeline_illegal_type.None_1.output_load_from_pipeline", "embedding": null, "metadata": {"file_path": "tests/unit/output/test_load.py", "file_name": "test_load.py", "file_type": "text/x-python", "category": "test", "start_line": 64, "end_line": 87, "span_ids": ["test_load_from_pipeline_error_on_typ", "test_load_remote_files_from_pipeline", "test_load_from_pipeline_illegal_type"], "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": "def test_load_remote_files_from_pipeline(dvc):\n stage = Stage(dvc)\n (out,) = output.load_from_pipeline(\n stage, [{\"s3://dvc-test/file.txt\": {\"cache\": False}}], typ=\"metrics\"\n )\n assert isinstance(out, S3Output)\n assert not out.plot and out.metric\n assert not out.persist\n assert out.info == {}\n\n\n@pytest.mark.parametrize(\"typ\", [None, \"\", \"illegal\"])\ndef test_load_from_pipeline_error_on_typ(dvc, typ):\n with pytest.raises(ValueError):\n output.load_from_pipeline(Stage(dvc), [\"file1\"], typ)\n\n\n@pytest.mark.parametrize(\"key\", [3, \"list\".split()])\ndef test_load_from_pipeline_illegal_type(dvc, key):\n stage = Stage(dvc)\n with pytest.raises(ValueError):\n output.load_from_pipeline(stage, [key], \"outs\")\n with pytest.raises(ValueError):\n output.load_from_pipeline(stage, [{\"key\": key}], \"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/tests/unit/output/test_load.py_test_plots_load_from_pipeline_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_load.py_test_plots_load_from_pipeline_", "embedding": null, "metadata": {"file_path": "tests/unit/output/test_load.py", "file_name": "test_load.py", "file_type": "text/x-python", "category": "test", "start_line": 90, "end_line": 115, "span_ids": ["test_plots_load_from_pipeline"], "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_plots_load_from_pipeline(dvc):\n outs = output.load_from_pipeline(\n Stage(dvc),\n [\n \"file1\",\n {\n \"file2\": {\n \"persist\": True,\n \"cache\": False,\n \"x\": 3,\n \"random\": \"val\",\n }\n },\n ],\n \"plots\",\n )\n assert isinstance(outs[0], LocalOutput)\n assert outs[0].use_cache\n assert outs[0].plot is True and not outs[0].metric\n assert not outs[0].persist\n\n assert isinstance(outs[1], LocalOutput)\n assert not outs[1].use_cache\n assert outs[1].plot == {\"x\": 3} and not outs[1].metric\n assert outs[1].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/unit/remote/ssh/test_pool.py_pytest_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_pool.py_pytest_", "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": 21, "span_ids": ["imports", "test_doesnt_swallow_errors"], "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": "import pytest\n\nfrom dvc.remote.pool import get_connection\nfrom dvc.remote.ssh.connection import SSHConnection\nfrom tests.remotes.ssh import TEST_SSH_KEY_PATH, TEST_SSH_USER\n\n\ndef test_doesnt_swallow_errors(ssh_server):\n class MyError(Exception):\n pass\n\n with pytest.raises(MyError):\n with get_connection(\n SSHConnection,\n host=ssh_server.host,\n port=ssh_server.port,\n username=TEST_SSH_USER,\n key_filename=TEST_SSH_KEY_PATH,\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_host_override_from_config_test_ssh_host_override_from_config.assert_tree_path_info_hos": {"__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_tree_path_info_hos", "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": 53, "end_line": 73, "span_ids": ["test_ssh_host_override_from_config"], "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": "@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 f\"{builtin_module_name}.open\",\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 tree = SSHRemoteTree(dvc, config)\n\n mock_exists.assert_called_with(SSHRemoteTree.ssh_config_filename())\n mock_file.assert_called_with(SSHRemoteTree.ssh_config_filename())\n assert tree.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/ssh/test_ssh.py_test_ssh_user_test_ssh_user.assert_tree_path_info_use": {"__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_tree_path_info_use", "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": 76, "end_line": 101, "span_ids": ["test_ssh_user"], "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": "@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 f\"{builtin_module_name}.open\",\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 tree = SSHRemoteTree(dvc, config)\n\n mock_exists.assert_called_with(SSHRemoteTree.ssh_config_filename())\n mock_file.assert_called_with(SSHRemoteTree.ssh_config_filename())\n assert tree.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_tree_path_info_por": {"__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_tree_path_info_por", "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": 104, "end_line": 126, "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\"}, SSHRemoteTree.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 f\"{builtin_module_name}.open\",\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 tree = SSHRemoteTree(dvc, config)\n\n mock_exists.assert_called_with(SSHRemoteTree.ssh_config_filename())\n mock_file.assert_called_with(SSHRemoteTree.ssh_config_filename())\n assert tree.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/remote/ssh/test_ssh.py_test_ssh_keyfile_test_ssh_keyfile.assert_tree_keyfile_ex": {"__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_tree_keyfile_ex", "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": 129, "end_line": 161, "span_ids": ["test_ssh_keyfile"], "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": "@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 f\"{builtin_module_name}.open\",\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 tree = SSHRemoteTree(dvc, config)\n\n mock_exists.assert_called_with(SSHRemoteTree.ssh_config_filename())\n mock_file.assert_called_with(SSHRemoteTree.ssh_config_filename())\n assert tree.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_tree_gss_auth_e": {"__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_tree_gss_auth_e", "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": 164, "end_line": 183, "span_ids": ["test_ssh_gss_auth"], "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": "@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 f\"{builtin_module_name}.open\",\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 tree = SSHRemoteTree(dvc, config)\n\n mock_exists.assert_called_with(SSHRemoteTree.ssh_config_filename())\n mock_file.assert_called_with(SSHRemoteTree.ssh_config_filename())\n assert tree.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/test_base.py_math_test_cmd_error.with_mock_patch_object_.with_pytest_raises_Remote.BaseRemoteTree_dvc_confi": {"__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.BaseRemoteTree_dvc_confi", "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": 45, "span_ids": ["_CallableOrNone.__eq__", "_CallableOrNone", "test_cmd_error", "impl", "imports", "test_missing_deps"], "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": "import math\n\nimport mock\nimport pytest\n\nfrom dvc.path_info import PathInfo\nfrom dvc.remote.base import (\n BaseRemoteTree,\n Remote,\n RemoteCmdError,\n RemoteMissingDepsError,\n)\n\n\nclass _CallableOrNone:\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()\n\n\ndef test_missing_deps(dvc):\n requires = {\"missing\": \"missing\"}\n with mock.patch.object(BaseRemoteTree, \"REQUIRES\", requires):\n with pytest.raises(RemoteMissingDepsError):\n BaseRemoteTree(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 BaseRemoteTree,\n \"remove\",\n side_effect=RemoteCmdError(\"base\", cmd, ret, err),\n ):\n with pytest.raises(RemoteCmdError):\n BaseRemoteTree(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_base.py_test_hashes_exist_test_hashes_exist.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_hashes_exist_test_hashes_exist.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": 48, "end_line": 100, "span_ids": ["test_hashes_exist"], "tokens": 404}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(BaseRemoteTree, \"list_hashes_traverse\")\n@mock.patch.object(BaseRemoteTree, \"list_hashes_exists\")\ndef test_hashes_exist(object_exists, traverse, dvc):\n remote = Remote(BaseRemoteTree(dvc, {}))\n\n # remote does not support traverse\n remote.tree.CAN_TRAVERSE = False\n with mock.patch.object(\n remote.tree, \"list_hashes\", return_value=list(range(256))\n ):\n hashes = set(range(1000))\n remote.hashes_exist(hashes)\n object_exists.assert_called_with(hashes, None, None)\n traverse.assert_not_called()\n\n remote.tree.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.tree, \"list_hashes\", return_value=list(range(256))\n ):\n hashes = list(range(1000))\n remote.hashes_exist(hashes)\n # verify that _cache_paths_with_max() short circuits\n # before returning all 256 remote hashes\n max_hashes = math.ceil(\n remote.tree._max_estimation_size(hashes)\n / pow(16, remote.tree.TRAVERSE_PREFIX_LEN)\n )\n assert max_hashes < 256\n object_exists.assert_called_with(\n frozenset(range(max_hashes, 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.tree.JOBS = 16\n with mock.patch.object(\n remote.tree, \"list_hashes\", return_value=list(range(256))\n ):\n hashes = list(range(1000000))\n remote.hashes_exist(hashes)\n object_exists.assert_not_called()\n traverse.assert_called_with(\n 256 * pow(16, remote.tree.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_list_hashes_traverse_test_list_hashes_traverse.list_hashes_assert_called": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_base.py_test_list_hashes_traverse_test_list_hashes_traverse.list_hashes_assert_called", "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": 103, "end_line": 131, "span_ids": ["test_list_hashes_traverse"], "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": "@mock.patch.object(\n BaseRemoteTree, \"list_hashes\", return_value=[],\n)\n@mock.patch.object(\n BaseRemoteTree, \"path_to_hash\", side_effect=lambda x: x,\n)\ndef test_list_hashes_traverse(_path_to_hash, list_hashes, dvc):\n tree = BaseRemoteTree(dvc, {})\n tree.path_info = PathInfo(\"foo\")\n\n # parallel traverse\n size = 256 / tree.JOBS * tree.LIST_OBJECT_PAGE_SIZE\n list(tree.list_hashes_traverse(size, {0}))\n for i in range(1, 16):\n list_hashes.assert_any_call(\n prefix=f\"{i:03x}\", progress_callback=CallableOrNone\n )\n for i in range(1, 256):\n list_hashes.assert_any_call(\n prefix=f\"{i:02x}\", progress_callback=CallableOrNone\n )\n\n # default traverse (small remote)\n size -= 1\n list_hashes.reset_mock()\n list(tree.list_hashes_traverse(size - 1, {0}))\n list_hashes.assert_called_with(\n prefix=None, progress_callback=CallableOrNone\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_list_hashes_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_base.py_test_list_hashes_", "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": 134, "end_line": 165, "span_ids": ["test_is_dir_hash", "test_list_paths", "test_list_hashes"], "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_list_hashes(dvc):\n tree = BaseRemoteTree(dvc, {})\n tree.path_info = PathInfo(\"foo\")\n\n with mock.patch.object(\n tree, \"list_paths\", return_value=[\"12/3456\", \"bar\"]\n ):\n hashes = list(tree.list_hashes())\n assert hashes == [\"123456\"]\n\n\ndef test_list_paths(dvc):\n tree = BaseRemoteTree(dvc, {})\n tree.path_info = PathInfo(\"foo\")\n\n with mock.patch.object(tree, \"walk_files\", return_value=[]) as walk_mock:\n for _ in tree.list_paths():\n pass\n walk_mock.assert_called_with(tree.path_info, prefix=False)\n\n for _ in tree.list_paths(prefix=\"000\"):\n pass\n walk_mock.assert_called_with(tree.path_info / \"00\" / \"0\", prefix=True)\n\n\n@pytest.mark.parametrize(\n \"hash_, result\",\n [(None, False), (\"\", False), (\"3456.dir\", True), (\"3456\", False)],\n)\ndef test_is_dir_hash(hash_, result):\n assert BaseRemoteTree.is_dir_hash(hash_) == 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/remote/test_http.py_pytest_test_public_auth_method.assert_tree__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_tree__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": 24, "span_ids": ["test_download_fails_on_error_code", "imports", "test_public_auth_method"], "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 pytest\n\nfrom dvc.exceptions import HTTPError\nfrom dvc.remote.http import HTTPRemoteTree\n\n\ndef test_download_fails_on_error_code(dvc, http):\n tree = HTTPRemoteTree(dvc, http.config)\n\n with pytest.raises(HTTPError):\n tree._download(http / \"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 tree = HTTPRemoteTree(dvc, config)\n\n assert tree._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_tree__a": {"__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_tree__a", "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": 33, "end_line": 50, "span_ids": ["test_basic_auth_method"], "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": "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 tree = HTTPRemoteTree(dvc, config)\n\n assert tree._auth_method() == auth\n assert isinstance(tree._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_local.py_errno_test_status_download_optimization.assert_other_remote_hashe": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_local.py_errno_test_status_download_optimization.assert_other_remote_hashe", "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": 33, "span_ids": ["imports", "test_status_download_optimization"], "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": "import errno\nimport os\n\nimport pytest\n\nfrom dvc.cache import NamedCache\nfrom dvc.path_info import PathInfo\nfrom dvc.remote.index import RemoteIndexNoop\nfrom dvc.remote.local import LocalCache, LocalRemoteTree\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 cache = LocalCache(LocalRemoteTree(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(cache, \"hashes_exist\", return_value=local_exists)\n\n other_remote = mocker.Mock()\n other_remote.url = \"other_remote\"\n other_remote.hashes_exist.return_value = []\n other_remote.index = RemoteIndexNoop()\n\n cache.status(infos, other_remote, download=True)\n\n assert other_remote.hashes_exist.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_local.py_test_is_protected_test_is_protected.if_os_name_nt_and_li.else_.assert_tree_is_protected_": {"__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_tree_is_protected_", "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": 36, "end_line": 64, "span_ids": ["test_is_protected"], "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": "@pytest.mark.parametrize(\"link_name\", [\"hardlink\", \"symlink\"])\ndef test_is_protected(tmp_dir, dvc, link_name):\n tree = LocalRemoteTree(dvc, {})\n link_method = getattr(tree, 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 tree.is_protected(foo)\n assert not tree.is_protected(link)\n\n tree.protect(foo)\n\n assert tree.is_protected(foo)\n assert tree.is_protected(link)\n\n tree.unprotect(link)\n\n assert not tree.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 tree.is_protected(foo)\n else:\n assert tree.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/remote/test_remote.py_pytest_test_remote_without_hash_jobs_default.assert_tree_hash_jobs_": {"__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_hash_jobs_default.assert_tree_hash_jobs_", "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": 31, "span_ids": ["imports", "test_remote_without_hash_jobs_default", "test_remote_without_hash_jobs", "test_remote_with_hash_jobs"], "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 pytest\n\nfrom dvc.remote import get_cloud_tree\nfrom dvc.remote.gs import GSRemoteTree\nfrom dvc.remote.s3 import S3RemoteTree\n\n\ndef test_remote_with_hash_jobs(dvc):\n dvc.config[\"remote\"][\"with_hash_jobs\"] = {\n \"url\": \"s3://bucket/name\",\n \"hash_jobs\": 100,\n }\n dvc.config[\"core\"][\"hash_jobs\"] = 200\n\n tree = get_cloud_tree(dvc, name=\"with_hash_jobs\")\n assert tree.hash_jobs == 100\n\n\ndef test_remote_without_hash_jobs(dvc):\n dvc.config[\"remote\"][\"without_hash_jobs\"] = {\"url\": \"s3://bucket/name\"}\n dvc.config[\"core\"][\"hash_jobs\"] = 200\n\n tree = get_cloud_tree(dvc, name=\"without_hash_jobs\")\n assert tree.hash_jobs == 200\n\n\ndef test_remote_without_hash_jobs_default(dvc):\n dvc.config[\"remote\"][\"without_hash_jobs\"] = {\"url\": \"s3://bucket/name\"}\n\n tree = get_cloud_tree(dvc, name=\"without_hash_jobs\")\n assert tree.hash_jobs == tree.HASH_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_tree.py_test_isdir_test_isdir.for_expected_path_in_tes.assert_remote_tree_isdir_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_tree.py_test_isdir_test_isdir.for_expected_path_in_tes.assert_remote_tree_isdir_", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_remote_tree.py", "file_name": "test_remote_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 35, "end_line": 49, "span_ids": ["test_isdir"], "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": "@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.tree.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_tree.py_test_exists_test_exists.for_expected_path_in_tes.assert_remote_tree_exists": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_tree.py_test_exists_test_exists.for_expected_path_in_tes.assert_remote_tree_exists", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_remote_tree.py", "file_name": "test_remote_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 52, "end_line": 69, "span_ids": ["test_exists"], "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": "@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.tree.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_tree.py_test_copy_preserve_etag_across_buckets_test_makedirs.assert_tree_isdir_empty_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_tree.py_test_copy_preserve_etag_across_buckets_test_makedirs.assert_tree_isdir_empty_d", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_remote_tree.py", "file_name": "test_remote_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 87, "end_line": 113, "span_ids": ["test_copy_preserve_etag_across_buckets", "test_makedirs"], "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(\"remote\", [pytest.lazy_fixture(\"s3\")], indirect=True)\ndef test_copy_preserve_etag_across_buckets(remote, dvc):\n s3 = remote.tree.s3\n s3.create_bucket(Bucket=\"another\")\n\n another = S3RemoteTree(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.tree.copy(from_info, to_info)\n\n from_etag = S3RemoteTree.get_etag(s3, from_info.bucket, from_info.path)\n to_etag = S3RemoteTree.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 tree = remote.tree\n empty_dir = remote.path_info / \"empty_dir\" / \"\"\n tree.remove(empty_dir)\n assert not tree.exists(empty_dir)\n tree.makedirs(empty_dir)\n assert tree.exists(empty_dir)\n assert tree.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_tree.py_test_isfile_test_isfile.for_expected_path_in_tes.assert_remote_tree_isfile": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_tree.py_test_isfile_test_isfile.for_expected_path_in_tes.assert_remote_tree_isfile", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_remote_tree.py", "file_name": "test_remote_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 116, "end_line": 135, "span_ids": ["test_isfile"], "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": "@pytest.mark.parametrize(\"remote\", remotes, 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.tree.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_tree.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_tree.py_test_download_dir_", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_remote_tree.py", "file_name": "test_remote_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 138, "end_line": 157, "span_ids": ["test_download_dir"], "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": "@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.tree.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_tree_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_tree_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": 25, "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 S3RemoteTree\n\nbucket_name = \"bucket-name\"\nprefix = \"some/prefix\"\nurl = f\"s3://{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 tree = S3RemoteTree(dvc, config)\n\n assert tree.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/repo/plots/test_data.py_from_collections_import_O_test_parse_json.assert_result_expected": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/plots/test_data.py_from_collections_import_O_test_parse_json.assert_result_expected", "embedding": null, "metadata": {"file_path": "tests/unit/repo/plots/test_data.py", "file_name": "test_data.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 22, "span_ids": ["test_parse_json", "imports"], "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": "from collections import OrderedDict\n\nimport pytest\n\nfrom dvc.repo.plots.data import _apply_path, _find_data, _lists\n\n\n@pytest.mark.parametrize(\n \"path,expected_result\",\n [\n (\"$.some.path[*].a\", [{\"a\": 1}, {\"a\": 4}]),\n (\"$.some.path\", [{\"a\": 1, \"b\": 2, \"c\": 3}, {\"a\": 4, \"b\": 5, \"c\": 6}]),\n ],\n)\ndef test_parse_json(path, expected_result):\n value = {\n \"some\": {\"path\": [{\"a\": 1, \"b\": 2, \"c\": 3}, {\"a\": 4, \"b\": 5, \"c\": 6}]}\n }\n\n result = _apply_path(value, path=path)\n\n assert result == expected_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/repo/plots/test_data.py_test_finding_lists_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/plots/test_data.py_test_finding_lists_", "embedding": null, "metadata": {"file_path": "tests/unit/repo/plots/test_data.py", "file_name": "test_data.py", "file_type": "text/x-python", "category": "test", "start_line": 25, "end_line": 49, "span_ids": ["test_finding_data", "test_finding_lists"], "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": "@pytest.mark.parametrize(\n \"dictionary, expected_result\",\n [\n ({}, []),\n ({\"x\": [\"a\", \"b\", \"c\"]}, [[\"a\", \"b\", \"c\"]]),\n (\n OrderedDict([(\"x\", {\"y\": [\"a\", \"b\"]}), (\"z\", {\"w\": [\"c\", \"d\"]})]),\n [[\"a\", \"b\"], [\"c\", \"d\"]],\n ),\n ],\n)\ndef test_finding_lists(dictionary, expected_result):\n result = _lists(dictionary)\n\n assert list(result) == expected_result\n\n\n@pytest.mark.parametrize(\"fields\", [{\"x\"}, set()])\ndef test_finding_data(fields):\n data = {\"a\": {\"b\": [{\"x\": 2, \"y\": 3}, {\"x\": 1, \"y\": 5}]}}\n\n result = _find_data(data, fields=fields)\n\n assert result == [{\"x\": 2, \"y\": 3}, {\"x\": 1, \"y\": 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/plots/test_diff.py_pytest_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/plots/test_diff.py_pytest_", "embedding": null, "metadata": {"file_path": "tests/unit/repo/plots/test_diff.py", "file_name": "test_diff.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 17, "span_ids": ["imports", "test_revisions"], "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": "import pytest\n\nfrom dvc.repo.plots.diff import _revisions\n\n\n@pytest.mark.parametrize(\n \"arg_revisions,is_dirty,expected_revisions\",\n [\n ([], False, [\"workspace\"]),\n ([], True, [\"HEAD\", \"workspace\"]),\n ([\"v1\", \"v2\", \"workspace\"], False, [\"v1\", \"v2\", \"workspace\"]),\n ([\"v1\", \"v2\", \"workspace\"], True, [\"v1\", \"v2\", \"workspace\"]),\n ],\n)\ndef test_revisions(mocker, arg_revisions, is_dirty, expected_revisions):\n assert _revisions(arg_revisions, is_dirty) == expected_revisions", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_collect_optimization_on_stage_name_test_collect_optimization_on_stage_name.assert_dvc_collect_granul": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_repo.py_test_collect_optimization_on_stage_name_test_collect_optimization_on_stage_name.assert_dvc_collect_granul", "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": 90, "end_line": 102, "span_ids": ["test_collect_optimization_on_stage_name"], "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_collect_optimization_on_stage_name(tmp_dir, dvc, mocker, run_copy):\n tmp_dir.dvc_gen(\"foo\", \"foo\")\n stage = run_copy(\"foo\", \"bar\", name=\"copy-foo-bar\")\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 assert dvc.collect(\"copy-foo-bar\") == [stage]\n assert dvc.collect_granular(\"copy-foo-bar\") == [(stage, 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/repo/test_repo_tree.py_os_test_open_dirty_no_hash.with_tree_open_file_r.assert_fobj_read_fi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_repo_tree.py_os_test_open_dirty_no_hash.with_tree_open_file_r.assert_fobj_read_fi", "embedding": null, "metadata": {"file_path": "tests/unit/repo/test_repo_tree.py", "file_name": "test_repo_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 45, "span_ids": ["test_open_dirty_no_hash", "imports", "test_open_dirty_hash", "test_exists", "test_open"], "tokens": 296}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\nimport pytest\n\nfrom dvc.path_info import PathInfo\nfrom dvc.repo.tree import RepoTree\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 = RepoTree(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 = RepoTree(dvc)\n with dvc.state:\n with tree.open(\"foo\", \"r\") as fobj:\n assert fobj.read() == \"foo\"\n\n\ndef test_open_dirty_hash(tmp_dir, dvc):\n tmp_dir.dvc_gen(\"file\", \"file\")\n (tmp_dir / \"file\").write_text(\"something\")\n\n tree = RepoTree(dvc)\n with tree.open(\"file\", \"r\") as fobj:\n assert fobj.read() == \"something\"\n\n\ndef test_open_dirty_no_hash(tmp_dir, dvc):\n tmp_dir.gen(\"file\", \"file\")\n (tmp_dir / \"file.dvc\").write_text(\"outs:\\n- path: file\\n\")\n\n tree = RepoTree(dvc)\n with tree.open(\"file\", \"r\") as fobj:\n assert fobj.read() == \"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/repo/test_repo_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_repo_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_repo_tree.py", "file_name": "test_repo_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 48, "end_line": 65, "span_ids": ["test_open_in_history"], "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": "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 == \"workspace\":\n continue\n\n tree = RepoTree(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_repo_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_repo_tree.py_test_isdir_isfile_test_isdir_mixed.assert_not_tree_isfile_d", "embedding": null, "metadata": {"file_path": "tests/unit/repo/test_repo_tree.py", "file_name": "test_repo_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 68, "end_line": 98, "span_ids": ["test_isdir_isfile", "test_isdir_mixed"], "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 test_isdir_isfile(tmp_dir, dvc):\n tmp_dir.gen({\"datafile\": \"data\", \"datadir\": {\"foo\": \"foo\", \"bar\": \"bar\"}})\n\n tree = RepoTree(dvc)\n assert tree.isdir(\"datadir\")\n assert not tree.isfile(\"datadir\")\n assert not tree.isdvc(\"datadir\")\n assert not tree.isdir(\"datafile\")\n assert tree.isfile(\"datafile\")\n assert not tree.isdvc(\"datafile\")\n\n dvc.add([\"datadir\", \"datafile\"])\n shutil.rmtree(tmp_dir / \"datadir\")\n (tmp_dir / \"datafile\").unlink()\n\n assert tree.isdir(\"datadir\")\n assert not tree.isfile(\"datadir\")\n assert tree.isdvc(\"datadir\")\n assert not tree.isdir(\"datafile\")\n assert tree.isfile(\"datafile\")\n assert tree.isdvc(\"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 = RepoTree(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_repo_tree.py_test_walk_test_walk.assert_len_actual_len": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_repo_tree.py_test_walk_test_walk.assert_len_actual_len", "embedding": null, "metadata": {"file_path": "tests/unit/repo/test_repo_tree.py", "file_name": "test_repo_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 101, "end_line": 145, "span_ids": ["test_walk"], "tokens": 379}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 \"dvcfiles,extra_expected\",\n [\n (False, []),\n (\n True,\n [\n PathInfo(\"dir\") / \"subdir1\" / \"foo1.dvc\",\n PathInfo(\"dir\") / \"subdir1\" / \"bar1.dvc\",\n PathInfo(\"dir\") / \"subdir2\" / \"foo2.dvc\",\n ],\n ),\n ],\n)\ndef test_walk(tmp_dir, dvc, dvcfiles, extra_expected):\n tmp_dir.gen(\n {\n \"dir\": {\n \"subdir1\": {\"foo1\": \"foo1\", \"bar1\": \"bar1\"},\n \"subdir2\": {\"foo2\": \"foo2\"},\n }\n }\n )\n dvc.add(str(tmp_dir / \"dir\"), recursive=True)\n tmp_dir.gen({\"dir\": {\"foo\": \"foo\", \"bar\": \"bar\"}})\n tree = RepoTree(dvc)\n\n expected = [\n PathInfo(\"dir\") / \"subdir1\",\n PathInfo(\"dir\") / \"subdir2\",\n PathInfo(\"dir\") / \"subdir1\" / \"foo1\",\n PathInfo(\"dir\") / \"subdir1\" / \"bar1\",\n PathInfo(\"dir\") / \"subdir2\" / \"foo2\",\n PathInfo(\"dir\") / \"foo\",\n PathInfo(\"dir\") / \"bar\",\n ]\n\n actual = []\n for root, dirs, files in tree.walk(\"dir\", dvcfiles=dvcfiles):\n for entry in dirs + files:\n actual.append(os.path.join(root, entry))\n\n expected = [str(path) for path in expected + extra_expected]\n assert set(actual) == set(expected)\n assert len(actual) == len(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/repo/test_repo_tree.py_test_walk_onerror_test_walk_onerror.None_3.for___in_tree_walk_foo_.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_repo_tree.py_test_walk_onerror_test_walk_onerror.None_3.for___in_tree_walk_foo_.pass", "embedding": null, "metadata": {"file_path": "tests/unit/repo/test_repo_tree.py", "file_name": "test_repo_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 148, "end_line": 167, "span_ids": ["test_walk_onerror"], "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_walk_onerror(tmp_dir, dvc):\n def onerror(exc):\n raise exc\n\n tmp_dir.dvc_gen(\"foo\", \"foo\")\n tree = RepoTree(dvc)\n\n # path does not exist\n for _ in tree.walk(\"dir\"):\n pass\n with pytest.raises(OSError):\n for _ in tree.walk(\"dir\", onerror=onerror):\n pass\n\n # path is not a directory\n for _ in tree.walk(\"foo\"):\n pass\n with pytest.raises(OSError):\n for _ in tree.walk(\"foo\", onerror=onerror):\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/repo/test_repo_tree.py_test_isdvc_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_repo_tree.py_test_isdvc_", "embedding": null, "metadata": {"file_path": "tests/unit/repo/test_repo_tree.py", "file_name": "test_repo_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 170, "end_line": 180, "span_ids": ["test_isdvc"], "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": "def test_isdvc(tmp_dir, dvc):\n tmp_dir.gen({\"foo\": \"foo\", \"bar\": \"bar\", \"dir\": {\"baz\": \"baz\"}})\n dvc.add(\"foo\")\n dvc.add(\"dir\")\n tree = RepoTree(dvc)\n assert tree.isdvc(\"foo\")\n assert not tree.isdvc(\"bar\")\n assert tree.isdvc(\"dir\")\n assert not tree.isdvc(\"dir/baz\")\n assert tree.isdvc(\"dir/baz\", recursive=True, strict=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/repo/test_tree.py_os_test_open_dirty_no_hash.with_tree_open_file_r.assert_fobj_read_fi": {"__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_dirty_no_hash.with_tree_open_file_r.assert_fobj_read_fi", "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": 45, "span_ids": ["test_open_dirty_no_hash", "imports", "test_open_dirty_hash", "test_exists", "test_open"], "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 os\nimport shutil\n\nimport pytest\n\nfrom dvc.path_info import PathInfo\nfrom dvc.repo.tree import DvcTree\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 dvc.state:\n with tree.open(\"foo\", \"r\") as fobj:\n assert fobj.read() == \"foo\"\n\n\ndef test_open_dirty_hash(tmp_dir, dvc):\n tmp_dir.dvc_gen(\"file\", \"file\")\n (tmp_dir / \"file\").write_text(\"something\")\n\n tree = DvcTree(dvc)\n with tree.open(\"file\", \"r\") as fobj:\n assert fobj.read() == \"something\"\n\n\ndef test_open_dirty_no_hash(tmp_dir, dvc):\n tmp_dir.gen(\"file\", \"file\")\n (tmp_dir / \"file.dvc\").write_text(\"outs:\\n- path: file\\n\")\n\n tree = DvcTree(dvc)\n with tree.open(\"file\", \"r\") as fobj:\n assert fobj.read() == \"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/repo/test_tree.py_test_walk_test_walk.assert_len_actual_len": {"__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_test_walk.assert_len_actual_len", "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": 97, "end_line": 128, "span_ids": ["test_walk"], "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_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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_dir_test_walk_dir.assert_len_actual_len": {"__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_dir_test_walk_dir.assert_len_actual_len", "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": 131, "end_line": 173, "span_ids": ["test_walk_dir"], "tokens": 302}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 \"fetch,expected\",\n [\n (False, []),\n (\n True,\n [\n PathInfo(\"dir\") / \"subdir1\",\n PathInfo(\"dir\") / \"subdir2\",\n PathInfo(\"dir\") / \"subdir1\" / \"foo1\",\n PathInfo(\"dir\") / \"subdir1\" / \"bar1\",\n PathInfo(\"dir\") / \"subdir2\" / \"foo2\",\n PathInfo(\"dir\") / \"foo\",\n PathInfo(\"dir\") / \"bar\",\n ],\n ),\n ],\n)\ndef test_walk_dir(tmp_dir, dvc, fetch, expected):\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\")\n tree = DvcTree(dvc, fetch=fetch)\n\n expected = [str(tmp_dir / path) for path in expected]\n\n with dvc.state:\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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_onerror_": {"__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_onerror_", "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": 176, "end_line": 204, "span_ids": ["test_isdvc", "test_walk_onerror"], "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": "def test_walk_onerror(tmp_dir, dvc):\n def onerror(exc):\n raise exc\n\n tmp_dir.dvc_gen(\"foo\", \"foo\")\n tree = DvcTree(dvc)\n\n # path does not exist\n for _ in tree.walk(\"dir\"):\n pass\n with pytest.raises(OSError):\n for _ in tree.walk(\"dir\", onerror=onerror):\n pass\n\n # path is not a directory\n for _ in tree.walk(\"foo\"):\n pass\n with pytest.raises(OSError):\n for _ in tree.walk(\"foo\", onerror=onerror):\n pass\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/scm/test_git.py_test_walk_onerror_test_walk_onerror.None_3.for___in_tree_walk_foo_.pass": {"__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_onerror_test_walk_onerror.None_3.for___in_tree_walk_foo_.pass", "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": 42, "end_line": 63, "span_ids": ["test_walk_onerror"], "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_walk_onerror(tmp_dir, scm):\n def onerror(exc):\n raise exc\n\n tmp_dir.scm_gen(\n {\"foo\": \"foo\"}, commit=\"init\",\n )\n tree = scm.get_tree(\"HEAD\")\n\n # path does not exist\n for _ in tree.walk(\"dir\"):\n pass\n with pytest.raises(OSError):\n for _ in tree.walk(\"dir\", onerror=onerror):\n pass\n\n # path is not a directory\n for _ in tree.walk(\"foo\"):\n pass\n with pytest.raises(OSError):\n for _ in tree.walk(\"foo\", onerror=onerror):\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/stage/test_cache.py_os_test_stage_cache.None_11": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_cache.py_os_test_stage_cache.None_11", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_cache.py", "file_name": "test_cache.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 53, "span_ids": ["imports", "test_stage_cache"], "tokens": 447}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\ndef test_stage_cache(tmp_dir, dvc, mocker):\n tmp_dir.gen(\"dep\", \"dep\")\n tmp_dir.gen(\n \"script.py\",\n (\n 'open(\"out\", \"w+\").write(\"out\"); '\n 'open(\"out_no_cache\", \"w+\").write(\"out_no_cache\")'\n ),\n )\n stage = dvc.run(\n cmd=\"python script.py\",\n deps=[\"script.py\", \"dep\"],\n outs=[\"out\"],\n outs_no_cache=[\"out_no_cache\"],\n single_stage=True,\n )\n\n with dvc.lock, dvc.state:\n stage.remove(remove_outs=True, force=True)\n\n assert not (tmp_dir / \"out\").exists()\n assert not (tmp_dir / \"out_no_cache\").exists()\n assert not (tmp_dir / \"out.dvc\").exists()\n\n cache_dir = os.path.join(\n dvc.stage_cache.cache_dir,\n \"10\",\n \"10b45372fdf4ec14d3f779c5b256378d7a12780e4c7f549a44138e492f098bfe\",\n )\n cache_file = os.path.join(\n cache_dir,\n \"bb32e04c6da96a7192513390acedbe4cd6123f8fe5b0ba5fffe39716fe87f6f4\",\n )\n\n assert os.path.isdir(cache_dir)\n assert os.listdir(cache_dir) == [os.path.basename(cache_file)]\n assert os.path.isfile(cache_file)\n\n run_spy = mocker.patch(\"dvc.stage.run.cmd_run\")\n checkout_spy = mocker.spy(stage, \"checkout\")\n with dvc.lock, dvc.state:\n stage.run()\n\n assert not run_spy.called\n assert checkout_spy.call_count == 1\n\n assert (tmp_dir / \"out\").exists()\n assert (tmp_dir / \"out_no_cache\").exists()\n assert (tmp_dir / \"out\").read_text() == \"out\"\n assert (tmp_dir / \"out_no_cache\").read_text() == \"out_no_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/unit/stage/test_cache.py_test_stage_cache_params_test_stage_cache_params.None_11": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_cache.py_test_stage_cache_params_test_stage_cache_params.None_11", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_cache.py", "file_name": "test_cache.py", "file_type": "text/x-python", "category": "test", "start_line": 56, "end_line": 106, "span_ids": ["test_stage_cache_params"], "tokens": 484}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_cache_params(tmp_dir, dvc, mocker):\n tmp_dir.gen(\"params.yaml\", \"foo: 1\\nbar: 2\")\n tmp_dir.gen(\"myparams.yaml\", \"baz: 3\\nqux: 4\")\n tmp_dir.gen(\n \"script.py\",\n (\n 'open(\"out\", \"w+\").write(\"out\"); '\n 'open(\"out_no_cache\", \"w+\").write(\"out_no_cache\")'\n ),\n )\n stage = dvc.run(\n cmd=\"python script.py\",\n params=[\"foo,bar\", \"myparams.yaml:baz,qux\"],\n outs=[\"out\"],\n outs_no_cache=[\"out_no_cache\"],\n single_stage=True,\n )\n\n with dvc.lock, dvc.state:\n stage.remove(remove_outs=True, force=True)\n\n assert not (tmp_dir / \"out\").exists()\n assert not (tmp_dir / \"out_no_cache\").exists()\n assert not (tmp_dir / \"out.dvc\").exists()\n\n cache_dir = os.path.join(\n dvc.stage_cache.cache_dir,\n \"65\",\n \"651d0a5b82e05e48b03acf44954f6a8599760e652a143d517a17d1065eca61a1\",\n )\n cache_file = os.path.join(\n cache_dir,\n \"2196a5a4dd24c5759437511fcf9d6aa66b259e1dac58e3f212aefd1797a6f114\",\n )\n\n assert os.path.isdir(cache_dir)\n assert os.listdir(cache_dir) == [os.path.basename(cache_file)]\n assert os.path.isfile(cache_file)\n\n run_spy = mocker.patch(\"dvc.stage.run.cmd_run\")\n checkout_spy = mocker.spy(stage, \"checkout\")\n with dvc.lock, dvc.state:\n stage.run()\n\n assert not run_spy.called\n assert checkout_spy.call_count == 1\n\n assert (tmp_dir / \"out\").exists()\n assert (tmp_dir / \"out_no_cache\").exists()\n assert (tmp_dir / \"out\").read_text() == \"out\"\n assert (tmp_dir / \"out_no_cache\").read_text() == \"out_no_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/unit/stage/test_cache.py_test_stage_cache_wdir_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_cache.py_test_stage_cache_wdir_", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_cache.py", "file_name": "test_cache.py", "file_type": "text/x-python", "category": "test", "start_line": 109, "end_line": 161, "span_ids": ["test_stage_cache_wdir"], "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 test_stage_cache_wdir(tmp_dir, dvc, mocker):\n tmp_dir.gen(\"dep\", \"dep\")\n tmp_dir.gen(\n \"script.py\",\n (\n 'open(\"out\", \"w+\").write(\"out\"); '\n 'open(\"out_no_cache\", \"w+\").write(\"out_no_cache\")'\n ),\n )\n tmp_dir.gen({\"wdir\": {}})\n stage = dvc.run(\n cmd=\"python ../script.py\",\n deps=[\"../script.py\", \"../dep\"],\n outs=[\"out\"],\n outs_no_cache=[\"out_no_cache\"],\n single_stage=True,\n wdir=\"wdir\",\n )\n\n with dvc.lock, dvc.state:\n stage.remove(remove_outs=True, force=True)\n\n assert not (tmp_dir / \"wdir\" / \"out\").exists()\n assert not (tmp_dir / \"wdir\" / \"out_no_cache\").exists()\n assert not (tmp_dir / \"wdir\" / \"out.dvc\").exists()\n\n cache_dir = os.path.join(\n dvc.stage_cache.cache_dir,\n \"d2\",\n \"d2b5da199f4da73a861027f5f76020a948794011db9704814fdb2a488ca93ec2\",\n )\n cache_file = os.path.join(\n cache_dir,\n \"65cc63ade5ab338541726b26185ebaf42331141ec3a670a7d6e8a227505afade\",\n )\n\n assert os.path.isdir(cache_dir)\n assert os.listdir(cache_dir) == [os.path.basename(cache_file)]\n assert os.path.isfile(cache_file)\n\n run_spy = mocker.patch(\"dvc.stage.run.cmd_run\")\n checkout_spy = mocker.spy(stage, \"checkout\")\n with dvc.lock, dvc.state:\n stage.run()\n\n assert not run_spy.called\n assert checkout_spy.call_count == 1\n\n assert (tmp_dir / \"wdir\" / \"out\").exists()\n assert (tmp_dir / \"wdir\" / \"out_no_cache\").exists()\n assert (tmp_dir / \"wdir\" / \"out\").read_text() == \"out\"\n assert (tmp_dir / \"wdir\" / \"out_no_cache\").read_text() == \"out_no_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/unit/stage/test_loader_pipeline_file.py_os_lock_data.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_loader_pipeline_file.py_os_lock_data.return._", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_loader_pipeline_file.py", "file_name": "test_loader_pipeline_file.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 24, "span_ids": ["imports", "lock_data", "stage_data"], "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 os\nfrom copy import deepcopy\nfrom itertools import chain\n\nimport pytest\n\nfrom dvc.dvcfile import PIPELINE_FILE, Dvcfile\nfrom dvc.stage import PipelineStage, create_stage\nfrom dvc.stage.loader import StageLoader\nfrom dvc.stage.serialize import split_params_deps\n\n\n@pytest.fixture\ndef stage_data():\n return {\"cmd\": \"command\", \"deps\": [\"foo\"], \"outs\": [\"bar\"]}\n\n\n@pytest.fixture\ndef lock_data():\n return {\n \"cmd\": \"command\",\n \"deps\": [{\"path\": \"foo\", \"md5\": \"foo_checksum\"}],\n \"outs\": [{\"path\": \"bar\", \"md5\": \"bar_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/tests/unit/stage/test_loader_pipeline_file.py_test_fill_from_lock_deps_outs_test_fill_from_lock_deps_outs.assert_stage_outs_0_info": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_loader_pipeline_file.py_test_fill_from_lock_deps_outs_test_fill_from_lock_deps_outs.assert_stage_outs_0_info", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_loader_pipeline_file.py", "file_name": "test_loader_pipeline_file.py", "file_type": "text/x-python", "category": "test", "start_line": 27, "end_line": 38, "span_ids": ["test_fill_from_lock_deps_outs"], "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_fill_from_lock_deps_outs(dvc, lock_data):\n stage = create_stage(\n PipelineStage, dvc, PIPELINE_FILE, deps=[\"foo\"], outs=[\"bar\"]\n )\n\n for item in chain(stage.deps, stage.outs):\n assert not item.checksum and not item.info\n\n StageLoader.fill_from_lock(stage, lock_data)\n\n assert stage.deps[0].info == {\"md5\": \"foo_checksum\"}\n assert stage.outs[0].info == {\"md5\": \"bar_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/unit/stage/test_loader_pipeline_file.py_test_fill_from_lock_params_test_fill_from_lock_params.assert_params_deps_1_inf": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_loader_pipeline_file.py_test_fill_from_lock_params_test_fill_from_lock_params.assert_params_deps_1_inf", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_loader_pipeline_file.py", "file_name": "test_loader_pipeline_file.py", "file_type": "text/x-python", "category": "test", "start_line": 41, "end_line": 72, "span_ids": ["test_fill_from_lock_params"], "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_fill_from_lock_params(dvc, lock_data):\n stage = create_stage(\n PipelineStage,\n dvc,\n PIPELINE_FILE,\n deps=[\"foo\"],\n outs=[\"bar\"],\n params=[\n \"lorem\",\n \"lorem.ipsum\",\n {\"myparams.yaml\": [\"ipsum\", \"foobar\"]},\n ],\n )\n lock_data[\"params\"] = {\n \"params.yaml\": {\n \"lorem\": \"lorem\",\n \"lorem.ipsum\": [\"i\", \"p\", \"s\", \"u\", \"m\"],\n },\n \"myparams.yaml\": {\n # missing value in lock for `foobar` params\n \"ipsum\": \"ipsum\"\n },\n }\n params_deps = split_params_deps(stage)[0]\n assert set(params_deps[0].params) == {\"lorem\", \"lorem.ipsum\"}\n assert set(params_deps[1].params) == {\"ipsum\", \"foobar\"}\n assert not params_deps[0].info\n assert not params_deps[1].info\n\n StageLoader.fill_from_lock(stage, lock_data)\n assert params_deps[0].info == lock_data[\"params\"][\"params.yaml\"]\n assert params_deps[1].info == lock_data[\"params\"][\"myparams.yaml\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/stage/test_loader_pipeline_file.py_test_fill_from_lock_missing_params_section_test_fill_from_lock_missing_params_section.assert_not_params_deps_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_loader_pipeline_file.py_test_fill_from_lock_missing_params_section_test_fill_from_lock_missing_params_section.assert_not_params_deps_0_", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_loader_pipeline_file.py", "file_name": "test_loader_pipeline_file.py", "file_type": "text/x-python", "category": "test", "start_line": 75, "end_line": 86, "span_ids": ["test_fill_from_lock_missing_params_section"], "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_fill_from_lock_missing_params_section(dvc, lock_data):\n stage = create_stage(\n PipelineStage,\n dvc,\n PIPELINE_FILE,\n deps=[\"foo\"],\n outs=[\"bar\"],\n params=[\"lorem\", \"lorem.ipsum\", {\"myparams.yaml\": [\"ipsum\"]}],\n )\n params_deps = split_params_deps(stage)[0]\n StageLoader.fill_from_lock(stage, lock_data)\n assert not params_deps[0].info and not params_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/stage/test_loader_pipeline_file.py_test_fill_from_lock_missing_checksums_test_fill_from_lock_missing_checksums.assert_not_stage_deps_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_loader_pipeline_file.py_test_fill_from_lock_missing_checksums_test_fill_from_lock_missing_checksums.assert_not_stage_deps_1_", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_loader_pipeline_file.py", "file_name": "test_loader_pipeline_file.py", "file_type": "text/x-python", "category": "test", "start_line": 89, "end_line": 102, "span_ids": ["test_fill_from_lock_missing_checksums"], "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 test_fill_from_lock_missing_checksums(dvc, lock_data):\n stage = create_stage(\n PipelineStage,\n dvc,\n PIPELINE_FILE,\n deps=[\"foo\", \"foo1\"],\n outs=[\"bar\", \"bar1\"],\n )\n\n StageLoader.fill_from_lock(stage, lock_data)\n\n assert stage.deps[0].info == {\"md5\": \"foo_checksum\"}\n assert stage.outs[0].info == {\"md5\": \"bar_checksum\"}\n assert not stage.deps[1].checksum and not stage.outs[1].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/unit/stage/test_loader_pipeline_file.py_test_fill_from_lock_use_appropriate_checksum_test_fill_from_lock_use_appropriate_checksum.assert_stage_outs_0_chec": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_loader_pipeline_file.py_test_fill_from_lock_use_appropriate_checksum_test_fill_from_lock_use_appropriate_checksum.assert_stage_outs_0_chec", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_loader_pipeline_file.py", "file_name": "test_loader_pipeline_file.py", "file_type": "text/x-python", "category": "test", "start_line": 105, "end_line": 118, "span_ids": ["test_fill_from_lock_use_appropriate_checksum"], "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_fill_from_lock_use_appropriate_checksum(dvc, lock_data):\n stage = create_stage(\n PipelineStage,\n dvc,\n PIPELINE_FILE,\n deps=[\"s3://dvc-temp/foo\"],\n outs=[\"bar\"],\n )\n lock_data[\"deps\"] = [\n {\"path\": \"s3://dvc-temp/foo\", \"md5\": \"high five\", \"etag\": \"e-tag\"}\n ]\n StageLoader.fill_from_lock(stage, lock_data)\n assert stage.deps[0].checksum == \"e-tag\"\n assert stage.outs[0].checksum == \"bar_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/unit/stage/test_loader_pipeline_file.py_test_fill_from_lock_with_missing_sections_test_fill_from_lock_empty_data.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_loader_pipeline_file.py_test_fill_from_lock_with_missing_sections_test_fill_from_lock_empty_data.None_1", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_loader_pipeline_file.py", "file_name": "test_loader_pipeline_file.py", "file_type": "text/x-python", "category": "test", "start_line": 121, "end_line": 145, "span_ids": ["test_fill_from_lock_empty_data", "test_fill_from_lock_with_missing_sections"], "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": "def test_fill_from_lock_with_missing_sections(dvc, lock_data):\n stage = create_stage(\n PipelineStage, dvc, PIPELINE_FILE, deps=[\"foo\"], outs=[\"bar\"]\n )\n lock = deepcopy(lock_data)\n del lock[\"deps\"]\n StageLoader.fill_from_lock(stage, lock)\n assert not stage.deps[0].checksum\n assert stage.outs[0].checksum == \"bar_checksum\"\n\n lock = deepcopy(lock_data)\n del lock[\"outs\"]\n StageLoader.fill_from_lock(stage, lock)\n assert stage.deps[0].checksum == \"foo_checksum\"\n assert not stage.outs[0].checksum\n\n\ndef test_fill_from_lock_empty_data(dvc):\n stage = create_stage(\n PipelineStage, dvc, PIPELINE_FILE, deps=[\"foo\"], outs=[\"bar\"]\n )\n StageLoader.fill_from_lock(stage, None)\n assert not stage.deps[0].checksum and not stage.outs[0].checksum\n StageLoader.fill_from_lock(stage, {})\n assert not stage.deps[0].checksum and not 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/unit/stage/test_loader_pipeline_file.py_test_load_stage_test_load_stage.assert_stage_outs_0_chec": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_loader_pipeline_file.py_test_load_stage_test_load_stage.assert_stage_outs_0_chec", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_loader_pipeline_file.py", "file_name": "test_loader_pipeline_file.py", "file_type": "text/x-python", "category": "test", "start_line": 148, "end_line": 159, "span_ids": ["test_load_stage"], "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_load_stage(dvc, stage_data, lock_data):\n dvcfile = Dvcfile(dvc, PIPELINE_FILE)\n stage = StageLoader.load_stage(dvcfile, \"stage-1\", stage_data, lock_data)\n\n assert stage.wdir == os.path.abspath(os.curdir)\n assert stage.name == \"stage-1\"\n assert stage.cmd == \"command\"\n assert stage.path == os.path.abspath(PIPELINE_FILE)\n assert stage.deps[0].def_path == \"foo\"\n assert stage.deps[0].checksum == \"foo_checksum\"\n assert stage.outs[0].def_path == \"bar\"\n assert stage.outs[0].checksum == \"bar_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/unit/stage/test_loader_pipeline_file.py_test_load_stage_outs_with_flags_test_load_stage_no_lock.assert_not_stage_outs_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_loader_pipeline_file.py_test_load_stage_outs_with_flags_test_load_stage_no_lock.assert_not_stage_outs_0_", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_loader_pipeline_file.py", "file_name": "test_loader_pipeline_file.py", "file_type": "text/x-python", "category": "test", "start_line": 162, "end_line": 174, "span_ids": ["test_load_stage_no_lock", "test_load_stage_outs_with_flags"], "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_load_stage_outs_with_flags(dvc, stage_data, lock_data):\n stage_data[\"outs\"] = [{\"foo\": {\"cache\": False}}]\n dvcfile = Dvcfile(dvc, PIPELINE_FILE)\n stage = StageLoader.load_stage(dvcfile, \"stage-1\", stage_data, lock_data)\n assert stage.outs[0].use_cache is False\n\n\ndef test_load_stage_no_lock(dvc, stage_data):\n dvcfile = Dvcfile(dvc, PIPELINE_FILE)\n stage = StageLoader.load_stage(dvcfile, \"stage-1\", stage_data)\n assert stage.deps[0].def_path == \"foo\" and stage.outs[0].def_path == \"bar\"\n assert not stage.deps[0].checksum\n assert not 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/unit/stage/test_loader_pipeline_file.py_test_load_stage_with_params_test_load_stage_with_params.assert_stage_outs_0_chec": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_loader_pipeline_file.py_test_load_stage_with_params_test_load_stage_with_params.assert_stage_outs_0_chec", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_loader_pipeline_file.py", "file_name": "test_loader_pipeline_file.py", "file_type": "text/x-python", "category": "test", "start_line": 177, "end_line": 188, "span_ids": ["test_load_stage_with_params"], "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_load_stage_with_params(dvc, stage_data, lock_data):\n lock_data[\"params\"] = {\"params.yaml\": {\"lorem\": \"ipsum\"}}\n stage_data[\"params\"] = [\"lorem\"]\n dvcfile = Dvcfile(dvc, PIPELINE_FILE)\n stage = StageLoader.load_stage(dvcfile, \"stage-1\", stage_data, lock_data)\n\n params, deps = split_params_deps(stage)\n assert deps[0].def_path == \"foo\" and stage.outs[0].def_path == \"bar\"\n assert params[0].def_path == \"params.yaml\"\n assert params[0].info == {\"lorem\": \"ipsum\"}\n assert deps[0].checksum == \"foo_checksum\"\n assert stage.outs[0].checksum == \"bar_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/unit/stage/test_loader_pipeline_file.py_test_load_stage_with_metrics_and_plots_test_load_stage_with_metrics_and_plots.assert_stage_outs_0_chec": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_loader_pipeline_file.py_test_load_stage_with_metrics_and_plots_test_load_stage_with_metrics_and_plots.assert_stage_outs_0_chec", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_loader_pipeline_file.py", "file_name": "test_loader_pipeline_file.py", "file_type": "text/x-python", "category": "test", "start_line": 191, "end_line": 198, "span_ids": ["test_load_stage_with_metrics_and_plots"], "tokens": 109}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"typ\", [\"metrics\", \"plots\"])\ndef test_load_stage_with_metrics_and_plots(dvc, stage_data, lock_data, typ):\n stage_data[typ] = stage_data.pop(\"outs\")\n dvcfile = Dvcfile(dvc, PIPELINE_FILE)\n stage = StageLoader.load_stage(dvcfile, \"stage-1\", stage_data, lock_data)\n\n assert stage.outs[0].def_path == \"bar\"\n assert stage.outs[0].checksum == \"bar_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/unit/stage/test_loader_pipeline_file.py_test_load_changed_command_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_loader_pipeline_file.py_test_load_changed_command_", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_loader_pipeline_file.py", "file_name": "test_loader_pipeline_file.py", "file_type": "text/x-python", "category": "test", "start_line": 201, "end_line": 230, "span_ids": ["test_load_stage_mapping", "test_load_changed_command", "test_load_stage_wdir_and_path_correctly"], "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": "def test_load_changed_command(dvc, stage_data, lock_data):\n dvcfile = Dvcfile(dvc, PIPELINE_FILE)\n stage = StageLoader.load_stage(dvcfile, \"stage-1\", stage_data)\n assert not stage.cmd_changed\n assert stage.cmd == \"command\"\n\n lock_data[\"cmd\"] = \"different-command\"\n stage = StageLoader.load_stage(dvcfile, \"stage-1\", stage_data, lock_data)\n assert stage.cmd_changed\n assert stage.cmd == \"command\"\n\n\ndef test_load_stage_wdir_and_path_correctly(dvc, stage_data, lock_data):\n stage_data[\"wdir\"] = \"dir\"\n dvcfile = Dvcfile(dvc, PIPELINE_FILE)\n stage = StageLoader.load_stage(dvcfile, \"stage-1\", stage_data, lock_data)\n\n assert stage.wdir == os.path.abspath(\"dir\")\n assert stage.path == os.path.abspath(PIPELINE_FILE)\n\n\ndef test_load_stage_mapping(dvc, stage_data, lock_data):\n dvcfile = Dvcfile(dvc, PIPELINE_FILE)\n loader = StageLoader(dvcfile, {\"stage\": stage_data}, {\"stage\": lock_data})\n assert len(loader) == 1\n assert \"stage\" in loader\n assert \"stage1\" not in loader\n assert loader.keys() == {\"stage\"}\n assert isinstance(loader[\"stage\"], PipelineStage)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/stage/test_run.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_run.py__", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 15, "span_ids": ["imports", "test_run_stage_dry"], "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": "import logging\n\nfrom dvc.stage import Stage\nfrom dvc.stage.run import run_stage\n\n\ndef test_run_stage_dry(caplog):\n with caplog.at_level(level=logging.INFO, logger=\"dvc\"):\n stage = Stage(None, \"stage.dvc\", cmd=\"mycmd arg1 arg2\")\n run_stage(stage, dry=True)\n assert caplog.messages == [\n \"Running callback stage 'stage.dvc' with command:\",\n \"\\t\" + \"mycmd arg1 arg2\",\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/stage/test_serialize_pipeline_file.py_os_test_outs_sorted.assert_to_pipeline_file_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_serialize_pipeline_file.py_os_test_outs_sorted.assert_to_pipeline_file_s", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_serialize_pipeline_file.py", "file_name": "test_serialize_pipeline_file.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 64, "span_ids": ["test_outs_sorted", "imports", "test_wdir", "test_cmd", "to_pipeline_file", "test_deps_sorted"], "tokens": 415}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 voluptuous import Schema as _Schema\n\nfrom dvc import output\nfrom dvc.dvcfile import PIPELINE_FILE\nfrom dvc.schema import SINGLE_PIPELINE_STAGE_SCHEMA\nfrom dvc.stage import PipelineStage, create_stage\nfrom dvc.stage.serialize import to_pipeline_file as _to_pipeline_file\n\nkwargs = {\"name\": \"something\", \"cmd\": \"command\", \"path\": PIPELINE_FILE}\nSchema = _Schema(SINGLE_PIPELINE_STAGE_SCHEMA)\n\n\ndef to_pipeline_file(stage):\n \"\"\"Validate schema on each serialization.\"\"\"\n e = _to_pipeline_file(stage)\n assert len(Schema(e)) == 1\n return e\n\n\ndef test_cmd(dvc):\n stage = create_stage(PipelineStage, dvc, **kwargs)\n entry = to_pipeline_file(stage)\n assert entry == {\"something\": {\"cmd\": \"command\"}}\n\n\ndef test_wdir(dvc):\n stage = create_stage(PipelineStage, dvc, **kwargs)\n assert stage.PARAM_WDIR not in to_pipeline_file(stage)[\"something\"]\n\n stage.wdir = os.curdir\n assert stage.PARAM_WDIR not in to_pipeline_file(stage)[\"something\"]\n\n stage.wdir = \"some-dir\"\n assert to_pipeline_file(stage)[\"something\"][stage.PARAM_WDIR] == \"some-dir\"\n\n\ndef test_deps_sorted(dvc):\n stage = create_stage(\n PipelineStage, dvc, deps=[\"a\", \"quick\", \"lazy\", \"fox\"], **kwargs\n )\n assert to_pipeline_file(stage)[\"something\"][stage.PARAM_DEPS] == [\n \"a\",\n \"fox\",\n \"lazy\",\n \"quick\",\n ]\n\n\ndef test_outs_sorted(dvc):\n stage = create_stage(\n PipelineStage,\n dvc,\n outs=[\"too\", \"many\", \"outs\"],\n deps=[\"foo\"],\n **kwargs,\n )\n assert to_pipeline_file(stage)[\"something\"][stage.PARAM_OUTS] == [\n \"many\",\n \"outs\",\n \"too\",\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/stage/test_serialize_pipeline_file.py_test_params_sorted_test_params_sorted.assert_to_pipeline_file_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_serialize_pipeline_file.py_test_params_sorted_test_params_sorted.assert_to_pipeline_file_s", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_serialize_pipeline_file.py", "file_name": "test_serialize_pipeline_file.py", "file_type": "text/x-python", "category": "test", "start_line": 67, "end_line": 82, "span_ids": ["test_params_sorted"], "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_params_sorted(dvc):\n params = [\n \"lorem\",\n \"ipsum\",\n {\"custom.yaml\": [\"wxyz\", \"pqrs\", \"baz\"]},\n {\"params.yaml\": [\"barr\"]},\n ]\n stage = create_stage(\n PipelineStage, dvc, outs=[\"bar\"], deps=[\"foo\"], params=params, **kwargs\n )\n assert to_pipeline_file(stage)[\"something\"][stage.PARAM_PARAMS] == [\n \"barr\",\n \"ipsum\",\n \"lorem\",\n {\"custom.yaml\": [\"baz\", \"pqrs\", \"wxyz\"]},\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/stage/test_serialize_pipeline_file.py_test_params_file_sorted_test_params_file_sorted.assert_to_pipeline_file_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_serialize_pipeline_file.py_test_params_file_sorted_test_params_file_sorted.assert_to_pipeline_file_s", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_serialize_pipeline_file.py", "file_name": "test_serialize_pipeline_file.py", "file_type": "text/x-python", "category": "test", "start_line": 85, "end_line": 100, "span_ids": ["test_params_file_sorted"], "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_params_file_sorted(dvc):\n params = [\n \"lorem\",\n \"ipsum\",\n {\"custom.yaml\": [\"wxyz\", \"pqrs\", \"baz\"]},\n {\"a-file-of-params.yaml\": [\"barr\"]},\n ]\n stage = create_stage(\n PipelineStage, dvc, outs=[\"bar\"], deps=[\"foo\"], params=params, **kwargs\n )\n assert to_pipeline_file(stage)[\"something\"][stage.PARAM_PARAMS] == [\n \"ipsum\",\n \"lorem\",\n {\"a-file-of-params.yaml\": [\"barr\"]},\n {\"custom.yaml\": [\"baz\", \"pqrs\", \"wxyz\"]},\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/stage/test_serialize_pipeline_file.py_test_outs_and_outs_flags_are_sorted_test_outs_and_outs_flags_are_sorted.assert_list_serialized_ou": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_serialize_pipeline_file.py_test_outs_and_outs_flags_are_sorted_test_outs_and_outs_flags_are_sorted.assert_list_serialized_ou", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_serialize_pipeline_file.py", "file_name": "test_serialize_pipeline_file.py", "file_type": "text/x-python", "category": "test", "start_line": 103, "end_line": 123, "span_ids": ["test_outs_and_outs_flags_are_sorted"], "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": "@pytest.mark.parametrize(\n \"typ, extra\",\n [(\"plots\", {\"plot\": True}), (\"metrics\", {\"metric\": True}), (\"outs\", {})],\n)\ndef test_outs_and_outs_flags_are_sorted(dvc, typ, extra):\n stage = create_stage(PipelineStage, dvc, deps=[\"input\"], **kwargs)\n stage.outs += output.loads_from(stage, [\"barr\"], use_cache=False, **extra)\n stage.outs += output.loads_from(\n stage, [\"foobar\"], use_cache=False, persist=True, **extra\n )\n stage.outs += output.loads_from(stage, [\"foo\"], persist=True, **extra)\n stage.outs += output.loads_from(stage, [\"bar\"], **extra)\n\n serialized_outs = to_pipeline_file(stage)[\"something\"][typ]\n assert serialized_outs == [\n \"bar\",\n {\"barr\": {\"cache\": False}},\n {\"foo\": {\"persist\": True}},\n {\"foobar\": {\"cache\": False, \"persist\": True}},\n ]\n assert list(serialized_outs[3][\"foobar\"].keys()) == [\"cache\", \"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/unit/stage/test_serialize_pipeline_file.py_test_plot_props_test_always_changed.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_serialize_pipeline_file.py_test_plot_props_test_always_changed.None_1", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_serialize_pipeline_file.py", "file_name": "test_serialize_pipeline_file.py", "file_type": "text/x-python", "category": "test", "start_line": 126, "end_line": 158, "span_ids": ["test_always_changed", "test_plot_props", "test_frozen"], "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": "def test_plot_props(dvc):\n props = {\"x\": \"1\"}\n stage = create_stage(PipelineStage, dvc, plots=[\"plot_file\"], **kwargs)\n stage.outs[0].plot = props\n\n assert to_pipeline_file(stage)[\"something\"][stage.PARAM_PLOTS] == [\n {\"plot_file\": props}\n ]\n\n\ndef test_frozen(dvc):\n stage = create_stage(\n PipelineStage, dvc, outs=[\"output\"], deps=[\"input\"], **kwargs\n )\n assert stage.PARAM_FROZEN not in to_pipeline_file(stage)[\"something\"]\n\n stage = create_stage(PipelineStage, dvc, **kwargs, frozen=True)\n assert to_pipeline_file(stage)[\"something\"][stage.PARAM_FROZEN] is True\n\n\ndef test_always_changed(dvc):\n stage = create_stage(\n PipelineStage, dvc, outs=[\"output\"], deps=[\"input\"], **kwargs\n )\n assert (\n stage.PARAM_ALWAYS_CHANGED not in to_pipeline_file(stage)[\"something\"]\n )\n\n stage = create_stage(PipelineStage, dvc, **kwargs, always_changed=True)\n assert (\n to_pipeline_file(stage)[\"something\"][stage.PARAM_ALWAYS_CHANGED]\n is 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/stage/test_serialize_pipeline_file.py_test_order_test_order.assert_list_to_pipeline_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_serialize_pipeline_file.py_test_order_test_order.assert_list_to_pipeline_f", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_serialize_pipeline_file.py", "file_name": "test_serialize_pipeline_file.py", "file_type": "text/x-python", "category": "test", "start_line": 161, "end_line": 180, "span_ids": ["test_order"], "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_order(dvc):\n stage = create_stage(\n PipelineStage,\n dvc,\n outs=[\"output\"],\n deps=[\"input\"],\n **kwargs,\n always_changed=True,\n frozen=True,\n )\n # `create_stage` checks for existence of `wdir`\n stage.wdir = \"some-dir\"\n assert list(to_pipeline_file(stage)[\"something\"].keys()) == [\n \"cmd\",\n \"wdir\",\n \"deps\",\n \"outs\",\n \"frozen\",\n \"always_changed\",\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/stage/test_serialize_pipeline_file.py_test_order_deps_outs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_serialize_pipeline_file.py_test_order_deps_outs_", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_serialize_pipeline_file.py", "file_name": "test_serialize_pipeline_file.py", "file_type": "text/x-python", "category": "test", "start_line": 183, "end_line": 197, "span_ids": ["test_order_deps_outs"], "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 \"typ\", [\"outs\", \"metrics\", \"plots\", \"params\", \"deps\", None]\n)\ndef test_order_deps_outs(dvc, typ):\n all_types = [\"deps\", \"params\", \"outs\", \"metrics\", \"plots\"]\n all_types = [item for item in all_types if item != typ]\n extra = {key: [f\"foo-{i}\"] for i, key in enumerate(all_types)}\n\n stage = create_stage(PipelineStage, dvc, **kwargs, **extra)\n assert typ not in to_pipeline_file(stage)[\"something\"]\n assert (\n list(to_pipeline_file(stage)[\"something\"].keys())\n == [\"cmd\"] + all_types\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/stage/test_serialize_pipeline_lock.py_from_collections_import_O_test_lock_deps.assert_to_single_stage_lo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_serialize_pipeline_lock.py_from_collections_import_O_test_lock_deps.assert_to_single_stage_lo", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_serialize_pipeline_lock.py", "file_name": "test_serialize_pipeline_lock.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 39, "span_ids": ["to_single_stage_lockfile", "imports", "test_lock", "test_lock_deps"], "tokens": 296}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\n\nimport pytest\nfrom voluptuous import Schema as _Schema\n\nfrom dvc.dvcfile import PIPELINE_FILE\nfrom dvc.schema import LOCK_FILE_STAGE_SCHEMA, LOCKFILE_SCHEMA\nfrom dvc.stage import PipelineStage, create_stage\nfrom dvc.stage.serialize import DEFAULT_PARAMS_FILE, to_lockfile\nfrom dvc.stage.serialize import (\n to_single_stage_lockfile as _to_single_stage_lockfile,\n)\nfrom dvc.stage.utils import split_params_deps\n\nkwargs = {\"name\": \"something\", \"cmd\": \"command\", \"path\": PIPELINE_FILE}\nSchema = _Schema(LOCK_FILE_STAGE_SCHEMA)\n\n\ndef to_single_stage_lockfile(stage):\n \"\"\"Validate schema on each serialization.\"\"\"\n e = _to_single_stage_lockfile(stage)\n assert Schema(e)\n return e\n\n\ndef test_lock(dvc):\n stage = create_stage(PipelineStage, dvc, **kwargs)\n assert to_single_stage_lockfile(stage) == {\"cmd\": \"command\"}\n\n\ndef test_lock_deps(dvc):\n stage = create_stage(PipelineStage, dvc, deps=[\"input\"], **kwargs)\n stage.deps[0].info = {\"md5\": \"md-five\"}\n assert to_single_stage_lockfile(stage) == OrderedDict(\n [\n (\"cmd\", \"command\"),\n (\"deps\", [OrderedDict([(\"path\", \"input\"), (\"md5\", \"md-five\")])]),\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/unit/stage/test_serialize_pipeline_lock.py_test_lock_deps_order_test_lock_deps_order.assert_to_single_stage_lo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_serialize_pipeline_lock.py_test_lock_deps_order_test_lock_deps_order.assert_to_single_stage_lo", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_serialize_pipeline_lock.py", "file_name": "test_serialize_pipeline_lock.py", "file_type": "text/x-python", "category": "test", "start_line": 42, "end_line": 59, "span_ids": ["test_lock_deps_order"], "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_lock_deps_order(dvc):\n stage = create_stage(\n PipelineStage, dvc, deps=[\"input1\", \"input0\"], **kwargs\n )\n stage.deps[0].info = {\"md5\": \"md-one1\"}\n stage.deps[1].info = {\"md5\": \"md-zer0\"}\n assert to_single_stage_lockfile(stage) == OrderedDict(\n [\n (\"cmd\", \"command\"),\n (\n \"deps\",\n [\n OrderedDict([(\"path\", \"input0\"), (\"md5\", \"md-zer0\")]),\n OrderedDict([(\"path\", \"input1\"), (\"md5\", \"md-one1\")]),\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/unit/stage/test_serialize_pipeline_lock.py_test_lock_params_test_lock_params.assert_to_single_stage_lo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_serialize_pipeline_lock.py_test_lock_params_test_lock_params.assert_to_single_stage_lo", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_serialize_pipeline_lock.py", "file_name": "test_serialize_pipeline_lock.py", "file_type": "text/x-python", "category": "test", "start_line": 62, "end_line": 69, "span_ids": ["test_lock_params"], "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_lock_params(dvc):\n stage = create_stage(\n PipelineStage, dvc, params=[\"lorem.ipsum\", \"abc\"], **kwargs\n )\n stage.deps[0].info = {\"lorem.ipsum\": {\"lorem1\": 1, \"lorem2\": 2}, \"abc\": 3}\n assert to_single_stage_lockfile(stage)[\"params\"][\n DEFAULT_PARAMS_FILE\n ] == OrderedDict([(\"abc\", 3), (\"lorem.ipsum\", {\"lorem1\": 1, \"lorem2\": 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/stage/test_serialize_pipeline_lock.py_test_lock_params_file_sorted_test_lock_params_file_sorted.assert_to_single_stage_lo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_serialize_pipeline_lock.py_test_lock_params_file_sorted_test_lock_params_file_sorted.assert_to_single_stage_lo", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_serialize_pipeline_lock.py", "file_name": "test_serialize_pipeline_lock.py", "file_type": "text/x-python", "category": "test", "start_line": 72, "end_line": 104, "span_ids": ["test_lock_params_file_sorted"], "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": "def test_lock_params_file_sorted(dvc):\n stage = create_stage(\n PipelineStage,\n dvc,\n params=[\n \"lorem.ipsum\",\n \"abc\",\n {\"myparams.yaml\": [\"foo\", \"foobar\"]},\n {\"a-params-file.yaml\": [\"bar\", \"barr\"]},\n ],\n **kwargs\n )\n stage.deps[0].info = {\"lorem.ipsum\": {\"lorem1\": 1, \"lorem2\": 2}, \"abc\": 3}\n stage.deps[1].info = {\"foo\": [\"f\", \"o\", \"o\"], \"foobar\": \"foobar\"}\n stage.deps[2].info = {\"bar\": [\"b\", \"a\", \"r\"], \"barr\": \"barr\"}\n assert to_single_stage_lockfile(stage)[\"params\"] == OrderedDict(\n [\n (\n DEFAULT_PARAMS_FILE,\n OrderedDict(\n [(\"abc\", 3), (\"lorem.ipsum\", {\"lorem1\": 1, \"lorem2\": 2})]\n ),\n ),\n (\n \"a-params-file.yaml\",\n OrderedDict([(\"bar\", [\"b\", \"a\", \"r\"]), (\"barr\", \"barr\")]),\n ),\n (\n \"myparams.yaml\",\n OrderedDict([(\"foo\", [\"f\", \"o\", \"o\"]), (\"foobar\", \"foobar\")]),\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/unit/stage/test_serialize_pipeline_lock.py_test_lock_params_no_values_filled_test_lock_outs.assert_to_single_stage_lo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_serialize_pipeline_lock.py_test_lock_params_no_values_filled_test_lock_outs.assert_to_single_stage_lo", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_serialize_pipeline_lock.py", "file_name": "test_serialize_pipeline_lock.py", "file_type": "text/x-python", "category": "test", "start_line": 107, "end_line": 123, "span_ids": ["test_lock_outs", "test_lock_params_no_values_filled"], "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_lock_params_no_values_filled(dvc):\n stage = create_stage(\n PipelineStage, dvc, params=[\"lorem.ipsum\", \"abc\"], **kwargs\n )\n assert to_single_stage_lockfile(stage) == {\"cmd\": \"command\"}\n\n\n@pytest.mark.parametrize(\"typ\", [\"plots\", \"metrics\", \"outs\"])\ndef test_lock_outs(dvc, typ):\n stage = create_stage(PipelineStage, dvc, **{typ: [\"input\"]}, **kwargs)\n stage.outs[0].info = {\"md5\": \"md-five\"}\n assert to_single_stage_lockfile(stage) == OrderedDict(\n [\n (\"cmd\", \"command\"),\n (\"outs\", [OrderedDict([(\"path\", \"input\"), (\"md5\", \"md-five\")])]),\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/unit/stage/test_serialize_pipeline_lock.py_test_lock_outs_order_test_lock_outs_order.assert_to_single_stage_lo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_serialize_pipeline_lock.py_test_lock_outs_order_test_lock_outs_order.assert_to_single_stage_lo", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_serialize_pipeline_lock.py", "file_name": "test_serialize_pipeline_lock.py", "file_type": "text/x-python", "category": "test", "start_line": 126, "end_line": 144, "span_ids": ["test_lock_outs_order"], "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": "@pytest.mark.parametrize(\"typ\", [\"plots\", \"metrics\", \"outs\"])\ndef test_lock_outs_order(dvc, typ):\n stage = create_stage(\n PipelineStage, dvc, **{typ: [\"input1\", \"input0\"]}, **kwargs\n )\n stage.outs[0].info = {\"md5\": \"md-one1\"}\n stage.outs[1].info = {\"md5\": \"md-zer0\"}\n assert to_single_stage_lockfile(stage) == OrderedDict(\n [\n (\"cmd\", \"command\"),\n (\n \"outs\",\n [\n OrderedDict([(\"path\", \"input0\"), (\"md5\", \"md-zer0\")]),\n OrderedDict([(\"path\", \"input1\"), (\"md5\", \"md-one1\")]),\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/unit/stage/test_serialize_pipeline_lock.py_test_dump_appropriate_checksums_test_dump_appropriate_checksums.assert_to_single_stage_lo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_serialize_pipeline_lock.py_test_dump_appropriate_checksums_test_dump_appropriate_checksums.assert_to_single_stage_lo", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_serialize_pipeline_lock.py", "file_name": "test_serialize_pipeline_lock.py", "file_type": "text/x-python", "category": "test", "start_line": 147, "end_line": 167, "span_ids": ["test_dump_appropriate_checksums"], "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_dump_appropriate_checksums(dvc):\n stage = create_stage(\n PipelineStage, dvc, deps=[\"s3://dvc-temp/file\"], **kwargs\n )\n stage.deps[0].info = {\"etag\": \"is-it-etag\", \"md5\": \"or-md5?\"}\n assert to_single_stage_lockfile(stage) == OrderedDict(\n [\n (\"cmd\", \"command\"),\n (\n \"deps\",\n [\n OrderedDict(\n [\n (\"path\", \"s3://dvc-temp/file\"),\n (\"etag\", \"is-it-etag\"),\n ]\n )\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/unit/stage/test_serialize_pipeline_lock.py_test_order_test_order.assert_to_single_stage_lo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_serialize_pipeline_lock.py_test_order_test_order.assert_to_single_stage_lo", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_serialize_pipeline_lock.py", "file_name": "test_serialize_pipeline_lock.py", "file_type": "text/x-python", "category": "test", "start_line": 170, "end_line": 192, "span_ids": ["test_order"], "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": "def test_order(dvc):\n stage = create_stage(\n PipelineStage,\n dvc,\n deps=[\"input\"],\n outs=[\"output\"],\n params=[\"foo-param\"],\n **kwargs\n )\n params, deps = split_params_deps(stage)\n\n deps[0].info = {\"md5\": \"md-five\"}\n params[0].info = {\"foo-param\": \"value\"}\n stage.outs[0].info = {\"md5\": \"md5-output\"}\n\n assert to_single_stage_lockfile(stage) == OrderedDict(\n [\n (\"cmd\", \"command\"),\n (\"deps\", [{\"path\": \"input\", \"md5\": \"md-five\"}]),\n (\"params\", {\"params.yaml\": {\"foo-param\": \"value\"}}),\n (\"outs\", [{\"path\": \"output\", \"md5\": \"md5-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/tests/unit/stage/test_serialize_pipeline_lock.py_test_to_lockfile_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_serialize_pipeline_lock.py_test_to_lockfile_", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_serialize_pipeline_lock.py", "file_name": "test_serialize_pipeline_lock.py", "file_type": "text/x-python", "category": "test", "start_line": 195, "end_line": 209, "span_ids": ["test_to_lockfile"], "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": "def test_to_lockfile(dvc):\n stage = create_stage(PipelineStage, dvc, deps=[\"input\"], **kwargs)\n stage.deps[0].info = {\"md5\": \"md-five\"}\n entry = to_lockfile(stage)\n assert len(entry) == 1\n _Schema(LOCKFILE_SCHEMA)(entry)\n assert entry == {\n \"something\": OrderedDict(\n [\n (\"cmd\", \"command\"),\n (\"deps\", [{\"path\": \"input\", \"md5\": \"md-five\"}]),\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/unit/stage/test_stage.py_os_test_path_conversion.assert_stage_dumpd_wdi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_stage.py_os_test_path_conversion.assert_stage_dumpd_wdi", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 56, "span_ids": ["imports", "test_path_conversion", "test_wdir_default_ignored", "test_meta_ignored", "test_wdir_non_default_is_not_ignored", "test_stage_checksum"], "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": "import os\nimport signal\nimport subprocess\nimport threading\n\nimport mock\nimport pytest\n\nfrom dvc.dependency.repo import RepoDependency\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\", cmd=\"mycmd\")\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\", cmd=\"mycmd\")\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\", cmd=\"mycmd\")\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\", cmd=\"mycmd\")\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\ndef test_path_conversion(dvc):\n stage = Stage(dvc, \"path\")\n\n stage.wdir = os.path.join(\"..\", \"..\")\n assert 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/tests/unit/stage/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/stage/test_stage.py_test_stage_update_test_stage_update.with_pytest_raises_StageU.stage_update_", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 59, "end_line": 75, "span_ids": ["test_stage_update"], "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_stage_update(mocker):\n dep = RepoDependency({\"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/stage/test_utils.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_utils.py_os_", "embedding": null, "metadata": {"file_path": "tests/unit/stage/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_resolve_paths"], "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": "import os\n\nfrom dvc.stage.utils import resolve_paths\n\n\ndef test_resolve_paths():\n p = os.path.join(\"dir\", \"subdir\")\n file_path = os.path.join(p, \"dvc.yaml\")\n\n path, wdir = resolve_paths(path=file_path, wdir=\"dir\")\n assert path == os.path.abspath(file_path)\n assert wdir == os.path.abspath(os.path.join(p, \"dir\"))\n\n path, wdir = resolve_paths(path=file_path)\n assert path == os.path.abspath(file_path)\n assert wdir == os.path.abspath(p)\n\n path, wdir = resolve_paths(path=file_path, wdir=\"../../some-dir\")\n assert path == os.path.abspath(file_path)\n assert wdir == os.path.abspath(\"some-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/test_dvcfile.py_pytest_test_stage_load_on_invalid_data.None_1.assert_dvcfile_validate_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_dvcfile.py_pytest_test_stage_load_on_invalid_data.None_1.assert_dvcfile_validate_d", "embedding": null, "metadata": {"file_path": "tests/unit/test_dvcfile.py", "file_name": "test_dvcfile.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 61, "span_ids": ["test_pipelines_file", "imports", "test_pipelines_single_stage_file", "test_stage_load_on_invalid_data", "test_stage_load_on_not_existing_file"], "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": "import pytest\n\nfrom dvc.dvcfile import (\n PIPELINE_FILE,\n PIPELINE_LOCK,\n Dvcfile,\n PipelineFile,\n SingleStageFile,\n)\nfrom dvc.stage import PipelineStage\nfrom dvc.stage.exceptions import (\n StageFileDoesNotExistError,\n StageFileFormatError,\n StageFileIsNotDvcFileError,\n)\nfrom dvc.utils.yaml import dump_yaml\n\n\n@pytest.mark.parametrize(\n \"path\",\n [\n \"pipelines.yaml\",\n \"pipelines.yml\",\n \"custom-pipelines.yml\",\n \"custom-pipelines.yaml\",\n \"../models/pipelines.yml\",\n ],\n)\ndef test_pipelines_file(path):\n file_obj = Dvcfile(object(), path)\n assert isinstance(file_obj, PipelineFile)\n\n\n@pytest.mark.parametrize(\n \"path\", [\"Dvcfile\", \"stage.dvc\", \"../models/stage.dvc\"]\n)\ndef test_pipelines_single_stage_file(path):\n file_obj = Dvcfile(object(), path)\n assert isinstance(file_obj, SingleStageFile)\n\n\n@pytest.mark.parametrize(\"file\", [\"stage.dvc\", \"dvc.yaml\"])\ndef test_stage_load_on_not_existing_file(tmp_dir, dvc, file):\n dvcfile = Dvcfile(dvc, file)\n assert not dvcfile.exists()\n with pytest.raises(StageFileDoesNotExistError):\n assert dvcfile.stages.values()\n (tmp_dir / file).mkdir()\n with pytest.raises(StageFileIsNotDvcFileError):\n assert dvcfile.stages.values()\n\n\n@pytest.mark.parametrize(\"file\", [\"stage.dvc\", \"dvc.yaml\"])\ndef test_stage_load_on_invalid_data(tmp_dir, dvc, file):\n data = {\"is_this_a_valid_dvcfile\": False}\n dump_yaml(file, data)\n dvcfile = Dvcfile(dvc, file)\n with pytest.raises(StageFileFormatError):\n assert dvcfile.stages\n with pytest.raises(StageFileFormatError):\n assert dvcfile.validate(data, 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/test_dvcfile.py_test_dump_stage_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_dvcfile.py_test_dump_stage_", "embedding": null, "metadata": {"file_path": "tests/unit/test_dvcfile.py", "file_name": "test_dvcfile.py", "file_type": "text/x-python", "category": "test", "start_line": 64, "end_line": 82, "span_ids": ["test_dump_stage"], "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_dump_stage(tmp_dir, dvc):\n stage = PipelineStage(\n dvc, cmd=\"command\", name=\"stage_name\", path=\"dvc.yaml\"\n )\n dvcfile = Dvcfile(dvc, \"dvc.yaml\")\n\n dvcfile.dump(stage, no_lock=True)\n assert not (tmp_dir / PIPELINE_FILE).exists()\n assert not (tmp_dir / PIPELINE_LOCK).exists()\n\n dvcfile.dump(stage, no_lock=False)\n assert not (tmp_dir / PIPELINE_FILE).exists()\n assert dvcfile._lockfile.load()\n\n dvcfile.dump(stage, update_pipeline=True, no_lock=False)\n assert (tmp_dir / PIPELINE_FILE).exists()\n assert (tmp_dir / PIPELINE_LOCK).exists()\n assert list(dvcfile.stages.values()) == [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/unit/test_run.py_pytest_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_run.py_pytest_", "embedding": null, "metadata": {"file_path": "tests/unit/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 37, "span_ids": ["imports", "test_parse_params", "test_valid_stage_names", "test_invalid_stage_names"], "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 pytest\n\nfrom dvc.repo.run import is_valid_name, parse_params\n\n\ndef test_parse_params():\n assert parse_params(\n [\n \"param1\",\n \"file1:param1,param2\",\n \"file2:param2\",\n \"file1:param2,param3,\",\n \"param1,param2\",\n \"param3,\",\n \"file3:\",\n ]\n ) == [\n \"param1\",\n {\"file1\": [\"param1\", \"param2\"]},\n {\"file2\": [\"param2\"]},\n {\"file1\": [\"param2\", \"param3\"]},\n \"param1\",\n \"param2\",\n \"param3\",\n {\"file3\": []},\n ]\n\n\n@pytest.mark.parametrize(\"name\", [\"copy_name\", \"copy-name\", \"copyName\", \"12\"])\ndef test_valid_stage_names(name):\n assert is_valid_name(name)\n\n\n@pytest.mark.parametrize(\"name\", [\"copy$name\", \"copy-name?\", \"copy-name@v1\"])\ndef test_invalid_stage_names(name):\n assert not is_valid_name(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/cli.py_get_main_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cli.py_get_main_parser_", "embedding": null, "metadata": {"file_path": "dvc/cli.py", "file_name": "cli.py", "file_type": "text/x-python", "category": "implementation", "start_line": 145, "end_line": 208, "span_ids": ["get_main_parser", "parse_args"], "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": "def get_main_parser():\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 return parser\n\n\ndef 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 parser = get_main_parser()\n args = parser.parse_args(argv)\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/completion.py_argparse_CmdCompletion.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/completion.py_argparse_CmdCompletion.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/completion.py", "file_name": "completion.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 37, "span_ids": ["imports", "CmdCompletion.run", "CmdCompletion"], "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": "import argparse\nimport logging\n\nimport shtab\n\nfrom dvc.command.base import CmdBaseNoRepo, append_doc_link\n\nlogger = logging.getLogger(__name__)\nFILE = shtab.FILE\nDIR = shtab.DIRECTORY\nDVC_FILE = {\n \"bash\": \"_dvc_compgen_DVCFiles\",\n \"zsh\": \"_files -g '(*?.dvc|Dvcfile|dvc.yaml)'\",\n}\nPREAMBLE = {\n \"bash\": \"\"\"\n# $1=COMP_WORDS[1]\n_dvc_compgen_DVCFiles() {\n compgen -d -S '/' -- $1 # recurse into subdirs\n compgen -f -X '!*?.dvc' -- $1\n compgen -f -X '!*Dvcfile' -- $1\n compgen -f -X '!*dvc.yaml' -- $1\n}\n\"\"\",\n \"zsh\": \"\",\n}\n\n\nclass CmdCompletion(CmdBaseNoRepo):\n def run(self):\n from dvc.cli import get_main_parser\n\n parser = get_main_parser()\n shell = self.args.shell\n script = shtab.complete(parser, shell=shell, preamble=PREAMBLE)\n print(script)\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/completion.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/completion.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/completion.py", "file_name": "completion.py", "file_type": "text/x-python", "category": "implementation", "start_line": 51, "end_line": 69, "span_ids": ["add_parser"], "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": "def add_parser(subparsers, parent_parser):\n COMPLETION_HELP = \"Generate shell tab completion.\"\n COMPLETION_DESCRIPTION = \"Prints out shell tab completion scripts.\"\n completion_parser = subparsers.add_parser(\n \"completion\",\n parents=[parent_parser],\n description=append_doc_link(COMPLETION_DESCRIPTION, \"completion\"),\n help=COMPLETION_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n completion_parser.add_argument(\n \"-s\",\n \"--shell\",\n help=\"Shell syntax for completions.\",\n default=\"bash\",\n choices=[\"bash\", \"zsh\"],\n )\n completion_parser.set_defaults(func=CmdCompletion)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_import_c_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_import_c_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": 33, "span_ids": ["CmdDaemonAnalytics.run", "CmdDaemonBase", "imports", "CmdDaemonUpdater.run", "CmdDaemonAnalytics", "CmdDaemonUpdater"], "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": "from dvc.command import completion\nfrom dvc.command.base import CmdBaseNoRepo, 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 tmp_dir = os.path.join(dvc_dir, \"tmp\")\n config = Config(dvc_dir, validate=False)\n hardlink_lock = config.get(\"core\", {}).get(\"hardlink_lock\", False)\n updater = Updater(tmp_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/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": 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 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/ls/__init__.py_argparse__prettify.return._fmt_entry_for_entry_in_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/ls/__init__.py_argparse__prettify.return._fmt_entry_for_entry_in_", "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": 22, "span_ids": ["imports", "_prettify"], "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": "import argparse\nimport logging\nimport sys\n\nfrom dvc.command import completion\nfrom dvc.command.base import CmdBaseNoRepo, append_doc_link\nfrom dvc.command.ls.ls_colors import LsColors\nfrom dvc.exceptions import DvcException\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]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_CmdList_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_CmdList_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": 25, "end_line": 43, "span_ids": ["CmdList.run", "CmdList"], "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": "class 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 dvc_only=self.args.dvc_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(f\"failed to list '{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/run.py_add_parser_add_parser.None_16": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/run.py_add_parser_add_parser.None_16", "embedding": null, "metadata": {"file_path": "dvc/command/run.py", "file_name": "run.py", "file_type": "text/x-python", "category": "implementation", "start_line": 86, "end_line": 213, "span_ids": ["add_parser"], "tokens": 770}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 \"-n\", \"--name\", help=\"Stage name.\",\n )\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.\",\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 (do not put into DVC cache).\",\n metavar=\"\",\n )\n run_parser.add_argument(\n \"--plots\",\n action=\"append\",\n default=[],\n help=\"Declare output plot file.\",\n metavar=\"\",\n )\n run_parser.add_argument(\n \"--plots-no-cache\",\n action=\"append\",\n default=[],\n help=\"Declare output plot file (do not put into DVC cache).\",\n metavar=\"\",\n )\n run_parser.add_argument(\n \"--file\", metavar=\"\", help=argparse.SUPPRESS,\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 \"-f\",\n \"--force\",\n action=\"store_true\",\n default=False,\n help=\"Overwrite existing stage\",\n )\n run_parser.add_argument(\n \"--no-run-cache\",\n action=\"store_true\",\n default=False,\n help=(\n \"Execute the command even if this stage has already been run \"\n \"with the same command/dependencies/outputs/etc before.\"\n ),\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 # ... 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/run.py_add_parser.None_17_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/run.py_add_parser.None_17_", "embedding": null, "metadata": {"file_path": "dvc/command/run.py", "file_name": "run.py", "file_type": "text/x-python", "category": "implementation", "start_line": 214, "end_line": 236, "span_ids": ["add_parser"], "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": "def add_parser(subparsers, parent_parser):\n # ... other code\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 \"--single-stage\",\n action=\"store_true\",\n default=False,\n help=argparse.SUPPRESS,\n )\n run_parser.add_argument(\n \"--external\",\n action=\"store_true\",\n default=False,\n help=\"Allow outputs that are outside of the DVC repository.\",\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/dependency/__init__.py__get_loads_from.return.__get_stage_s_info_copy": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/__init__.py__get_loads_from.return.__get_stage_s_info_copy", "embedding": null, "metadata": {"file_path": "dvc/dependency/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 54, "end_line": 85, "span_ids": ["loadd_from", "loads_from", "_get"], "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 _get(stage, p, info):\n parsed = urlparse(p) if p else None\n if parsed and parsed.scheme == \"remote\":\n remote = get_remote(stage.repo, name=parsed.netloc)\n return DEP_MAP[remote.scheme](stage, p, info, remote=remote)\n\n if info and info.get(RepoDependency.PARAM_REPO):\n repo = info.pop(RepoDependency.PARAM_REPO)\n return RepoDependency(repo, stage, p, info)\n\n if info and info.get(ParamsDependency.PARAM_PARAMS):\n params = info.pop(ParamsDependency.PARAM_PARAMS)\n return ParamsDependency(stage, p, params)\n\n for d in DEPS:\n if d.supported(p):\n return d(stage, p, info)\n return LocalDependency(stage, p, info)\n\n\ndef loadd_from(stage, d_list):\n ret = []\n for d in d_list:\n p = d.pop(BaseOutput.PARAM_PATH, None)\n ret.append(_get(stage, p, d))\n return ret\n\n\ndef loads_from(stage, s_list, erepo=None):\n assert isinstance(s_list, list)\n info = {RepoDependency.PARAM_REPO: erepo} if erepo else {}\n return [_get(stage, s, info.copy()) for s in s_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/dvcfile.py_collections_check_dvc_filename.if_not_is_valid_filename_.raise_StageFileBadNameErr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dvcfile.py_collections_check_dvc_filename.if_not_is_valid_filename_.raise_StageFileBadNameErr", "embedding": null, "metadata": {"file_path": "dvc/dvcfile.py", "file_name": "dvcfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 53, "span_ids": ["imports", "is_dvc_file", "check_dvc_filename", "is_valid_filename", "LockfileCorruptedError"], "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": "import collections\nimport contextlib\nimport logging\nimport os\n\nfrom voluptuous import MultipleInvalid\n\nfrom dvc.exceptions import DvcException\nfrom dvc.stage import serialize\nfrom dvc.stage.exceptions import (\n StageFileBadNameError,\n StageFileDoesNotExistError,\n StageFileFormatError,\n StageFileIsNotDvcFileError,\n)\nfrom dvc.stage.loader import SingleStageLoader, StageLoader\nfrom dvc.utils import relpath\nfrom dvc.utils.collections import apply_diff\nfrom dvc.utils.yaml import dump_yaml, parse_yaml, parse_yaml_for_update\n\nlogger = logging.getLogger(__name__)\n\nDVC_FILE = \"Dvcfile\"\nDVC_FILE_SUFFIX = \".dvc\"\nPIPELINE_FILE = \"dvc.yaml\"\nPIPELINE_LOCK = \"dvc.lock\"\n\n\nclass LockfileCorruptedError(DvcException):\n pass\n\n\ndef is_valid_filename(path):\n return path.endswith(DVC_FILE_SUFFIX) or os.path.basename(path) in [\n DVC_FILE,\n PIPELINE_FILE,\n ]\n\n\ndef is_dvc_file(path):\n return os.path.isfile(path) and (\n is_valid_filename(path) or os.path.basename(path) == PIPELINE_LOCK\n )\n\n\ndef check_dvc_filename(path):\n if not 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 )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_LoggerHandler.emit.try_.except_Exception_noqa.self_handleError_record_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py_LoggerHandler_LoggerHandler.emit.try_.except_Exception_noqa.self_handleError_record_", "embedding": null, "metadata": {"file_path": "dvc/logger.py", "file_name": "logger.py", "file_type": "text/x-python", "category": "implementation", "start_line": 125, "end_line": 141, "span_ids": ["LoggerHandler.handleError", "LoggerHandler", "LoggerHandler.emit"], "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": "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: # noqa, pylint: disable=broad-except\n self.handleError(record)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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__is_verbose_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__is_verbose_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": 144, "end_line": 179, "span_ids": ["_stack_trace", "_is_verbose", "disable_other_loggers", "_iter_causes"], "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 _is_verbose():\n return (\n logging.NOTSET\n < logging.getLogger(\"dvc\").getEffectiveLevel()\n <= logging.DEBUG\n )\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/repo/tree.py_DvcTree.isfile_DvcTree._add_dir.for_entry_in_dir_cache_.trie_path_info_parts_N": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_DvcTree.isfile_DvcTree._add_dir.for_entry_in_dir_cache_.trie_path_info_parts_N", "embedding": null, "metadata": {"file_path": "dvc/repo/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 136, "end_line": 162, "span_ids": ["DvcTree._add_dir", "DvcTree.isfile"], "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 DvcTree(BaseTree):\n\n def isfile(self, path):\n if not self.exists(path):\n return False\n\n return not self.isdir(path)\n\n def _add_dir(self, top, trie, out, download_callback=None, **kwargs):\n if not self.fetch and not self.stream:\n return\n\n # pull dir cache if needed\n dir_cache = out.get_dir_cache(**kwargs)\n\n # pull dir contents if needed\n if self.fetch:\n if out.changed_cache(filter_info=top):\n used_cache = out.get_used_cache(filter_info=top)\n downloaded = self.repo.cloud.pull(used_cache, **kwargs)\n if download_callback:\n download_callback(downloaded)\n\n for entry in dir_cache:\n entry_relpath = entry[out.remote.tree.PARAM_RELPATH]\n if os.name == \"nt\":\n entry_relpath = entry_relpath.replace(\"/\", os.sep)\n path_info = out.path_info / entry_relpath\n trie[path_info.parts] = 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/tree.py_DvcTree._walk_DvcTree._walk.for_dname_in_dirs_.yield_from_self__walk_roo": {"__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.for_dname_in_dirs_.yield_from_self__walk_roo", "embedding": null, "metadata": {"file_path": "dvc/repo/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 162, "end_line": 187, "span_ids": ["DvcTree._walk"], "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 DvcTree(BaseTree):\n\n def _walk(self, root, trie, topdown=True, **kwargs):\n dirs = set()\n files = []\n\n out = trie.get(root.parts)\n if out and out.is_dir_checksum:\n self._add_dir(root, trie, out, **kwargs)\n\n root_len = len(root.parts)\n for key, out in trie.iteritems(prefix=root.parts): # noqa: B301\n if key == root.parts:\n continue\n\n name = key[root_len]\n if len(key) > root_len + 1 or (out and out.is_dir_checksum):\n dirs.add(name)\n continue\n\n files.append(name)\n\n assert topdown\n dirs = list(dirs)\n yield root.fspath, dirs, files\n\n for dname in dirs:\n yield from self._walk(root / dname, trie)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": 112, "end_line": 136, "span_ids": ["GitTree._git_object_by_path"], "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 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 if path.split(os.sep, 1)[0] == \"..\":\n # path points outside of git repository\n return None\n\n try:\n tree = self.git.tree(self.rev)\n except git.exc.BadName as exc: # pylint: disable=no-member\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/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": 52, "span_ids": ["Updater._with_lock", "Updater.__init__", "imports", "Updater", "Updater.check", "Updater._is_outdated_file"], "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": "import logging\nimport os\nimport sys\nimport time\n\nimport colorama\nfrom packaging import version\n\nfrom dvc import __version__\nfrom dvc.lock import LockError, make_lock\nfrom dvc.utils import boxify, env2bool\nfrom dvc.utils.pkg import PKG\n\nlogger = logging.getLogger(__name__)\n\n\nclass Updater: # 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, tmp_dir, friendly=False, hardlink_lock=False):\n self.updater_file = os.path.join(tmp_dir, self.UPDATER_FILE)\n self.lock = make_lock(\n self.updater_file + \".lock\",\n tmp_dir=tmp_dir,\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(f\"'{self.updater_file}' is outdated(\")\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._check_Updater._check.if_version_parse_self_cur.self__notify_latest_": {"__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_version_parse_self_cur.self__notify_latest_", "embedding": null, "metadata": {"file_path": "dvc/updater.py", "file_name": "updater.py", "file_type": "text/x-python", "category": "implementation", "start_line": 54, "end_line": 72, "span_ids": ["Updater._check"], "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": "class Updater:\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) as fobj:\n import json\n\n try:\n info = json.load(fobj)\n latest = info[\"version\"]\n except Exception as exc: # pylint: disable=broad-except\n msg = \"'{}' is not a valid json: {}\"\n logger.debug(msg.format(self.updater_file, exc))\n self.fetch()\n return\n\n if version.parse(self.current) < version.parse(latest):\n self._notify(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.fetch_Updater._get_latest_version.with_open_self_updater_fi.json_dump_info_fobj_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater.fetch_Updater._get_latest_version.with_open_self_updater_fi.json_dump_info_fobj_", "embedding": null, "metadata": {"file_path": "dvc/updater.py", "file_name": "updater.py", "file_type": "text/x-python", "category": "implementation", "start_line": 74, "end_line": 96, "span_ids": ["Updater.fetch", "Updater._get_latest_version"], "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 Updater:\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 resp = requests.get(self.URL, timeout=self.TIMEOUT_GET)\n info = resp.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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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__Needs_investigation_py_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/__main__.py__Needs_investigation_py_", "embedding": null, "metadata": {"file_path": "tests/__main__.py", "file_name": "__main__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 24, "span_ids": ["docstring"], "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": "# Needs investigation, pylint was running tests\n# Could be `pylint_pytest` plugin, skipping check for this file for now\n# pylint: skip-file\n\nimport os\nimport sys\nfrom subprocess import check_call\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/func/test_data_cloud.py_logging_test_cloud.with_dvc_state_.None_13": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_logging_test_cloud.with_dvc_state_.None_13", "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": 95, "span_ids": ["test_cloud", "imports"], "tokens": 757}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 shutil\n\nimport pytest\nfrom flaky.flaky_decorator import flaky\n\nfrom dvc.cache import NamedCache\nfrom dvc.external_repo import clean_repos\nfrom dvc.main import main\nfrom dvc.remote.base import STATUS_DELETED, STATUS_NEW, STATUS_OK\nfrom dvc.remote.local import LocalRemoteTree\nfrom dvc.stage.exceptions import StageNotFound\nfrom dvc.utils.fs import remove\nfrom dvc.utils.yaml import dump_yaml, load_yaml\n\nfrom .test_api import all_clouds\n\n\n@pytest.mark.parametrize(\"remote\", all_clouds, indirect=True)\ndef test_cloud(tmp_dir, dvc, remote): # pylint:disable=unused-argument\n (stage,) = tmp_dir.dvc_gen(\"foo\", \"foo\")\n out = stage.outs[0]\n cache = out.cache_path\n md5 = out.checksum\n info = out.get_used_cache()\n\n (stage_dir,) = tmp_dir.dvc_gen(\n {\n \"data_dir\": {\n \"data_sub_dir\": {\"data_sub\": \"data_sub\"},\n \"data\": \"data\",\n }\n }\n )\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 dvc.state:\n # Check status\n status = dvc.cloud.status(info, show_checksums=True)\n expected = {md5: {\"name\": md5, \"status\": STATUS_NEW}}\n assert status == expected\n\n status_dir = dvc.cloud.status(info_dir, show_checksums=True)\n expected = {md5_dir: {\"name\": md5_dir, \"status\": STATUS_NEW}}\n assert status_dir == expected\n\n # Push and check status\n dvc.cloud.push(info)\n assert os.path.exists(cache)\n assert os.path.isfile(cache)\n\n dvc.cloud.push(info_dir)\n assert os.path.isfile(cache_dir)\n\n status = dvc.cloud.status(info, show_checksums=True)\n expected = {md5: {\"name\": md5, \"status\": STATUS_OK}}\n assert status == expected\n\n status_dir = dvc.cloud.status(info_dir, show_checksums=True)\n expected = {md5_dir: {\"name\": md5_dir, \"status\": STATUS_OK}}\n assert status_dir == expected\n\n # Remove and check status\n remove(dvc.cache.local.cache_dir)\n\n status = dvc.cloud.status(info, show_checksums=True)\n expected = {md5: {\"name\": md5, \"status\": STATUS_DELETED}}\n assert status == expected\n\n status_dir = dvc.cloud.status(info_dir, show_checksums=True)\n expected = {md5_dir: {\"name\": md5_dir, \"status\": STATUS_DELETED}}\n assert status_dir == expected\n\n # Pull and check status\n dvc.cloud.pull(info)\n assert os.path.exists(cache)\n assert os.path.isfile(cache)\n with open(cache) as fd:\n assert fd.read() == \"foo\"\n\n dvc.cloud.pull(info_dir)\n assert os.path.isfile(cache_dir)\n\n status = dvc.cloud.status(info, show_checksums=True)\n expected = {md5: {\"name\": md5, \"status\": STATUS_OK}}\n assert status == expected\n\n status_dir = dvc.cloud.status(info_dir, show_checksums=True)\n expected = {md5_dir: {\"name\": md5_dir, \"status\": STATUS_OK}}\n assert status_dir == 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/test_data_cloud.py_test_data_cloud_error_cli_test_warn_on_outdated_stage.with_caplog_at_level_logg.assert_expected_warning_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_test_data_cloud_error_cli_test_warn_on_outdated_stage.with_caplog_at_level_logg.assert_expected_warning_i", "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": 161, "end_line": 187, "span_ids": ["test_warn_on_outdated_stage", "test_data_cloud_error_cli"], "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_data_cloud_error_cli(dvc):\n f = \"non-existing-file\"\n assert main([\"status\", \"-c\", f])\n assert main([\"push\", f])\n assert main([\"pull\", f])\n assert main([\"fetch\", f])\n\n\ndef test_warn_on_outdated_stage(tmp_dir, dvc, local_remote, caplog):\n stage = dvc.run(outs=[\"bar\"], cmd=\"echo bar > bar\", single_stage=True)\n assert main([\"push\"]) == 0\n\n stage_file_path = stage.relpath\n content = load_yaml(stage_file_path)\n del content[\"outs\"][0][\"md5\"]\n dump_yaml(stage_file_path, content)\n\n with caplog.at_level(logging.WARNING, logger=\"dvc\"):\n caplog.clear()\n assert main([\"status\", \"-c\"]) == 0\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 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_data_cloud.py_test_missing_cache_test_missing_cache.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_test_missing_cache_test_missing_cache.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": 204, "end_line": 233, "span_ids": ["test_missing_cache"], "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_missing_cache(tmp_dir, dvc, local_remote, caplog):\n tmp_dir.dvc_gen({\"foo\": \"foo\", \"bar\": \"bar\"})\n\n # purge cache\n remove(dvc.cache.local.cache_dir)\n\n header = (\n \"Some of the cache files do not exist \"\n \"neither locally nor on remote. Missing cache files:\\n\"\n )\n foo = \"name: bar, md5: 37b51d194a7513e45b56f6524f2d51f2\\n\"\n bar = \"name: foo, md5: acbd18db4cc2f85cedef654fccc4a4d8\\n\"\n\n caplog.clear()\n dvc.push()\n assert header in caplog.text\n assert foo in caplog.text\n assert bar in caplog.text\n\n caplog.clear()\n dvc.fetch()\n assert header in caplog.text\n assert foo in caplog.text\n assert bar in caplog.text\n\n caplog.clear()\n dvc.status(cloud=True)\n assert header in caplog.text\n assert foo in caplog.text\n assert bar 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_dvcfile.py_test_stage_collection_test_stage_collection.assert_set_dvc_stages_": {"__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_test_stage_collection.assert_set_dvc_stages_", "embedding": null, "metadata": {"file_path": "tests/func/test_dvcfile.py", "file_name": "test_dvcfile.py", "file_type": "text/x-python", "category": "test", "start_line": 137, "end_line": 160, "span_ids": ["test_stage_collection"], "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_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\",\n deps=[\"bar\"],\n metrics=[\"bar2\"],\n always_changed=True,\n single_stage=True,\n )\n assert set(dvc.stages) == {stage1, stage3, stage2}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\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_test_import_stage_accompanies_target.None_1": {"__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_test_import_stage_accompanies_target.None_1", "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": 91, "end_line": 100, "span_ids": ["test_import_stage_accompanies_target"], "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_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\": os.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_ls.py_test_ls_not_existed_url_test_ls_shows_pipeline_tracked_outs.match_files_files_ba": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_not_existed_url_test_ls_shows_pipeline_tracked_outs.match_files_files_ba", "embedding": null, "metadata": {"file_path": "tests/func/test_ls.py", "file_name": "test_ls.py", "file_type": "text/x-python", "category": "test", "start_line": 430, "end_line": 447, "span_ids": ["test_ls_not_existed_url", "test_ls_shows_pipeline_tracked_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_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)\n\n\ndef test_ls_shows_pipeline_tracked_outs(tmp_dir, dvc, scm, run_copy):\n from dvc.dvcfile import PIPELINE_FILE, PIPELINE_LOCK\n\n tmp_dir.gen(\"foo\", \"foo\")\n run_copy(\"foo\", \"bar\", name=\"copy-foo-bar\")\n dvc.scm.add([PIPELINE_FILE, PIPELINE_LOCK])\n dvc.scm.commit(\"add pipeline stage\")\n\n files = Repo.ls(os.curdir, dvc_only=True)\n match_files(files, (((\"bar\",), 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_remove.py_os_test_remove.for_stage_in_stage1_sta.assert_not_any_out_in_get": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remove.py_os_test_remove.for_stage_in_stage1_sta.assert_not_any_out_in_get", "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": 32, "span_ids": ["imports", "test_remove"], "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": "import os\n\nimport pytest\n\nfrom dvc.exceptions import DvcException\nfrom dvc.main import main\nfrom dvc.stage.exceptions import StageFileDoesNotExistError\nfrom dvc.system import System\nfrom dvc.utils.fs import remove\nfrom tests.utils import get_gitignore_content\n\n\n@pytest.mark.parametrize(\"remove_outs\", [True, False])\ndef test_remove(tmp_dir, scm, dvc, run_copy, remove_outs):\n (stage1,) = tmp_dir.dvc_gen(\"foo\", \"foo\")\n stage2 = run_copy(\"foo\", \"bar\", single_stage=True)\n stage3 = run_copy(\"bar\", \"foobar\", name=\"copy-bar-foobar\")\n\n assert \"/foo\" in get_gitignore_content()\n assert \"/bar\" in get_gitignore_content()\n assert \"/foobar\" in get_gitignore_content()\n\n for stage in [stage1, stage2, stage3]:\n dvc.remove(stage.addressing, outs=remove_outs)\n out_exists = (out.exists for out in stage.outs)\n assert stage not in dvc._collect_stages()\n if remove_outs:\n assert not any(out_exists)\n else:\n assert all(out_exists)\n\n assert not any(out in get_gitignore_content() for out in stage.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/tests/func/test_repo.py_test_stages_test_stages.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_test_stages_test_stages.None_1", "embedding": null, "metadata": {"file_path": "tests/func/test_repo.py", "file_name": "test_repo.py", "file_type": "text/x-python", "category": "test", "start_line": 138, "end_line": 152, "span_ids": ["test_stages"], "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_stages(tmp_dir, dvc):\n def collect_stages():\n return {stage.relpath for stage in Repo(os.fspath(tmp_dir)).stages}\n\n tmp_dir.dvc_gen({\"file\": \"a\", \"dir/file\": \"b\", \"dir/subdir/file\": \"c\"})\n\n assert collect_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 collect_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_TestReproDepUnderDir_TestReproDepUnderDir.test.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproDepUnderDir_TestReproDepUnderDir.test.None_5", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 231, "end_line": 252, "span_ids": ["TestReproDepUnderDir.test", "TestReproDepUnderDir"], "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 TestReproDepUnderDir(SingleStageRun, TestDvc):\n def test(self):\n stages = self.dvc.add(self.DATA_DIR)\n self.assertTrue(stages and stages[0] is not None)\n\n file1 = \"file1\"\n stage = self._run(\n fname=file1 + \".dvc\",\n outs=[file1],\n deps=[self.DATA, self.CODE],\n cmd=f\"python {self.CODE} {self.DATA} {file1}\",\n name=\"copy-data-file1\",\n )\n\n self.assertTrue(filecmp.cmp(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(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/unit/command/test_git_hook.py_pytest_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_git_hook.py_pytest_", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_git_hook.py", "file_name": "test_git_hook.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 22, "span_ids": ["imports", "test_out_of_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": "import pytest\n\nfrom dvc.cli import parse_args\nfrom dvc.command.git_hook import CmdPostCheckout, CmdPreCommit, CmdPrePush\n\n\n@pytest.mark.parametrize(\n \"hook, cls\",\n [\n (\"pre-commit\", CmdPreCommit),\n (\"post-checkout\", CmdPostCheckout),\n (\"pre-push\", CmdPrePush),\n ],\n)\ndef test_out_of_repo(tmp_dir, hook, cls, mocker):\n cli_args = parse_args([\"git-hook\", hook])\n assert cli_args.func == cls\n cmd = cli_args.func(cli_args)\n mock_main = mocker.patch(\"dvc.main.main\")\n assert cmd.run() == 0\n assert not mock_main.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/output/test_load.py__pylint_disable_unsubsc_test_load_from_pipeline.for_i_out_in_enumerate_o.assert_type_test_func_out": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_load.py__pylint_disable_unsubsc_test_load_from_pipeline.for_i_out_in_enumerate_o.assert_type_test_func_out", "embedding": null, "metadata": {"file_path": "tests/unit/output/test_load.py", "file_name": "test_load.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 43, "span_ids": ["test_load_from_pipeline", "docstring"], "tokens": 320}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# pylint: disable=unsubscriptable-object\n\nimport pytest\n\nfrom dvc import output\nfrom dvc.output import LocalOutput, S3Output\nfrom dvc.stage import Stage\n\n\n@pytest.mark.parametrize(\n \"out_type,type_test_func\",\n [\n (\"outs\", lambda o: not (o.metric or o.plot)),\n (\"metrics\", lambda o: o.metric and not o.plot),\n (\"plots\", lambda o: o.plot and not o.metric),\n ],\n ids=(\"outs\", \"metrics\", \"plots\"),\n)\ndef test_load_from_pipeline(dvc, out_type, type_test_func):\n outs = output.load_from_pipeline(\n Stage(dvc),\n [\n \"file1\",\n \"file2\",\n {\"file3\": {\"cache\": True}},\n {},\n {\"file4\": {\"cache\": False}},\n {\"file5\": {\"persist\": False}},\n {\"file6\": {\"persist\": True, \"cache\": False}},\n ],\n out_type,\n )\n cached_outs = {\"file1\", \"file2\", \"file3\", \"file5\"}\n persisted_outs = {\"file6\"}\n assert len(outs) == 6\n\n for i, out in enumerate(outs, start=1):\n assert isinstance(out, LocalOutput)\n assert out.def_path == f\"file{i}\"\n assert out.use_cache == (out.def_path in cached_outs)\n assert out.persist == (out.def_path in persisted_outs)\n assert out.info == {}\n assert type_test_func(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/repo/test_run.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/repo/test_run.py__", "embedding": null, "metadata": {"file_path": "tests/unit/repo/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 13, "span_ids": ["imports", "test_file"], "tokens": 84}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 InvalidArgumentError\n\n\ndef test_file(tmp_dir, dvc):\n msg = (\n \"`--file` is currently incompatible with `-n|--name` \"\n \"and requires `--single-stage`\"\n )\n with pytest.raises(InvalidArgumentError, match=msg):\n dvc.run(fname=\"path/dvc.yaml\", name=\"my\", cmd=\"mycmd\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/stage/test_stage.py_test_stage_run_ignore_sigint_test_stage_run_ignore_sigint.assert_signal_getsignal_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_stage.py_test_stage_run_ignore_sigint_test_stage_run_ignore_sigint.assert_signal_getsignal_s", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 78, "end_line": 98, "span_ids": ["test_stage_run_ignore_sigint"], "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": "@pytest.mark.skipif(\n not isinstance(\n threading.current_thread(),\n threading._MainThread, # noqa, pylint: disable=protected-access\n ),\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\", single_stage=True)\n\n assert popen.called_once()\n assert communicate.called_once_with()\n signal_mock.assert_any_call(signal.SIGINT, signal.SIG_IGN)\n # pylint: disable=comparison-with-callable\n assert signal.getsignal(signal.SIGINT) == signal.default_int_handler", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/stage/test_stage.py_test_always_changed_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/stage/test_stage.py_test_always_changed_", "embedding": null, "metadata": {"file_path": "tests/unit/stage/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 98, "end_line": 122, "span_ids": ["test_always_changed", "test_external_outs"], "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_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\"]\n\n\ndef test_external_outs(tmp_path_factory, dvc):\n from dvc.stage import create_stage\n from dvc.stage.exceptions import StageExternalOutputsError\n\n tmp_path = tmp_path_factory.mktemp(\"external-outs\")\n foo = tmp_path / \"foo\"\n foo.write_text(\"foo\")\n\n with pytest.raises(StageExternalOutputsError):\n create_stage(Stage, dvc, \"path.dvc\", outs=[os.fspath(foo)])\n\n with dvc.config.edit() as conf:\n conf[\"remote\"][\"myremote\"] = {\"url\": os.fspath(tmp_path)}\n\n create_stage(Stage, dvc, \"path.dvc\", outs=[\"remote://myremote/foo\"])\n create_stage(Stage, dvc, \"path.dvc\", outs=[os.fspath(foo)], external=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/unit/test_updater.py_test_check_updates_test_check_updates.if_notify_.else_.assert_not_caplog_text": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_updater.py_test_check_updates_test_check_updates.if_notify_.else_.assert_not_caplog_text", "embedding": null, "metadata": {"file_path": "tests/unit/test_updater.py", "file_name": "test_updater.py", "file_type": "text/x-python", "category": "test", "start_line": 47, "end_line": 68, "span_ids": ["test_check_updates"], "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": "@pytest.mark.parametrize(\n \"current,latest,notify\",\n [\n (\"0.0.2\", \"0.0.2\", False),\n (\"0.0.2\", \"0.0.3\", True),\n (\"0.0.2\", \"0.0.1\", False),\n ],\n ids=[\"uptodate\", \"behind\", \"ahead\"],\n)\ndef test_check_updates(mock_tty, updater, caplog, current, latest, notify):\n updater.current = current\n with open(updater.updater_file, \"w+\") as f:\n json.dump({\"version\": latest}, f)\n\n caplog.clear()\n with caplog.at_level(logging.INFO, logger=\"dvc.updater\"):\n updater.check()\n\n if notify:\n assert f\"Update available {current} -> {latest}\" in caplog.text\n else:\n assert not 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_updater.py_test_check_refetches_each_day_test_check_refetches_each_day.mock_time_assert_called_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_updater.py_test_check_refetches_each_day_test_check_refetches_each_day.mock_time_assert_called_", "embedding": null, "metadata": {"file_path": "tests/unit/test_updater.py", "file_name": "test_updater.py", "file_type": "text/x-python", "category": "test", "start_line": 71, "end_line": 85, "span_ids": ["test_check_refetches_each_day"], "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_check_refetches_each_day(mock_tty, updater, caplog, mocker):\n updater.current = \"0.0.8\"\n with open(updater.updater_file, \"w+\") as f:\n json.dump({\"version\": \"0.0.9\"}, f)\n fetch = mocker.patch.object(updater, \"fetch\")\n\n time_value = time.time() + 24 * 60 * 60 + 10\n mock_time = mocker.patch(\"time.time\", return_value=time_value)\n\n caplog.clear()\n with caplog.at_level(logging.INFO, logger=\"dvc.updater\"):\n updater.check()\n assert not caplog.text\n fetch.assert_called_once()\n mock_time.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/unit/test_updater.py_test_check_fetches_on_invalid_data_format_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_updater.py_test_check_fetches_on_invalid_data_format_", "embedding": null, "metadata": {"file_path": "tests/unit/test_updater.py", "file_name": "test_updater.py", "file_type": "text/x-python", "category": "test", "start_line": 88, "end_line": 109, "span_ids": ["test_check", "test_check_fetches_on_invalid_data_format"], "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_check_fetches_on_invalid_data_format(\n mock_tty, updater, caplog, mocker\n):\n updater.current = \"0.0.5\"\n with open(updater.updater_file, \"w+\") as f:\n f.write('\"{\"version: \"0.0.6\"')\n fetch = mocker.patch.object(updater, \"fetch\")\n caplog.clear()\n with caplog.at_level(logging.INFO, logger=\"dvc.updater\"):\n updater.check()\n assert not caplog.text\n fetch.assert_called_once()\n\n\n@mock.patch(\"dvc.updater.Updater._check\")\ndef test_check(mock_check, updater):\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/utils/test_collections.py__pylint_disable_unidiom_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_collections.py__pylint_disable_unidiom_", "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": 51, "span_ids": ["test_apply_diff_seq", "MyDict", "test_apply_diff_mapping", "docstring", "test_apply_diff_is_inplace", "MyInt"], "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": "# pylint: disable=unidiomatic-typecheck\nfrom 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 # pylint: disable=attribute-defined-outside-init\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/dvc/command/metrics.py_add_parser_add_parser.None_10": {"__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_10", "embedding": null, "metadata": {"file_path": "dvc/command/metrics.py", "file_name": "metrics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 140, "end_line": 255, "span_ids": ["add_parser"], "tokens": 756}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 display and compare 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_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=(\n \"Limit command scope to these metric files. Using -R, \"\n \"directories to search metric files in can also be given.\"\n ),\n ).complete = completion.FILE\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 \"--show-json\",\n action=\"store_true\",\n default=False,\n help=\"Show output in JSON format.\",\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.set_defaults(func=CmdMetricsShow)\n\n METRICS_DIFF_HELP = (\n \"Show changes in metrics between commits in the DVC repository, or \"\n \"between a commit and the workspace.\"\n )\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 \"Limit command scope to these metric files. Using -R, \"\n \"directories to search metric files in can also be given.\"\n ),\n metavar=\"\",\n ).complete = completion.FILE\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 # ... 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_11_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_add_parser.None_11_", "embedding": null, "metadata": {"file_path": "dvc/command/metrics.py", "file_name": "metrics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 256, "end_line": 290, "span_ids": ["add_parser"], "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": "def add_parser(subparsers, parent_parser):\n # ... other code\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.add_argument(\n \"--show-md\",\n action=\"store_true\",\n default=False,\n help=\"Show tabulated output in the Markdown format (GFM).\",\n )\n metrics_diff_parser.add_argument(\n \"--old\",\n action=\"store_true\",\n default=False,\n help=\"Show old metric value.\",\n )\n metrics_diff_parser.add_argument(\n \"--no-path\",\n action=\"store_true\",\n default=False,\n help=\"Don't show metric path.\",\n )\n metrics_diff_parser.add_argument(\n \"--precision\",\n type=int,\n help=(\n \"Round metrics to `n` digits precision after the decimal point. \"\n f\"Rounds to {DEFAULT_PRECISION} digits by default.\"\n ),\n metavar=\"\",\n )\n metrics_diff_parser.set_defaults(func=CmdMetricsDiff)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_FileMixin._load_FileMixin._load.return.d_stage_text": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dvcfile.py_FileMixin._load_FileMixin._load.return.d_stage_text", "embedding": null, "metadata": {"file_path": "dvc/dvcfile.py", "file_name": "dvcfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 86, "end_line": 101, "span_ids": ["FileMixin._load"], "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 FileMixin:\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 if not self.exists():\n raise StageFileDoesNotExistError(self.path)\n check_dvc_filename(self.path)\n if not self.repo.tree.isfile(self.path):\n raise StageFileIsNotDvcFileError(self.path)\n\n with self.repo.tree.open(self.path) as fd:\n stage_text = fd.read()\n d = parse_yaml(stage_text, self.path)\n self.validate(d, self.relpath)\n return d, stage_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/dvcfile.py_FileMixin.validate_FileMixin.dump.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dvcfile.py_FileMixin.validate_FileMixin.dump.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "dvc/dvcfile.py", "file_name": "dvcfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 103, "end_line": 116, "span_ids": ["FileMixin.dump", "FileMixin.validate", "FileMixin.remove"], "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 FileMixin:\n\n @classmethod\n def validate(cls, d, fname=None):\n assert isinstance(cls.SCHEMA, collections.abc.Callable)\n try:\n cls.SCHEMA(d) # pylint: disable=not-callable\n except MultipleInvalid as exc:\n raise StageFileFormatError(f\"'{fname}' format error: {exc}\")\n\n def remove(self, force=False): # pylint: disable=unused-argument\n with contextlib.suppress(FileNotFoundError):\n os.unlink(self.path)\n\n def dump(self, stage, **kwargs):\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/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": 29, "end_line": 67, "span_ids": ["clean_repos", "impl:3", "external_repo"], "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": "@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 if not rev:\n rev = \"HEAD\"\n try:\n repo = ExternalRepo(path, url, rev, for_write=for_write)\n except NotDvcRepoError:\n repo = ExternalGitRepo(path, url, rev)\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_BaseExternalRepo_BaseExternalRepo.get_rev.return.self_tree_rev": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py_BaseExternalRepo_BaseExternalRepo.get_rev.return.self_tree_rev", "embedding": null, "metadata": {"file_path": "dvc/external_repo.py", "file_name": "external_repo.py", "file_type": "text/x-python", "category": "implementation", "start_line": 70, "end_line": 106, "span_ids": ["BaseExternalRepo", "BaseExternalRepo.get_rev", "BaseExternalRepo.repo_tree", "BaseExternalRepo.local_cache", "BaseExternalRepo.use_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 BaseExternalRepo:\n # pylint: disable=no-member\n\n _local_cache = None\n\n @property\n def local_cache(self):\n if hasattr(self, \"cache\"):\n return self.cache.local\n return self._local_cache\n\n @contextmanager\n def use_cache(self, cache):\n \"\"\"Use the specified cache in place of default tmpdir cache for\n download operations.\n \"\"\"\n if hasattr(self, \"cache\"):\n save_cache = self.cache.local\n self.cache.local = cache\n self._local_cache = cache\n\n yield\n\n if hasattr(self, \"cache\"):\n self.cache.local = save_cache\n self._local_cache = None\n\n @cached_property\n def repo_tree(self):\n return RepoTree(self, fetch=True)\n\n def get_rev(self):\n if is_working_tree(self.tree):\n return self.scm.get_rev()\n if hasattr(self.tree, \"tree\"):\n return self.tree.tree.rev\n return self.tree.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/path_info.py__pylint_disable_protect__BasePath.isin_or_eq._pylint_disable_no_memb": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py__pylint_disable_protect__BasePath.isin_or_eq._pylint_disable_no_memb", "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": 21, "span_ids": ["_BasePath.overlaps", "_BasePath", "_BasePath.isin_or_eq", "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": "# pylint: disable=protected-access\nimport os\nimport pathlib\nimport posixpath\nfrom urllib.parse import urlparse\n\nfrom funcy import cached_property\n\nfrom dvc.utils import relpath\n\n\nclass _BasePath:\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) # pylint: disable=no-member", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_PathInfo_PathInfo.as_posix.return.self_fspath_replace_f_sep": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_PathInfo_PathInfo.as_posix.return.self_fspath_replace_f_sep", "embedding": null, "metadata": {"file_path": "dvc/path_info.py", "file_name": "path_info.py", "file_type": "text/x-python", "category": "implementation", "start_line": 24, "end_line": 47, "span_ids": ["PathInfo.__new__", "PathInfo", "PathInfo.as_posix"], "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 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 = ( # pylint: disable=self-cls-assignment\n WindowsPathInfo if os.name == \"nt\" else PosixPathInfo\n )\n\n return cls._from_parts(args)\n\n def as_posix(self):\n f = self._flavour # pylint: disable=no-member\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, \"/\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_PathInfo.__str___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_PathInfo.__str___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": 49, "end_line": 76, "span_ids": ["PathInfo:7", "PathInfo.fspath", "PathInfo.__str__", "PathInfo.__repr__", "PathInfo.isin", "PathInfo.__fspath__", "PathInfo.relpath"], "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 PathInfo(pathlib.PurePath, _BasePath):\n # Use __slots__ in PathInfo objects following PurePath implementation.\n # This makes objects smaller and speeds up attribute access.\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 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/tests/func/metrics/test_show.py_test_show_subrepo_with_preexisting_tags_test_show_subrepo_with_preexisting_tags.assert_dvc_metrics_show_a": {"__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_subrepo_with_preexisting_tags_test_show_subrepo_with_preexisting_tags.assert_dvc_metrics_show_a", "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": 65, "end_line": 96, "span_ids": ["test_show_subrepo_with_preexisting_tags"], "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_show_subrepo_with_preexisting_tags(tmp_dir, scm):\n tmp_dir.gen(\"foo\", \"foo\")\n scm.add(\"foo\")\n scm.commit(\"init\")\n scm.tag(\"no-metrics\")\n\n tmp_dir.gen({\"subdir\": {}})\n subrepo_dir = tmp_dir / \"subdir\"\n with subrepo_dir.chdir():\n dvc = Repo.init(subdir=True)\n scm.commit(\"init dvc\")\n\n dvc.run(\n cmd=\"echo foo: 1 > metrics.yaml\",\n metrics=[\"metrics.yaml\"],\n single_stage=True,\n )\n\n scm.add(\n [\n str(subrepo_dir / \"metrics.yaml\"),\n str(subrepo_dir / \"metrics.yaml.dvc\"),\n ]\n )\n scm.commit(\"init metrics\")\n scm.tag(\"v1\")\n\n expected_path = os.path.join(\"subdir\", \"metrics.yaml\")\n assert dvc.metrics.show(all_tags=True) == {\n \"workspace\": {expected_path: {\"foo\": 1}},\n \"v1\": {expected_path: {\"foo\": 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/metrics/test_show.py_test_missing_cache_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/metrics/test_show.py_test_missing_cache_", "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": 99, "end_line": 113, "span_ids": ["test_missing_cache"], "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_missing_cache(tmp_dir, dvc, run_copy_metrics):\n tmp_dir.gen(\"metrics_t.yaml\", \"1.1\")\n run_copy_metrics(\n \"metrics_t.yaml\", \"metrics.yaml\", metrics=[\"metrics.yaml\"],\n )\n\n # This one should be skipped\n stage = run_copy_metrics(\n \"metrics_t.yaml\", \"metrics2.yaml\", metrics=[\"metrics2.yaml\"],\n )\n remove(stage.outs[0].fspath)\n remove(stage.outs[0].cache_path)\n\n assert dvc.metrics.show() == {\"\": {\"metrics.yaml\": 1.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_add_external_file_test_add_external_file.assert_dvc_status_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_add_external_file_test_add_external_file.assert_dvc_status_", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 188, "end_line": 237, "span_ids": ["test_add_external_file"], "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": "@pytest.mark.parametrize(\n \"workspace, hash_name, hash_value\",\n [\n (\n pytest.lazy_fixture(\"local_cloud\"),\n \"md5\",\n \"8c7dd922ad47494fc02c388e12c00eac\",\n ),\n pytest.param(\n pytest.lazy_fixture(\"ssh\"),\n \"md5\",\n \"8c7dd922ad47494fc02c388e12c00eac\",\n marks=pytest.mark.skipif(\n os.name == \"nt\", reason=\"disabled on windows\"\n ),\n ),\n (\n pytest.lazy_fixture(\"s3\"),\n \"etag\",\n \"8c7dd922ad47494fc02c388e12c00eac\",\n ),\n (pytest.lazy_fixture(\"gs\"), \"md5\", \"8c7dd922ad47494fc02c388e12c00eac\"),\n (\n pytest.lazy_fixture(\"hdfs\"),\n \"checksum\",\n \"000002000000000000000000a86fe4d846edc1bf4c355cb6112f141e\",\n ),\n ],\n indirect=[\"workspace\"],\n)\ndef test_add_external_file(tmp_dir, dvc, workspace, hash_name, hash_value):\n from dvc.stage.exceptions import StageExternalOutputsError\n\n workspace.gen(\"file\", \"file\")\n\n with pytest.raises(StageExternalOutputsError):\n dvc.add(workspace.url)\n\n dvc.add(\"remote://workspace/file\")\n assert (tmp_dir / \"file.dvc\").read_text() == (\n \"outs:\\n\"\n f\"- {hash_name}: {hash_value}\\n\"\n \" path: remote://workspace/file\\n\"\n )\n assert (workspace / \"file\").read_text() == \"file\"\n assert (\n workspace / \"cache\" / hash_value[:2] / hash_value[2:]\n ).read_text() == \"file\"\n\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_add.py_test_add_external_dir_test_add_external_dir.assert_workspace_cach": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_test_add_external_dir_test_add_external_dir.assert_workspace_cach", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 240, "end_line": 278, "span_ids": ["test_add_external_dir"], "tokens": 335}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 \"workspace, hash_name, hash_value\",\n [\n (\n pytest.lazy_fixture(\"local_cloud\"),\n \"md5\",\n \"b6dcab6ccd17ca0a8bf4a215a37d14cc.dir\",\n ),\n pytest.param(\n pytest.lazy_fixture(\"ssh\"),\n \"md5\",\n \"b6dcab6ccd17ca0a8bf4a215a37d14cc.dir\",\n marks=pytest.mark.skipif(\n os.name == \"nt\", reason=\"disabled on windows\"\n ),\n ),\n (\n pytest.lazy_fixture(\"s3\"),\n \"etag\",\n \"ec602a6ba97b2dd07bd6d2cd89674a60.dir\",\n ),\n (\n pytest.lazy_fixture(\"gs\"),\n \"md5\",\n \"b6dcab6ccd17ca0a8bf4a215a37d14cc.dir\",\n ),\n ],\n indirect=[\"workspace\"],\n)\ndef test_add_external_dir(tmp_dir, dvc, workspace, hash_name, hash_value):\n workspace.gen({\"dir\": {\"file\": \"file\", \"subdir\": {\"subfile\": \"subfile\"}}})\n\n dvc.add(\"remote://workspace/dir\")\n assert (tmp_dir / \"dir.dvc\").read_text() == (\n \"outs:\\n\"\n f\"- {hash_name}: {hash_value}\\n\"\n \" path: remote://workspace/dir\\n\"\n )\n assert (workspace / \"cache\" / hash_value[:2] / hash_value[2:]).is_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_api.py_test_open_granular_test_missing.with_pytest_raises_FileMi.api_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_open_granular_test_missing.with_pytest_raises_FileMi.api_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": 108, "end_line": 148, "span_ids": ["test_open_granular", "test_missing"], "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": "@pytest.mark.parametrize(\"remote\", all_clouds, indirect=True)\ndef test_open_granular(tmp_dir, dvc, remote):\n tmp_dir.dvc_gen({\"dir\": {\"foo\": \"foo-text\"}})\n dvc.push()\n\n # Remove cache to force download\n remove(dvc.cache.local.cache_dir)\n\n with api.open(\"dir/foo\") as fd:\n assert fd.read() == \"foo-text\"\n\n\n@pytest.mark.parametrize(\n \"remote\",\n [\n pytest.lazy_fixture(cloud)\n for cloud in [\n \"real_s3\", # NOTE: moto's s3 fails in some tests\n \"gs\",\n \"azure\",\n \"gdrive\",\n \"oss\",\n \"ssh\",\n \"hdfs\",\n \"http\",\n ]\n ],\n indirect=True,\n)\ndef test_missing(tmp_dir, dvc, remote):\n tmp_dir.dvc_gen(\"foo\", \"foo\")\n\n # Remove cache to make foo missing\n remove(dvc.cache.local.cache_dir)\n\n api.read(\"foo\")\n\n remove(\"foo\")\n\n with pytest.raises(FileMissingError):\n api.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_api.py_test_open_scm_controlled_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_api.py_test_open_scm_controlled_", "embedding": null, "metadata": {"file_path": "tests/func/test_api.py", "file_name": "test_api.py", "file_type": "text/x-python", "category": "test", "start_line": 151, "end_line": 176, "span_ids": ["test_open_not_cached", "test_open_scm_controlled"], "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_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=os.fspath(erepo_dir)) as fd:\n assert fd.read() == \"file content\"\n\n\ndef 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 single_stage=True,\n metrics_no_cache=[metric_file],\n cmd=(f'python -c \"{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_dvcfile.py__pylint_disable_no_memb_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__pylint_disable_no_memb_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": 33, "span_ids": ["test_run_load_one_for_multistage", "docstring"], "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": "# pylint: disable=no-member\nimport textwrap\n\nimport pytest\n\nfrom dvc.dvcfile import PIPELINE_FILE, PIPELINE_LOCK, Dvcfile, SingleStageFile\nfrom dvc.stage.exceptions import (\n StageFileDoesNotExistError,\n StageFileFormatError,\n)\nfrom dvc.stage.loader import StageNotFound\nfrom dvc.utils.yaml import dump_yaml\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, PIPELINE_FILE).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_gc.py_test_gc_not_collect_pipeline_tracked_files_test_gc_not_collect_pipeline_tracked_files.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_not_collect_pipeline_tracked_files_test_gc_not_collect_pipeline_tracked_files.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": 335, "end_line": 350, "span_ids": ["test_gc_not_collect_pipeline_tracked_files"], "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_gc_not_collect_pipeline_tracked_files(tmp_dir, dvc, run_copy):\n from dvc.dvcfile import PIPELINE_FILE, Dvcfile\n\n tmp_dir.gen(\"foo\", \"foo\")\n tmp_dir.gen(\"bar\", \"bar\")\n\n run_copy(\"foo\", \"foo2\", name=\"copy\")\n shutil.rmtree(dvc.stage_cache.cache_dir)\n assert _count_files(dvc.cache.local.cache_dir) == 1\n dvc.gc(workspace=True, force=True)\n assert _count_files(dvc.cache.local.cache_dir) == 1\n\n # remove pipeline file and lockfile and check\n Dvcfile(dvc, PIPELINE_FILE).remove(force=True)\n dvc.gc(workspace=True, force=True)\n assert _count_files(dvc.cache.local.cache_dir) == 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_external_output_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_test_gc_external_output_", "embedding": null, "metadata": {"file_path": "tests/func/test_gc.py", "file_name": "test_gc.py", "file_type": "text/x-python", "category": "test", "start_line": 353, "end_line": 393, "span_ids": ["test_gc_external_output"], "tokens": 302}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 \"workspace\",\n [\n pytest.lazy_fixture(\"local_cloud\"),\n pytest.lazy_fixture(\"s3\"),\n pytest.lazy_fixture(\"gs\"),\n pytest.lazy_fixture(\"hdfs\"),\n pytest.param(\n pytest.lazy_fixture(\"ssh\"),\n marks=pytest.mark.skipif(\n os.name == \"nt\", reason=\"disabled on windows\"\n ),\n ),\n ],\n indirect=True,\n)\ndef test_gc_external_output(tmp_dir, dvc, workspace):\n workspace.gen({\"foo\": \"foo\", \"bar\": \"bar\"})\n\n (foo_stage,) = dvc.add(\"remote://workspace/foo\")\n (bar_stage,) = dvc.add(\"remote://workspace/bar\")\n\n foo_hash = foo_stage.outs[0].checksum\n bar_hash = bar_stage.outs[0].checksum\n\n assert (\n workspace / \"cache\" / foo_hash[:2] / foo_hash[2:]\n ).read_text() == \"foo\"\n assert (\n workspace / \"cache\" / bar_hash[:2] / bar_hash[2:]\n ).read_text() == \"bar\"\n\n (tmp_dir / \"foo.dvc\").unlink()\n\n dvc.gc(workspace=True)\n\n assert not (workspace / \"cache\" / foo_hash[:2] / foo_hash[2:]).exists()\n assert (\n workspace / \"cache\" / bar_hash[:2] / bar_hash[2:]\n ).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_get.py_logging_test_get_git_file.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_logging_test_get_git_file.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": 1, "end_line": 45, "span_ids": ["test_get_repo_file", "imports", "test_get_git_file", "test_get_repo_dir"], "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": "import logging\nimport os\n\nimport pytest\n\nfrom dvc.cache import Cache\nfrom dvc.exceptions import PathMissingError\nfrom dvc.main import main\nfrom dvc.repo import Repo\nfrom dvc.repo.get import GetDVCFileError\nfrom dvc.system import System\nfrom dvc.utils.fs import makedirs\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(os.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(os.fspath(erepo_dir), \"dir\", \"dir_imported\")\n\n assert (tmp_dir / \"dir_imported\").read_text() == {\"file\": \"contents\"}\n\n\n@pytest.mark.parametrize(\n \"erepo\", [pytest.lazy_fixture(\"git_dir\"), pytest.lazy_fixture(\"erepo_dir\")]\n)\ndef test_get_git_file(tmp_dir, erepo):\n src = \"some_file\"\n dst = \"some_file_imported\"\n\n erepo.scm_gen({src: \"hello\"}, commit=\"add a regular file\")\n\n Repo.get(os.fspath(erepo), src, dst)\n\n assert (tmp_dir / dst).read_text() == \"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_test_get_git_dir_test_get_git_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_get.py_test_get_git_dir_test_get_git_dir.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": 48, "end_line": 61, "span_ids": ["test_get_git_dir"], "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(\n \"erepo\", [pytest.lazy_fixture(\"git_dir\"), pytest.lazy_fixture(\"erepo_dir\")]\n)\ndef test_get_git_dir(tmp_dir, erepo):\n src = \"some_directory\"\n dst = \"some_directory_imported\"\n\n erepo.scm_gen(\n {src: {\"dir\": {\"file.txt\": \"hello\"}}}, commit=\"add a regular dir\"\n )\n\n Repo.get(os.fspath(erepo), src, dst)\n\n assert (tmp_dir / dst).read_text() == {\"dir\": {\"file.txt\": \"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_import.py_test_pull_imported_directory_stage_test_pull_imported_directory_stage.assert_tmp_dir_dir_im": {"__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.assert_tmp_dir_dir_im", "embedding": null, "metadata": {"file_path": "tests/func/test_import.py", "file_name": "test_import.py", "file_type": "text/x-python", "category": "test", "start_line": 211, "end_line": 222, "span_ids": ["test_pull_imported_directory_stage"], "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": "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(os.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 (tmp_dir / \"dir_imported\").read_text() == {\"foo\": \"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_url.py_test_import_url_nonexistent_test_import_url_with_no_exec.assert_not_dst_exists_": {"__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_nonexistent_test_import_url_with_no_exec.assert_not_dst_exists_", "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": 103, "end_line": 114, "span_ids": ["test_import_url_with_no_exec", "test_import_url_nonexistent"], "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_import_url_nonexistent(dvc, erepo_dir):\n with pytest.raises(DependencyDoesNotExistError):\n dvc.imp_url(os.fspath(erepo_dir / \"non-existent\"))\n\n\ndef test_import_url_with_no_exec(tmp_dir, dvc, erepo_dir):\n tmp_dir.gen({\"data_dir\": {\"file\": \"file content\"}})\n src = os.path.join(\"data_dir\", \"file\")\n\n dvc.imp_url(src, \".\", no_exec=True)\n dst = tmp_dir / \"file\"\n assert not dst.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_url.py_test_import_url_test_import_url.assert_dvc_status_": {"__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_test_import_url.assert_dvc_status_", "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": 117, "end_line": 140, "span_ids": ["test_import_url"], "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": "@pytest.mark.parametrize(\n \"workspace\",\n [\n pytest.lazy_fixture(\"local_cloud\"),\n pytest.lazy_fixture(\"s3\"),\n pytest.lazy_fixture(\"gs\"),\n pytest.lazy_fixture(\"hdfs\"),\n pytest.param(\n pytest.lazy_fixture(\"ssh\"),\n marks=pytest.mark.skipif(\n os.name == \"nt\", reason=\"disabled on windows\"\n ),\n ),\n pytest.lazy_fixture(\"http\"),\n ],\n indirect=True,\n)\ndef test_import_url(tmp_dir, dvc, workspace):\n workspace.gen(\"file\", \"file\")\n assert not (tmp_dir / \"file\").exists() # sanity check\n dvc.imp_url(\"remote://workspace/file\")\n assert (tmp_dir / \"file\").read_text() == \"file\"\n\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_import_url.py_test_import_url_dir_": {"__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_dir_", "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": 143, "end_line": 168, "span_ids": ["test_import_url_dir"], "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": "@pytest.mark.parametrize(\n \"workspace\",\n [\n pytest.lazy_fixture(\"local_cloud\"),\n pytest.lazy_fixture(\"s3\"),\n pytest.lazy_fixture(\"gs\"),\n pytest.param(\n pytest.lazy_fixture(\"ssh\"),\n marks=pytest.mark.skipif(\n os.name == \"nt\", reason=\"disabled on windows\"\n ),\n ),\n ],\n indirect=True,\n)\ndef test_import_url_dir(tmp_dir, dvc, workspace):\n workspace.gen({\"dir\": {\"file\": \"file\", \"subdir\": {\"subfile\": \"subfile\"}}})\n assert not (tmp_dir / \"dir\").exists() # sanity check\n dvc.imp_url(\"remote://workspace/dir\")\n assert set(os.listdir(tmp_dir / \"dir\")) == {\"file\", \"subdir\"}\n assert (tmp_dir / \"dir\" / \"file\").read_text() == \"file\"\n assert list(os.listdir(tmp_dir / \"dir\" / \"subdir\")) == [\"subfile\"]\n assert (tmp_dir / \"dir\" / \"subdir\" / \"subfile\").read_text() == \"subfile\"\n\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_run_multistage.py_test_run_overwrite_preserves_meta_and_comment_test_run_overwrite_preserves_meta_and_comment.assert_tmp_dir_PIPELIN": {"__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_overwrite_preserves_meta_and_comment_test_run_overwrite_preserves_meta_and_comment.assert_tmp_dir_PIPELIN", "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": 337, "end_line": 363, "span_ids": ["test_run_overwrite_preserves_meta_and_comment"], "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": "def test_run_overwrite_preserves_meta_and_comment(tmp_dir, dvc, run_copy):\n from dvc.dvcfile import PIPELINE_FILE\n\n tmp_dir.gen({\"foo\": \"foo\", \"foo1\": \"foo1\"})\n text = textwrap.dedent(\n \"\"\"\\\n stages:\n copy-foo-bar:\n cmd: python copy.py {src} {dest}\n deps:\n - copy.py\n - {src}\n outs:\n # comments are preserved\n - {dest}\n meta:\n name: meta is preserved too\n \"\"\"\n )\n (tmp_dir / PIPELINE_FILE).write_text(text.format(src=\"foo\", dest=\"bar\"))\n assert dvc.reproduce(PIPELINE_FILE)\n\n assert run_copy(\"foo1\", \"bar1\", name=\"copy-foo-bar\", force=True)\n\n assert (tmp_dir / PIPELINE_FILE).read_text() == text.format(\n src=\"foo1\", dest=\"bar1\"\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_run_external_outputs_": {"__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_external_outputs_", "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": 366, "end_line": 450, "span_ids": ["test_run_external_outputs"], "tokens": 753}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 \"workspace, hash_name, foo_hash, bar_hash\",\n [\n (\n pytest.lazy_fixture(\"local_cloud\"),\n \"md5\",\n \"acbd18db4cc2f85cedef654fccc4a4d8\",\n \"37b51d194a7513e45b56f6524f2d51f2\",\n ),\n pytest.param(\n pytest.lazy_fixture(\"ssh\"),\n \"md5\",\n \"acbd18db4cc2f85cedef654fccc4a4d8\",\n \"37b51d194a7513e45b56f6524f2d51f2\",\n marks=pytest.mark.skipif(\n os.name == \"nt\", reason=\"disabled on windows\"\n ),\n ),\n (\n pytest.lazy_fixture(\"s3\"),\n \"etag\",\n \"acbd18db4cc2f85cedef654fccc4a4d8\",\n \"37b51d194a7513e45b56f6524f2d51f2\",\n ),\n (\n pytest.lazy_fixture(\"gs\"),\n \"md5\",\n \"acbd18db4cc2f85cedef654fccc4a4d8\",\n \"37b51d194a7513e45b56f6524f2d51f2\",\n ),\n (\n pytest.lazy_fixture(\"hdfs\"),\n \"checksum\",\n \"0000020000000000000000003dba826b9be9c6a8e2f8310a770555c4\",\n \"00000200000000000000000075433c81259d3c38e364b348af52e84d\",\n ),\n ],\n indirect=[\"workspace\"],\n)\ndef test_run_external_outputs(\n tmp_dir, dvc, workspace, hash_name, foo_hash, bar_hash\n):\n workspace.gen(\"foo\", \"foo\")\n dvc.run(\n name=\"mystage\",\n cmd=\"mycmd\",\n deps=[\"remote://workspace/foo\"],\n outs=[\"remote://workspace/bar\"],\n no_exec=True,\n )\n\n dvc_yaml = (\n \"stages:\\n\"\n \" mystage:\\n\"\n \" cmd: mycmd\\n\"\n \" deps:\\n\"\n \" - remote://workspace/foo\\n\"\n \" outs:\\n\"\n \" - remote://workspace/bar\\n\"\n )\n\n assert (tmp_dir / \"dvc.yaml\").read_text() == dvc_yaml\n assert not (tmp_dir / \"dvc.lock\").exists()\n\n workspace.gen(\"bar\", \"bar\")\n dvc.commit(\"dvc.yaml\", force=True)\n\n assert (tmp_dir / \"dvc.yaml\").read_text() == dvc_yaml\n assert (tmp_dir / \"dvc.lock\").read_text() == (\n \"mystage:\\n\"\n \" cmd: mycmd\\n\"\n \" deps:\\n\"\n \" - path: remote://workspace/foo\\n\"\n f\" {hash_name}: {foo_hash}\\n\"\n \" outs:\\n\"\n \" - path: remote://workspace/bar\\n\"\n f\" {hash_name}: {bar_hash}\\n\"\n )\n\n assert (workspace / \"foo\").read_text() == \"foo\"\n assert (workspace / \"bar\").read_text() == \"bar\"\n assert (\n workspace / \"cache\" / bar_hash[:2] / bar_hash[2:]\n ).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_update.py_os_test_update_import.None_13": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_update.py_os_test_update_import.None_13", "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": 75, "span_ids": ["imports", "test_update_import"], "tokens": 571}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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.dvcfile import Dvcfile\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(\n {\n \"version\": \"branch\",\n \"dir\": {\"version\": \"branch\", \"subdir\": {\"file\": \"file\"}},\n },\n commit=\"add version file\",\n )\n old_rev = erepo_dir.scm.get_rev()\n\n stage = dvc.imp(os.fspath(erepo_dir), \"version\", \"version\", rev=\"branch\")\n dir_stage = dvc.imp(os.fspath(erepo_dir), \"dir\", \"dir\", rev=\"branch\")\n assert dvc.status() == {}\n\n assert (tmp_dir / \"version\").read_text() == \"branch\"\n assert (tmp_dir / \"dir\").read_text() == {\n \"version\": \"branch\",\n \"subdir\": {\"file\": \"file\"},\n }\n assert stage.deps[0].def_repo[\"rev_lock\"] == old_rev\n assert dir_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(\n {\n \"version\": \"updated\",\n \"dir\": {\"version\": \"updated\", \"subdir\": {\"file\": \"file\"}},\n },\n commit=\"update version content\",\n )\n new_rev = erepo_dir.scm.get_rev()\n\n assert old_rev != new_rev\n\n assert dvc.status() == {\n \"dir.dvc\": [\n {\n \"changed deps\": {\n f\"dir ({os.fspath(erepo_dir)})\": \"update available\"\n }\n }\n ],\n \"version.dvc\": [\n {\n \"changed deps\": {\n f\"version ({os.fspath(erepo_dir)})\": \"update available\"\n }\n }\n ],\n }\n\n (stage,) = dvc.update(stage.path)\n (dir_stage,) = dvc.update(dir_stage.path)\n assert dvc.status() == {}\n\n assert (tmp_dir / \"version\").read_text() == \"updated\"\n assert (tmp_dir / \"dir\").read_text() == {\n \"version\": \"updated\",\n \"subdir\": {\"file\": \"file\"},\n }\n\n assert stage.deps[0].def_repo[\"rev_lock\"] == new_rev\n assert dir_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/pylint_plugin_disable.py___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/pylint_plugin_disable.py___", "embedding": null, "metadata": {"file_path": "tests/pylint_plugin_disable.py", "file_name": "pylint_plugin_disable.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 48, "span_ids": ["register", "is_node_in_tests", "docstring"], "tokens": 309}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"\nDisable certain checks for the tests.\n\nTo disable new checks, add to the `SUPPRESS_CHECKS` dictionary,\nwith `message_id` of the check to disable as a key and a list of\nmethods that check for that particular message.\n\"\"\"\nimport os.path\nfrom typing import TYPE_CHECKING\n\nfrom pylint.checkers.base import NameChecker\nfrom pylint.checkers.classes import ClassChecker\n\nif TYPE_CHECKING:\n from astroid import node_classes, scoped_nodes # noqa\n from pylint.lint import PyLinter\n\n\nTESTS_FOLDER = os.path.join(os.path.abspath(os.path.dirname(__file__)), \"\")\nSUPPRESS_CHECKS = {\n \"protected-access\": [\n ClassChecker.visit_assign,\n ClassChecker.visit_attribute,\n ],\n \"blacklisted-name\": [\n NameChecker.visit_global,\n NameChecker.visit_assignname,\n ],\n}\n\n\ndef is_node_in_tests(node: \"node_classes.NodeNG\"):\n module: \"scoped_nodes.Module\" = node.root()\n return module.file.startswith(TESTS_FOLDER)\n\n\ndef register(linter: \"PyLinter\"): # noqa\n try:\n from pylint_plugin_utils import suppress_message\n except ImportError:\n print(\"Cannot suppress message. 'pylint_plugin_utils' not installed.\")\n return\n\n print(\"Registered custom plugin. Some checks will be disabled for tests.\")\n for msg, checks in SUPPRESS_CHECKS.items():\n for checker_method in checks:\n suppress_message(linter, checker_method, msg, is_node_in_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/remotes/base.py_pathlib_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/base.py_pathlib_", "embedding": null, "metadata": {"file_path": "tests/remotes/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 70, "span_ids": ["Base.gen", "Base.write_text", "Base.config", "Base.exists", "imports", "Base", "Base.read_text", "Base.read_bytes", "Base.get_url", "Base.is_dir", "Base._gen", "Base.close", "Base.mkdir", "Base.is_file", "Base.write_bytes", "Base.should_test"], "tokens": 328}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\n\nfrom funcy import cached_property\n\nfrom dvc.path_info import URLInfo\n\n\nclass Base(URLInfo):\n def is_file(self):\n raise NotImplementedError\n\n def is_dir(self):\n raise NotImplementedError\n\n def exists(self):\n raise NotImplementedError\n\n def mkdir(self, mode=0o777, parents=False, exist_ok=False):\n raise NotImplementedError\n\n def write_text(self, contents, encoding=None, errors=None):\n raise NotImplementedError\n\n def write_bytes(self, contents):\n raise NotImplementedError\n\n def read_text(self, encoding=None, errors=None):\n raise NotImplementedError\n\n def read_bytes(self):\n raise NotImplementedError\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 path.mkdir(parents=True)\n else:\n self._gen(contents, prefix=path)\n else:\n path.parent.mkdir(parents=True)\n if isinstance(contents, bytes):\n path.write_bytes(contents)\n else:\n path.write_text(contents, encoding=\"utf-8\")\n\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 close(self):\n pass\n\n @staticmethod\n def should_test():\n return True\n\n @staticmethod\n def get_url():\n raise NotImplementedError\n\n @cached_property\n def config(self):\n return {\"url\": 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/tests/remotes/gdrive.py__pylint_disable_abstract_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/gdrive.py__pylint_disable_abstract_", "embedding": null, "metadata": {"file_path": "tests/remotes/gdrive.py", "file_name": "gdrive.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 52, "span_ids": ["gdrive", "GDrive", "docstring", "GDrive.should_test", "GDrive._get_storagepath", "GDrive.get_url", "GDrive.config"], "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": "# pylint:disable=abstract-method\nimport os\nimport uuid\n\nimport pytest\nfrom funcy import cached_property\n\nfrom dvc.path_info import CloudURLInfo\nfrom dvc.remote.gdrive import GDriveRemoteTree\n\nfrom .base import Base\n\nTEST_GDRIVE_REPO_BUCKET = \"root\"\n\n\nclass GDrive(Base, CloudURLInfo):\n @staticmethod\n def should_test():\n return os.getenv(GDriveRemoteTree.GDRIVE_CREDENTIALS_DATA) is not None\n\n @cached_property\n def config(self):\n return {\n \"url\": self.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 @staticmethod\n def _get_storagepath():\n return TEST_GDRIVE_REPO_BUCKET + \"/\" + str(uuid.uuid4())\n\n @staticmethod\n def get_url():\n # NOTE: `get_url` should always return new random url\n return \"gdrive://\" + GDrive._get_storagepath()\n\n\n@pytest.fixture\ndef gdrive(make_tmp_dir):\n if not GDrive.should_test():\n pytest.skip(\"no gdrive\")\n\n # NOTE: temporary workaround\n tmp_dir = make_tmp_dir(\"gdrive\", dvc=True)\n\n ret = GDrive(GDrive.get_url())\n tree = GDriveRemoteTree(tmp_dir.dvc, ret.config)\n tree._gdrive_create_dir(\"root\", tree.path_info.path)\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/tests/remotes/gs.py_locale_os_environ_GOOGLE_APPLIC": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/gs.py_locale_os_environ_GOOGLE_APPLIC", "embedding": null, "metadata": {"file_path": "tests/remotes/gs.py", "file_name": "gs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 22, "span_ids": ["imports"], "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 locale\nimport os\nimport uuid\n\nimport pytest\nfrom funcy import cached_property\n\nfrom dvc.path_info import CloudURLInfo\nfrom dvc.utils import env2bool\n\nfrom .base import Base\n\nTEST_GCP_REPO_BUCKET = os.environ.get(\"DVC_TEST_GCP_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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/http.py__pylint_disable_abstract_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/http.py__pylint_disable_abstract_", "embedding": null, "metadata": {"file_path": "tests/remotes/http.py", "file_name": "http.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 49, "span_ids": ["HTTP.write_text", "HTTP.get_url", "http", "http_server", "HTTP", "HTTP.write_bytes", "HTTP.mkdir", "docstring"], "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": "# pylint:disable=abstract-method\nimport locale\nimport os\nimport uuid\n\nimport pytest\nimport requests\n\nfrom dvc.path_info import HTTPURLInfo\n\nfrom .base import Base\n\n\nclass HTTP(Base, HTTPURLInfo):\n @staticmethod\n def get_url(port): # pylint: disable=arguments-differ\n dname = str(uuid.uuid4())\n return f\"http://127.0.0.1:{port}/{dname}\"\n\n def mkdir(self, mode=0o777, parents=False, exist_ok=False):\n assert mode == 0o777\n assert parents\n assert not exist_ok\n\n def write_bytes(self, contents):\n assert isinstance(contents, bytes)\n response = requests.post(self.url, data=contents)\n assert response.status_code == 200\n\n def write_text(self, contents, encoding=None, errors=None):\n if not encoding:\n encoding = locale.getpreferredencoding(False)\n assert errors is None\n self.write_bytes(contents.encode(encoding))\n\n\n@pytest.fixture(scope=\"session\")\ndef http_server(tmp_path_factory):\n from tests.utils.httpd import StaticFileServer\n\n directory = os.fspath(tmp_path_factory.mktemp(\"http\"))\n with StaticFileServer(directory=directory) as httpd:\n yield httpd\n\n\n@pytest.fixture\ndef http(http_server):\n yield HTTP(HTTP.get_url(http_server.server_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/remotes/local.py__pylint_disable_cyclic__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/local.py__pylint_disable_cyclic__", "embedding": null, "metadata": {"file_path": "tests/remotes/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 31, "span_ids": ["Local", "local_cloud", "local_remote", "Local.get_url", "Local.get_storagepath", "docstring"], "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": "# pylint: disable=cyclic-import,disable=abstract-method\nimport pytest\n\nfrom tests.basic_env import TestDvc\n\nfrom .base import Base\n\n\nclass Local(Base):\n @staticmethod\n def get_storagepath():\n return TestDvc.mkdtemp()\n\n @staticmethod\n def get_url():\n return Local.get_storagepath()\n\n\n@pytest.fixture\ndef local_cloud(make_tmp_dir):\n ret = make_tmp_dir(\"local-cloud\")\n ret.url = str(ret)\n ret.config = {\"url\": ret.url}\n return ret\n\n\n@pytest.fixture\ndef local_remote(tmp_dir, dvc, local_cloud):\n tmp_dir.add_remote(config=local_cloud.config)\n yield local_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/remotes/oss.py__pylint_disable_abstract_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/oss.py__pylint_disable_abstract_", "embedding": null, "metadata": {"file_path": "tests/remotes/oss.py", "file_name": "oss.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 42, "span_ids": ["OSS", "OSS.should_test", "oss", "docstring", "OSS.get_url", "OSS._get_storagepath"], "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": "# pylint:disable=abstract-method\nimport os\nimport uuid\n\nimport pytest\n\nfrom dvc.path_info import CloudURLInfo\nfrom dvc.utils import env2bool\n\nfrom .base import Base\n\nTEST_OSS_REPO_BUCKET = \"dvc-test\"\n\n\nclass OSS(Base, CloudURLInfo):\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 f\"{TEST_OSS_REPO_BUCKET}/{uuid.uuid4()}\"\n\n @staticmethod\n def get_url():\n return f\"oss://{OSS._get_storagepath()}\"\n\n\n@pytest.fixture\ndef oss():\n if not OSS.should_test():\n pytest.skip(\"no oss running\")\n yield OSS(OSS.get_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/s3.py_locale_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/s3.py_locale_", "embedding": null, "metadata": {"file_path": "tests/remotes/s3.py", "file_name": "s3.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 110, "span_ids": ["S3.is_file", "real_s3", "S3._s3", "imports", "S3._get_storagepath", "S3.is_dir", "S3.write_text", "S3.read_text", "S3.read_bytes", "S3.should_test", "S3.exists", "S3.mkdir", "S3", "S3.write_bytes", "S3.get_url", "s3"], "tokens": 624}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 locale\nimport os\nimport uuid\n\nimport pytest\nfrom funcy import cached_property\nfrom moto import mock_s3\n\nfrom dvc.path_info import CloudURLInfo\nfrom dvc.utils import env2bool\n\nfrom .base import Base\n\nTEST_AWS_REPO_BUCKET = os.environ.get(\"DVC_TEST_AWS_REPO_BUCKET\", \"dvc-temp\")\n\n\nclass S3(Base, CloudURLInfo):\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()\n\n @cached_property\n def _s3(self):\n import boto3\n\n return boto3.client(\"s3\")\n\n def is_file(self):\n from botocore.exceptions import ClientError\n\n if self.path.endswith(\"/\"):\n return False\n\n try:\n self._s3.head_object(Bucket=self.bucket, Key=self.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 is_dir(self):\n path = (self / \"\").path\n resp = self._s3.list_objects(Bucket=self.bucket, Prefix=path)\n return bool(resp.get(\"Contents\"))\n\n def exists(self):\n return self.is_file() or self.is_dir()\n\n def mkdir(self, mode=0o777, parents=False, exist_ok=False):\n assert mode == 0o777\n assert parents\n assert not exist_ok\n\n def write_bytes(self, contents):\n self._s3.put_object(\n Bucket=self.bucket, Key=self.path, Body=contents,\n )\n\n def write_text(self, contents, encoding=None, errors=None):\n if not encoding:\n encoding = locale.getpreferredencoding(False)\n assert errors is None\n self.write_bytes(contents.encode(encoding))\n\n def read_bytes(self):\n data = self._s3.get_object(Bucket=self.bucket, Key=self.path)\n return data[\"Body\"].read()\n\n def read_text(self, encoding=None, errors=None):\n if not encoding:\n encoding = locale.getpreferredencoding(False)\n assert errors is None\n return self.read_bytes().decode(encoding)\n\n\n@pytest.fixture\ndef s3():\n with mock_s3():\n import boto3\n\n boto3.client(\"s3\").create_bucket(Bucket=TEST_AWS_REPO_BUCKET)\n\n yield S3(S3.get_url())\n\n\n@pytest.fixture\ndef real_s3():\n if not S3.should_test():\n pytest.skip(\"no real s3\")\n yield S3(S3.get_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/ssh.py_SSHMocked.config_SSHMocked.read_text.return.self_read_bytes_decode_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/ssh.py_SSHMocked.config_SSHMocked.read_text.return.self_read_bytes_decode_", "embedding": null, "metadata": {"file_path": "tests/remotes/ssh.py", "file_name": "ssh.py", "file_type": "text/x-python", "category": "implementation", "start_line": 69, "end_line": 134, "span_ids": ["SSHMocked.write_bytes", "SSHMocked.exists", "SSHMocked.mkdir", "SSHMocked.is_file", "SSHMocked._ssh", "SSHMocked.config", "SSHMocked.is_dir", "SSHMocked.write_text", "SSHMocked.read_text", "SSHMocked.read_bytes"], "tokens": 428}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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(Base, URLInfo):\n\n @cached_property\n def config(self):\n return {\n \"url\": self.url,\n \"keyfile\": TEST_SSH_KEY_PATH,\n }\n\n @contextmanager\n def _ssh(self):\n from dvc.remote.ssh.connection import SSHConnection\n\n conn = SSHConnection(\n host=self.host,\n port=self.port,\n username=TEST_SSH_USER,\n key_filename=TEST_SSH_KEY_PATH,\n )\n try:\n yield conn\n finally:\n conn.close()\n\n def is_file(self):\n with self._ssh() as _ssh:\n return _ssh.isfile(self.path)\n\n def is_dir(self):\n with self._ssh() as _ssh:\n return _ssh.isdir(self.path)\n\n def exists(self):\n with self._ssh() as _ssh:\n return _ssh.exists(self.path)\n\n def mkdir(self, mode=0o777, parents=False, exist_ok=False):\n assert mode == 0o777\n assert parents\n assert not exist_ok\n\n with self._ssh() as _ssh:\n _ssh.makedirs(self.path)\n\n def write_bytes(self, contents):\n assert isinstance(contents, bytes)\n with self._ssh() as _ssh:\n with _ssh.open(self.path, \"w+\") as fobj:\n # NOTE: accepts both str and bytes\n fobj.write(contents)\n\n def write_text(self, contents, encoding=None, errors=None):\n if not encoding:\n encoding = locale.getpreferredencoding(False)\n assert errors is None\n self.write_bytes(contents.encode(encoding))\n\n def read_bytes(self):\n with self._ssh() as _ssh:\n # NOTE: sftp always reads in binary format\n with _ssh.open(self.path, \"r\") as fobj:\n return fobj.read()\n\n def read_text(self, encoding=None, errors=None):\n if not encoding:\n encoding = locale.getpreferredencoding(False)\n assert errors is None\n return self.read_bytes().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/tests/unit/remote/test_remote_tree.py_os_remote.return.get_remote_dvc_cloud_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_tree.py_os_remote.return.get_remote_dvc_cloud_c", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_remote_tree.py", "file_name": "test_remote_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 32, "span_ids": ["imports", "remote"], "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 os\n\nimport pytest\n\nfrom dvc.path_info import PathInfo\nfrom dvc.remote import get_remote\nfrom dvc.remote.s3 import S3RemoteTree\nfrom dvc.utils.fs import walk_files\n\nremotes = [pytest.lazy_fixture(fix) for fix in [\"gs\", \"s3\"]]\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 cloud = request.param\n cloud.gen(FILE_WITH_CONTENTS)\n return get_remote(dvc, **cloud.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/utils/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/utils/__init__.py__", "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": 24, "span_ids": ["imports", "get_gitignore_content", "to_posixpath", "cd"], "tokens": 102}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\n\nfrom dvc.scm import Git\n\n\ndef get_gitignore_content():\n with open(Git.GITIGNORE) 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 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/tests/utils/httpd.py_hashlib_TestRequestHandler.translate_path.return.path": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/utils/httpd.py_hashlib_TestRequestHandler.translate_path.return.path", "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": 45, "span_ids": ["imports", "TestRequestHandler.translate_path", "TestRequestHandler.__init__", "TestRequestHandler"], "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 hashlib\nimport os\nimport sys\nimport threading\nfrom http import HTTPStatus\nfrom http.server import HTTPServer\n\nfrom RangeHTTPServer import RangeRequestHandler\n\n\nclass TestRequestHandler(RangeRequestHandler):\n def __init__(self, *args, **kwargs):\n # NOTE: `directory` was introduced in 3.7\n if sys.version_info < (3, 7):\n self.directory = kwargs.pop(\"directory\", None) or os.getcwd()\n super().__init__(*args, **kwargs)\n\n def translate_path(self, path):\n import urllib\n import posixpath\n\n # NOTE: `directory` was introduced in 3.7\n if sys.version_info < (3, 7):\n return super().translate_path(path)\n\n path = path.split(\"?\", 1)[0]\n path = path.split(\"#\", 1)[0]\n # Don't forget explicit trailing slash when normalizing. Issue17324\n trailing_slash = path.rstrip().endswith(\"/\")\n try:\n path = urllib.parse.unquote(path, errors=\"surrogatepass\")\n except UnicodeDecodeError:\n path = urllib.parse.unquote(path)\n path = posixpath.normpath(path)\n words = path.split(\"/\")\n words = filter(None, words)\n path = self.directory\n for word in words:\n if os.path.dirname(word) or word in (os.curdir, os.pardir):\n # Ignore components that are not a simple file/directory name\n continue\n path = os.path.join(path, word)\n if trailing_slash:\n path += \"/\"\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/utils/httpd.py_TestRequestHandler.end_headers_TestRequestHandler.end_headers.RangeRequestHandler_end_h": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/utils/httpd.py_TestRequestHandler.end_headers_TestRequestHandler.end_headers.RangeRequestHandler_end_h", "embedding": null, "metadata": {"file_path": "tests/utils/httpd.py", "file_name": "httpd.py", "file_type": "text/x-python", "category": "implementation", "start_line": 47, "end_line": 62, "span_ids": ["TestRequestHandler.end_headers"], "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 TestRequestHandler(RangeRequestHandler):\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 file = self.translate_path(self.path)\n\n if not os.path.isdir(file) and os.path.exists(file):\n with open(file) as fd:\n encoded_text = fd.read().encode(\"utf8\")\n checksum = hashlib.md5(encoded_text).hexdigest()\n self.send_header(\"Content-MD5\", checksum)\n\n RangeRequestHandler.end_headers(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/utils/httpd.py_TestRequestHandler._chunks_TestRequestHandler.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_TestRequestHandler._chunks_TestRequestHandler.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": 64, "end_line": 89, "span_ids": ["TestRequestHandler.do_POST", "TestRequestHandler._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 TestRequestHandler(RangeRequestHandler):\n\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/api.py_os_get_url.with__make_repo_repo_rev.return.str_remote_obj_hash_to_pa": {"__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_hash_to_pa", "embedding": null, "metadata": {"file_path": "dvc/api.py", "file_name": "api.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 33, "span_ids": ["imports", "UrlNotDvcRepoError", "get_url", "UrlNotDvcRepoError.__init__"], "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\nfrom contextlib import _GeneratorContextManager as GCM\nfrom contextlib import contextmanager\n\nfrom dvc.exceptions import DvcException, NotDvcRepoError\nfrom dvc.external_repo import external_repo\nfrom dvc.repo import 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__(f\"'{url}' is not a DVC repository.\")\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) # pylint: disable=no-member\n out = _repo.find_out_by_relpath(path)\n remote_obj = _repo.cloud.get_remote(remote)\n return str(remote_obj.hash_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/cli.py__DVC_command_line_inter_COMMANDS._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cli.py__DVC_command_line_inter_COMMANDS._", "embedding": null, "metadata": {"file_path": "dvc/cli.py", "file_name": "cli.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 80, "span_ids": ["docstring"], "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": "\"\"\"DVC command line interface\"\"\"\nimport argparse\nimport logging\nimport sys\n\nfrom .command import (\n add,\n cache,\n checkout,\n commit,\n completion,\n config,\n daemon,\n dag,\n data_sync,\n destroy,\n diff,\n freeze,\n gc,\n get,\n get_url,\n git_hook,\n imp,\n imp_url,\n init,\n install,\n ls,\n metrics,\n move,\n params,\n plots,\n remote,\n remove,\n repro,\n root,\n run,\n unprotect,\n update,\n version,\n)\nfrom .command.base import fix_subparsers\nfrom .exceptions import DvcParserError\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 freeze,\n dag,\n daemon,\n commit,\n completion,\n diff,\n version,\n update,\n git_hook,\n plots,\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_Config_Config._load_paths.return.Config__map_dirs_conf_re": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config_Config._load_paths.return.Config__map_dirs_conf_re", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 211, "end_line": 326, "span_ids": ["Config.load", "Config.load_one", "Config", "Config.init", "Config.__init__", "Config._load_paths", "Config.get_dir", "Config.files"], "tokens": 773}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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__(\n self, dvc_dir=None, validate=True\n ): # pylint: disable=super-init-not-called\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 # Auto-verify 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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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._to_relpath_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._to_relpath_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": 328, "end_line": 386, "span_ids": ["Config._save_paths", "Config.validate", "Config.edit", "Config.load_config_to_level", "Config._to_relpath", "Config._map_dirs"], "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 Config(dict):\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()\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 = {\n \"cache\": {\"dir\": func},\n \"remote\": {\n str: {\"url\": func, \"gdrive_user_credentials_file\": func}\n },\n }\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/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": 389, "end_line": 442, "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(f\"Writing '{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[f'remote \"{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/dvcfile.py_PipelineFile.stage_PipelineFile.remove_stage.dump_yaml_self_path_d_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dvcfile.py_PipelineFile.stage_PipelineFile.remove_stage.dump_yaml_self_path_d_", "embedding": null, "metadata": {"file_path": "dvc/dvcfile.py", "file_name": "dvcfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 202, "end_line": 236, "span_ids": ["PipelineFile.stages", "PipelineFile.stage", "PipelineFile.remove", "PipelineFile.remove_stage"], "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 PipelineFile(FileMixin):\n\n @property\n def stage(self):\n raise DvcException(\n \"PipelineFile has multiple stages. Please specify it's name.\"\n )\n\n @property\n def stages(self):\n data, _ = self._load()\n lockfile_data = self._lockfile.load()\n return StageLoader(self, data.get(\"stages\", {}), lockfile_data)\n\n def remove(self, force=False):\n if not force:\n logger.warning(\"Cannot remove pipeline file.\")\n return\n\n super().remove()\n self._lockfile.remove()\n\n def remove_stage(self, stage):\n self._lockfile.remove_stage(stage)\n if not self.exists():\n return\n\n with open(self.path, \"r\") as f:\n d = parse_yaml_for_update(f.read(), self.path)\n\n self.validate(d, self.path)\n if stage.name not in d.get(\"stages\", {}):\n return\n\n logger.debug(\"Removing '%s' from '%s'\", stage.name, self.path)\n del d[\"stages\"][stage.name]\n dump_yaml(self.path, 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/ignore.py_DvcIgnorePatterns.matches_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_DvcIgnorePatterns.matches_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": 51, "end_line": 82, "span_ids": ["DvcIgnorePatterns.matches", "DvcIgnorePatterns.__hash__", "DvcIgnorePatterns.__eq__", "DvcIgnorePatterns.ignore"], "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 DvcIgnorePatterns(DvcIgnore):\n\n def matches(self, dirname, basename):\n # NOTE: `relpath` is too slow, so we have to assume that both\n # `dirname` and `self.dirname` are relative or absolute together.\n prefix = self.dirname + os.sep\n if dirname == self.dirname:\n path = basename\n elif dirname.startswith(prefix):\n rel = dirname[len(prefix) :]\n # NOTE: `os.path.join` is ~x5.5 slower\n path = f\"{rel}{os.sep}{basename}\"\n else:\n return False\n\n if not System.is_unix():\n path = normalize_file(path)\n return self.ignore(path)\n\n def ignore(self, path):\n result = False\n for ignore, pattern in self.ignore_spec:\n if pattern.match(path):\n result = ignore\n return result\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": 85, "end_line": 113, "span_ids": ["DvcIgnoreDirs.__init__", "DvcIgnoreRepo", "DvcIgnoreDirs.__hash__", "DvcIgnoreDirs.__call__", "DvcIgnoreRepo.__call__", "DvcIgnoreDirs.__eq__", "DvcIgnoreDirs"], "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": "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(root, 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": 116, "end_line": 137, "span_ids": ["DvcIgnoreFilter.__call__", "DvcIgnoreFilter", "DvcIgnoreFilter._update", "DvcIgnoreFilter.__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": "class DvcIgnoreFilter:\n def __init__(self, tree, root_dir):\n self.tree = tree\n self.root_dir = root_dir\n self.ignores = {\n DvcIgnoreDirs([\".git\", \".hg\", \".dvc\"]),\n DvcIgnoreRepo(),\n }\n for root, dirs, files in self.tree.walk(self.root_dir):\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_CleanTree.isexec.return.self_exists_path_and_sel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_CleanTree_CleanTree.isexec.return.self_exists_path_and_sel", "embedding": null, "metadata": {"file_path": "dvc/ignore.py", "file_name": "ignore.py", "file_type": "text/x-python", "category": "implementation", "start_line": 140, "end_line": 200, "span_ids": ["CleanTree.exists", "CleanTree", "CleanTree._valid_filename", "CleanTree.isfile", "CleanTree.tree_root", "CleanTree.dvcignore", "CleanTree._valid_dirname", "CleanTree.isexec", "CleanTree.open", "CleanTree.isdir", "CleanTree.__init__"], "tokens": 393}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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, tree_root=None):\n self.tree = tree\n if tree_root:\n self._tree_root = tree_root\n else:\n self._tree_root = self.tree.tree_root\n\n @cached_property\n def dvcignore(self):\n return DvcIgnoreFilter(self.tree, self.tree_root)\n\n @property\n def tree_root(self):\n return self._tree_root\n\n def open(self, path, mode=\"r\", encoding=\"utf-8\"):\n if self.isfile(path):\n return self.tree.open(path, mode, encoding)\n raise FileNotFoundError\n\n def exists(self, path):\n if self.tree.exists(path) and self._parents_exist(path):\n if self.tree.isdir(path):\n return self._valid_dirname(path)\n return self._valid_filename(path)\n return False\n\n def isdir(self, path):\n return (\n self.tree.isdir(path)\n and self._parents_exist(path)\n and self._valid_dirname(path)\n )\n\n def _valid_dirname(self, path):\n path = os.path.abspath(path)\n if path == self.tree_root:\n return True\n dirname, basename = os.path.split(path)\n dirs, _ = self.dvcignore(dirname, [basename], [])\n if dirs:\n return True\n return False\n\n def isfile(self, path):\n return (\n self.tree.isfile(path)\n and self._parents_exist(path)\n and self._valid_filename(path)\n )\n\n def _valid_filename(self, path):\n dirname, basename = os.path.split(os.path.normpath(path))\n _, files = self.dvcignore(os.path.abspath(dirname), [], [basename])\n if files:\n return True\n return False\n\n def isexec(self, path):\n return self.exists(path) and self.tree.isexec(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_CleanTree._parents_exist_CleanTree._parents_exist.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_CleanTree._parents_exist_CleanTree._parents_exist.return.True", "embedding": null, "metadata": {"file_path": "dvc/ignore.py", "file_name": "ignore.py", "file_type": "text/x-python", "category": "implementation", "start_line": 202, "end_line": 231, "span_ids": ["CleanTree._parents_exist"], "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 CleanTree(BaseTree):\n\n def _parents_exist(self, path):\n from dvc.repo import Repo\n\n path = PathInfo(path)\n\n # if parent is tree_root or inside a .dvc dir we can skip this check\n if path.parent == self.tree_root or Repo.DVC_DIR in path.parts:\n return True\n\n # paths outside of the CleanTree root should be ignored\n path = relpath(path, self.tree_root)\n if path.startswith(\"..\") or (\n os.name == \"nt\"\n and not os.path.commonprefix(\n [os.path.abspath(path), self.tree_root]\n )\n ):\n return False\n\n # check if parent directories are in our ignores, starting from\n # tree_root\n for parent_dir in reversed(PathInfo(path).parents):\n dirname, basename = os.path.split(parent_dir)\n if basename == \".\":\n # parent_dir == tree_root\n continue\n dirs, _ = self.dvcignore(os.path.abspath(dirname), [basename], [])\n if not dirs:\n return False\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/ignore.py_CleanTree.walk_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_CleanTree.walk_", "embedding": null, "metadata": {"file_path": "dvc/ignore.py", "file_name": "ignore.py", "file_type": "text/x-python", "category": "implementation", "start_line": 233, "end_line": 251, "span_ids": ["CleanTree.walk", "CleanTree.stat", "CleanTree.hash_jobs"], "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 CleanTree(BaseTree):\n\n def walk(self, top, topdown=True, onerror=None):\n for root, dirs, files in self.tree.walk(\n top, topdown=topdown, onerror=onerror\n ):\n dirs[:], files[:] = self.dvcignore(\n os.path.abspath(root), dirs, files\n )\n\n yield root, dirs, files\n\n def stat(self, path):\n if self.exists(path):\n return self.tree.stat(path)\n raise FileNotFoundError\n\n @property\n def hash_jobs(self):\n return self.tree.hash_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/output/base.py_BaseOutput_BaseOutput.checksum_12.self_info_self_remote_tre": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_BaseOutput_BaseOutput.checksum_12.self_info_self_remote_tre", "embedding": null, "metadata": {"file_path": "dvc/output/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 47, "end_line": 178, "span_ids": ["BaseOutput.__init__", "BaseOutput.scheme", "BaseOutput.__repr__", "BaseOutput.cache_path", "BaseOutput._parse_path", "BaseOutput.dir_cache", "BaseOutput.supported", "BaseOutput.is_in_repo", "BaseOutput.checksum_12", "BaseOutput.use_scm_ignore", "BaseOutput", "BaseOutput.checksum_type", "BaseOutput.__str__", "BaseOutput.checksum", "BaseOutput.cache"], "tokens": 857}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseOutput:\n IS_DEPENDENCY = False\n\n REMOTE_CLS = Remote\n TREE_CLS = BaseRemoteTree\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_PLOT = \"plot\"\n PARAM_PLOT_TEMPLATE = \"template\"\n PARAM_PLOT_X = \"x\"\n PARAM_PLOT_Y = \"y\"\n PARAM_PLOT_X_LABEL = \"x_label\"\n PARAM_PLOT_Y_LABEL = \"y_label\"\n PARAM_PLOT_TITLE = \"title\"\n PARAM_PLOT_HEADER = \"header\"\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 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 plot=False,\n persist=False,\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 if remote:\n self.remote = remote\n else:\n tree = self.TREE_CLS(self.repo, {})\n self.remote = self.REMOTE_CLS(tree)\n self.use_cache = False if self.IS_DEPENDENCY else cache\n self.metric = False if self.IS_DEPENDENCY else metric\n self.plot = False if self.IS_DEPENDENCY else plot\n self.persist = persist\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.TREE_CLS.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.TREE_CLS.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.TREE_CLS.supported(url)\n\n @property\n def cache_path(self):\n return self.cache.hash_to_path_info(self.checksum).url\n\n @property\n def checksum_type(self):\n return self.remote.tree.PARAM_CHECKSUM\n\n @property\n def checksum(self):\n return self.info.get(self.remote.tree.PARAM_CHECKSUM)\n\n @checksum.setter\n def checksum(self, checksum):\n self.info[self.remote.tree.PARAM_CHECKSUM] = 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/output/base.py_BaseOutput.get_checksum_BaseOutput._pylint_enable_no_membe": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_BaseOutput.get_checksum_BaseOutput._pylint_enable_no_membe", "embedding": null, "metadata": {"file_path": "dvc/output/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 180, "end_line": 250, "span_ids": ["BaseOutput.is_empty", "BaseOutput.get_checksum", "BaseOutput.isfile", "BaseOutput.isdir", "BaseOutput.changed", "BaseOutput.ignore", "BaseOutput.exists", "BaseOutput.changed_cache", "BaseOutput.status", "BaseOutput.ignore_remove", "BaseOutput.changed_checksum", "BaseOutput.is_dir_checksum", "BaseOutput.save_info"], "tokens": 382}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseOutput:\n\n def get_checksum(self):\n return self.remote.get_hash(self.path_info)\n\n @property\n def is_dir_checksum(self):\n return self.remote.is_dir_hash(self.checksum)\n\n @property\n def exists(self):\n return self.remote.tree.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.get_checksum()\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)\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.tree.is_empty(self.path_info)\n\n def isdir(self):\n return self.remote.tree.isdir(self.path_info)\n\n def isfile(self):\n return self.remote.tree.isfile(self.path_info)\n\n # pylint: disable=no-member\n\n def ignore(self):\n if not self.use_scm_ignore:\n return\n\n if self.repo.scm.is_tracked(self.fspath):\n raise OutputAlreadyTrackedError(self)\n\n self.repo.scm.ignore(self.fspath)\n\n def ignore_remove(self):\n if not self.use_scm_ignore:\n return\n\n self.repo.scm.ignore_remove(self.fspath)\n\n # pylint: enable=no-member", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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__get_conf.return._resolve_remote_refs_repo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/__init__.py_posixpath__get_conf.return._resolve_remote_refs_repo", "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": 43, "span_ids": ["imports", "_get_tree", "_get_conf"], "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": "import posixpath\nfrom urllib.parse import urlparse\n\nfrom dvc.remote.azure import AzureRemoteTree\nfrom dvc.remote.base import Remote\nfrom dvc.remote.gdrive import GDriveRemoteTree\nfrom dvc.remote.gs import GSRemoteTree\nfrom dvc.remote.hdfs import HDFSRemoteTree\nfrom dvc.remote.http import HTTPRemoteTree\nfrom dvc.remote.https import HTTPSRemoteTree\nfrom dvc.remote.local import LocalRemote, LocalRemoteTree\nfrom dvc.remote.oss import OSSRemoteTree\nfrom dvc.remote.s3 import S3RemoteTree\nfrom dvc.remote.ssh import SSHRemote, SSHRemoteTree\n\nTREES = [\n AzureRemoteTree,\n GDriveRemoteTree,\n GSRemoteTree,\n HDFSRemoteTree,\n HTTPRemoteTree,\n HTTPSRemoteTree,\n S3RemoteTree,\n SSHRemoteTree,\n OSSRemoteTree,\n # NOTE: LocalRemoteTree is the default\n]\n\n\ndef _get_tree(remote_conf):\n for tree_cls in TREES:\n if tree_cls.supported(remote_conf):\n return tree_cls\n return LocalRemoteTree\n\n\ndef _get_conf(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 return _resolve_remote_refs(repo.config, 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": 46, "end_line": 89, "span_ids": ["get_cloud_tree", "_resolve_remote_refs", "get_remote"], "tokens": 347}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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}\n\n\ndef get_cloud_tree(repo, **kwargs):\n remote_conf = _get_conf(repo, **kwargs)\n return _get_tree(remote_conf)(repo, remote_conf)\n\n\ndef get_remote(repo, **kwargs):\n tree = get_cloud_tree(repo, **kwargs)\n if tree.scheme == \"local\":\n return LocalRemote(tree)\n if tree.scheme == \"ssh\":\n return SSHRemote(tree)\n return Remote(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/remote/azure.py_logging_AzureRemoteTree.__init__.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_logging_AzureRemoteTree.__init__.None_1", "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": 46, "span_ids": ["AzureRemoteTree", "imports", "AzureRemoteTree.__init__"], "tokens": 331}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 threading\nfrom datetime import datetime, timedelta\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 BaseRemoteTree\nfrom dvc.scheme import Schemes\n\nlogger = logging.getLogger(__name__)\n\n\nclass AzureRemoteTree(BaseRemoteTree):\n scheme = Schemes.AZURE\n PATH_CLS = CloudURLInfo\n REQUIRES = {\n \"azure-storage-blob\": \"azure.storage.blob\",\n \"knack\": \"knack\",\n }\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 self.path_info = self.PATH_CLS(url)\n\n if not self.path_info.bucket:\n container = self._az_config.get(\"storage\", \"container_name\", None)\n self.path_info = self.PATH_CLS(f\"azure://{container}\")\n\n self._conn_kwargs = {\n opt: config.get(opt) or self._az_config.get(\"storage\", opt, None)\n for opt in [\"connection_string\", \"sas_token\"]\n }\n self._conn_kwargs[\"account_name\"] = self._az_config.get(\n \"storage\", \"account\", None\n )\n self._conn_kwargs[\"account_key\"] = self._az_config.get(\n \"storage\", \"key\", 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/remote/azure.py_AzureRemoteTree._az_config_AzureRemoteTree._az_config.return.CLIConfig_config_dir_conf": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_AzureRemoteTree._az_config_AzureRemoteTree._az_config.return.CLIConfig_config_dir_conf", "embedding": null, "metadata": {"file_path": "dvc/remote/azure.py", "file_name": "azure.py", "file_type": "text/x-python", "category": "implementation", "start_line": 48, "end_line": 58, "span_ids": ["AzureRemoteTree._az_config"], "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 AzureRemoteTree(BaseRemoteTree):\n\n @cached_property\n def _az_config(self):\n # NOTE: ideally we would've used get_default_cli().config from\n # azure.cli.core, but azure-cli-core has a lot of conflicts with other\n # dependencies. So instead we are just use knack directly\n from knack.config import CLIConfig\n\n config_dir = os.getenv(\n \"AZURE_CONFIG_DIR\", os.path.expanduser(os.path.join(\"~\", \".azure\"))\n )\n return CLIConfig(config_dir=config_dir, config_env_var_prefix=\"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/remote/azure.py_AzureRemoteTree.blob_service_AzureRemoteTree.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_AzureRemoteTree.blob_service_AzureRemoteTree.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": 60, "end_line": 77, "span_ids": ["AzureRemoteTree.blob_service"], "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 AzureRemoteTree(BaseRemoteTree):\n\n @wrap_prop(threading.Lock())\n @cached_property\n def blob_service(self):\n # pylint: disable=no-name-in-module\n from azure.storage.blob import BlockBlobService\n from azure.common import AzureMissingResourceHttpError\n\n logger.debug(f\"URL {self.path_info}\")\n logger.debug(f\"Connection options {self._conn_kwargs}\")\n blob_service = BlockBlobService(**self._conn_kwargs)\n logger.debug(f\"Container name {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_AzureRemoteTree.get_etag_AzureRemoteTree._generate_download_url.return.download_url": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_AzureRemoteTree.get_etag_AzureRemoteTree._generate_download_url.return.download_url", "embedding": null, "metadata": {"file_path": "dvc/remote/azure.py", "file_name": "azure.py", "file_type": "text/x-python", "category": "implementation", "start_line": 79, "end_line": 101, "span_ids": ["AzureRemoteTree.get_etag", "AzureRemoteTree._generate_download_url"], "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 AzureRemoteTree(BaseRemoteTree):\n\n def get_etag(self, path_info):\n etag = self.blob_service.get_blob_properties(\n path_info.bucket, path_info.path\n ).properties.etag\n return etag.strip('\"')\n\n def _generate_download_url(self, path_info, expires=3600):\n from azure.storage.blob import ( # pylint:disable=no-name-in-module\n BlobPermissions,\n )\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/azure.py_AzureRemoteTree.exists_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_AzureRemoteTree.exists_", "embedding": null, "metadata": {"file_path": "dvc/remote/azure.py", "file_name": "azure.py", "file_type": "text/x-python", "category": "implementation", "start_line": 103, "end_line": 165, "span_ids": ["AzureRemoteTree.remove", "AzureRemoteTree._upload", "AzureRemoteTree._download", "AzureRemoteTree.walk_files", "AzureRemoteTree._list_paths", "AzureRemoteTree.exists", "AzureRemoteTree.get_file_hash"], "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 AzureRemoteTree(BaseRemoteTree):\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)\n\n def _list_paths(self, bucket, prefix):\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 yield blob.name\n\n if not blobs.next_marker:\n break\n\n next_marker = blobs.next_marker\n\n def walk_files(self, path_info, **kwargs):\n if not kwargs.pop(\"prefix\", False):\n path_info = path_info / \"\"\n for fname in self._list_paths(\n path_info.bucket, path_info.path, **kwargs\n ):\n if fname.endswith(\"/\"):\n continue\n\n yield path_info.replace(path=fname)\n\n def remove(self, path_info):\n if path_info.scheme != self.scheme:\n raise NotImplementedError\n\n logger.debug(f\"Removing {path_info}\")\n self.blob_service.delete_blob(path_info.bucket, path_info.path)\n\n def get_file_hash(self, path_info):\n return self.get_etag(path_info)\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 )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_BaseRemoteTree_BaseRemoteTree.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_BaseRemoteTree_BaseRemoteTree.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": 135, "span_ids": ["BaseRemoteTree", "BaseRemoteTree.get_missing_deps", "BaseRemoteTree.__init__"], "tokens": 340}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseRemoteTree:\n scheme = \"base\"\n REQUIRES = {}\n PATH_CLS = URLInfo\n JOBS = 4 * cpu_count()\n\n PARAM_RELPATH = \"relpath\"\n CHECKSUM_DIR_SUFFIX = \".dir\"\n HASH_JOBS = max(1, min(4, cpu_count() // 2))\n DEFAULT_VERIFY = False\n LIST_OBJECT_PAGE_SIZE = 1000\n TRAVERSE_WEIGHT_MULTIPLIER = 5\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 PARAM_CHECKSUM = None\n\n state = StateNoop()\n\n def __init__(self, repo, config):\n self.repo = repo\n self.config = config\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.hash_jobs = (\n config.get(\"hash_jobs\")\n or (self.repo and self.repo.config[\"core\"].get(\"hash_jobs\"))\n or self.HASH_JOBS\n )\n self.verify = config.get(\"verify\", self.DEFAULT_VERIFY)\n self.path_info = None\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_BaseRemoteTree._check_requires_BaseRemoteTree._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_BaseRemoteTree._check_requires_BaseRemoteTree._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": 137, "end_line": 161, "span_ids": ["BaseRemoteTree._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 BaseRemoteTree:\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\", f\"{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_BaseRemoteTree.supported_BaseRemoteTree.is_dir_hash.return.hash__endswith_cls_CHECKS": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_BaseRemoteTree.supported_BaseRemoteTree.is_dir_hash.return.hash__endswith_cls_CHECKS", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 163, "end_line": 272, "span_ids": ["BaseRemoteTree.supported", "BaseRemoteTree.is_protected", "BaseRemoteTree.isfile", "BaseRemoteTree.copy_fobj", "BaseRemoteTree.symlink", "BaseRemoteTree.is_dir_hash", "BaseRemoteTree.walk_files", "BaseRemoteTree.is_empty", "BaseRemoteTree.iscopy", "BaseRemoteTree.dir_mode", "BaseRemoteTree.exists", "BaseRemoteTree.file_mode", "BaseRemoteTree.move", "BaseRemoteTree.hardlink", "BaseRemoteTree.protect", "BaseRemoteTree.reflink", "BaseRemoteTree.open", "BaseRemoteTree.copy", "BaseRemoteTree.cache", "BaseRemoteTree.makedirs", "BaseRemoteTree.remove", "BaseRemoteTree.isdir", "BaseRemoteTree.unprotect"], "tokens": 710}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseRemoteTree:\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 file_mode(self):\n return self._file_mode\n\n @property\n def dir_mode(self):\n return self._dir_mode\n\n @property\n def cache(self):\n return getattr(self.repo.cache, self.scheme)\n\n def open(self, path_info, mode=\"r\", encoding=None):\n if hasattr(self, \"_generate_download_url\"):\n func = self._generate_download_url # noqa,pylint:disable=no-member\n get_url = partial(func, path_info)\n return open_url(get_url, mode=mode, encoding=encoding)\n\n raise RemoteActionNotImplemented(\"open\", self.scheme)\n\n def exists(self, path_info):\n raise NotImplementedError\n\n # pylint: disable=unused-argument\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 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 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, **kwargs):\n \"\"\"Return a generator with `PathInfo`s to all the files.\n\n Optional kwargs:\n prefix (bool): If true `path_info` will be treated as a prefix\n rather than directory path.\n \"\"\"\n raise NotImplementedError\n\n def is_empty(self, path_info):\n return False\n\n def remove(self, path_info):\n raise RemoteActionNotImplemented(\"remove\", self.scheme)\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 \"\"\"\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 copy_fobj(self, fobj, to_info):\n raise RemoteActionNotImplemented(\"copy_fobj\", 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 @staticmethod\n def protect(path_info):\n pass\n\n def is_protected(self, path_info):\n return False\n\n # pylint: enable=unused-argument\n\n @staticmethod\n def unprotect(path_info):\n pass\n\n @classmethod\n def is_dir_hash(cls, hash_):\n if not hash_:\n return False\n return hash_.endswith(cls.CHECKSUM_DIR_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/base.py_BaseRemoteTree.get_hash_BaseRemoteTree.get_hash.return.hash_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_BaseRemoteTree.get_hash_BaseRemoteTree.get_hash.return.hash_", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 274, "end_line": 309, "span_ids": ["BaseRemoteTree.get_hash"], "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 BaseRemoteTree:\n\n def get_hash(self, path_info, tree=None, **kwargs):\n assert isinstance(path_info, str) or path_info.scheme == self.scheme\n\n if not tree:\n tree = self\n\n if not tree.exists(path_info):\n return None\n\n if tree == self:\n # pylint: disable=assignment-from-none\n hash_ = self.state.get(path_info)\n else:\n hash_ = None\n # If we have dir hash in state db, but dir cache file is lost,\n # then we need to recollect the dir via .get_dir_hash() call below,\n # see https://github.com/iterative/dvc/issues/2219 for context\n if (\n hash_\n and self.is_dir_hash(hash_)\n and not tree.exists(self.cache.hash_to_path_info(hash_))\n ):\n hash_ = None\n\n if hash_:\n return hash_\n\n if tree.isdir(path_info):\n hash_ = self.get_dir_hash(path_info, tree, **kwargs)\n else:\n hash_ = tree.get_file_hash(path_info)\n\n if hash_ and self.exists(path_info):\n self.state.save(path_info, hash_)\n\n return hash_", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_BaseRemoteTree.get_file_hash_BaseRemoteTree.save_info.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_BaseRemoteTree.get_file_hash_BaseRemoteTree.save_info.return._", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 311, "end_line": 335, "span_ids": ["BaseRemoteTree.get_file_hash", "BaseRemoteTree.path_to_hash", "BaseRemoteTree.get_dir_hash", "BaseRemoteTree.save_info", "BaseRemoteTree.hash_to_path_info"], "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": "class BaseRemoteTree:\n\n def get_file_hash(self, path_info):\n raise NotImplementedError\n\n def get_dir_hash(self, path_info, tree, **kwargs):\n if not self.cache:\n raise RemoteCacheRequiredError(path_info)\n\n dir_info = self._collect_dir(path_info, tree, **kwargs)\n return self._save_dir_info(dir_info, path_info)\n\n def hash_to_path_info(self, hash_):\n return self.path_info / hash_[0:2] / hash_[2:]\n\n def path_to_hash(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(f\"Bad cache file path '{path}'\")\n\n return \"\".join(parts)\n\n def save_info(self, path_info, tree=None, **kwargs):\n return {\n self.PARAM_CHECKSUM: self.get_hash(path_info, tree=tree, **kwargs)\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_BaseRemoteTree._calculate_hashes_BaseRemoteTree._calculate_hashes.return.hashes": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_BaseRemoteTree._calculate_hashes_BaseRemoteTree._calculate_hashes.return.hashes", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 337, "end_line": 349, "span_ids": ["BaseRemoteTree._calculate_hashes"], "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 BaseRemoteTree:\n\n @staticmethod\n def _calculate_hashes(file_infos, tree):\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(tree.get_file_hash)\n with ThreadPoolExecutor(max_workers=tree.hash_jobs) as executor:\n tasks = executor.map(worker, file_infos)\n hashes = dict(zip(file_infos, tasks))\n return hashes", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_BaseRemoteTree._collect_dir_BaseRemoteTree._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_BaseRemoteTree._collect_dir_BaseRemoteTree._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": 351, "end_line": 383, "span_ids": ["BaseRemoteTree._collect_dir"], "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 BaseRemoteTree:\n\n def _collect_dir(self, path_info, tree, **kwargs):\n file_infos = set()\n\n for fname in tree.walk_files(path_info, **kwargs):\n if DvcIgnore.DVCIGNORE_FILE == fname.name:\n raise DvcIgnoreInCollectedDirError(fname.parent)\n\n file_infos.add(fname)\n\n hashes = {fi: self.state.get(fi) for fi in file_infos}\n not_in_state = {fi for fi, hash_ in hashes.items() if hash_ is None}\n\n new_hashes = self._calculate_hashes(not_in_state, tree)\n hashes.update(new_hashes)\n\n result = [\n {\n self.PARAM_CHECKSUM: hashes[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_BaseRemoteTree._save_dir_info_BaseRemoteTree._save_dir_info.return.hash_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_BaseRemoteTree._save_dir_info_BaseRemoteTree._save_dir_info.return.hash_", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 385, "end_line": 398, "span_ids": ["BaseRemoteTree._save_dir_info"], "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": "class BaseRemoteTree:\n\n def _save_dir_info(self, dir_info, path_info):\n hash_, tmp_info = self._get_dir_info_hash(dir_info)\n new_info = self.cache.hash_to_path_info(hash_)\n if self.cache.changed_cache_file(hash_):\n self.cache.tree.makedirs(new_info.parent)\n self.cache.tree.move(\n tmp_info, new_info, mode=self.cache.CACHE_MODE\n )\n\n if self.exists(path_info):\n self.state.save(path_info, hash_)\n self.state.save(new_info, hash_)\n\n return hash_", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_BaseRemoteTree._get_dir_info_hash_BaseRemoteTree._get_dir_info_hash.return.hash__to_info": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_BaseRemoteTree._get_dir_info_hash_BaseRemoteTree._get_dir_info_hash.return.hash__to_info", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 400, "end_line": 411, "span_ids": ["BaseRemoteTree._get_dir_info_hash"], "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 BaseRemoteTree:\n\n def _get_dir_info_hash(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 tree = self.cache.tree\n from_info = PathInfo(tmp)\n to_info = tree.path_info / tmp_fname(\"\")\n tree.upload(from_info, to_info, no_progress_bar=True)\n\n hash_ = tree.get_file_hash(to_info) + self.CHECKSUM_DIR_SUFFIX\n return hash_, 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/base.py_BaseRemoteTree.upload_BaseRemoteTree.upload.self__upload_noqa_py": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_BaseRemoteTree.upload_BaseRemoteTree.upload.self__upload_noqa_py", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 413, "end_line": 432, "span_ids": ["BaseRemoteTree.upload"], "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 BaseRemoteTree:\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 self._upload( # noqa, pylint: disable=no-member\n from_info.fspath,\n to_info,\n name=name,\n no_progress_bar=no_progress_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/dvc/remote/base.py_BaseRemoteTree.download_BaseRemoteTree.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_BaseRemoteTree.download_BaseRemoteTree.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": 434, "end_line": 462, "span_ids": ["BaseRemoteTree.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 BaseRemoteTree:\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_BaseRemoteTree._download_dir_BaseRemoteTree._download_dir.with_Tqdm_.with_ThreadPoolExecutor_m.for_future_in_as_complete.if_exc_.raise_exc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_BaseRemoteTree._download_dir_BaseRemoteTree._download_dir.with_Tqdm_.with_ThreadPoolExecutor_m.for_future_in_as_complete.if_exc_.raise_exc", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 464, "end_line": 506, "span_ids": ["BaseRemoteTree._download_dir"], "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": "class BaseRemoteTree:\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 = [\n executor.submit(download_files, from_info, to_info)\n for from_info, to_info in zip(from_infos, to_infos)\n ]\n\n # NOTE: unlike pulling/fetching cache, where we need to\n # download everything we can, not raising an error here might\n # turn very ugly, as the user might think that he has\n # downloaded a complete directory, while having a partial one,\n # which might cause unexpected results in his pipeline.\n for future in as_completed(futures):\n # NOTE: executor won't let us raise until all futures that\n # it has are finished, so we need to cancel them ourselves\n # before re-raising.\n exc = future.exception()\n if exc:\n for entry in futures:\n entry.cancel()\n raise 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/base.py_BaseRemoteTree._download_file_BaseRemoteTree._download_file.move_tmp_file_to_info_m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_BaseRemoteTree._download_file_BaseRemoteTree._download_file.move_tmp_file_to_info_m", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 508, "end_line": 522, "span_ids": ["BaseRemoteTree._download_file"], "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 BaseRemoteTree:\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 self._download( # noqa, pylint: disable=no-member\n from_info, tmp_file, name=name, no_progress_bar=no_progress_bar\n )\n\n move(tmp_file, to_info, mode=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/base.py_BaseRemoteTree.list_paths_BaseRemoteTree.list_hashes.for_path_in_self_list_pat.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_BaseRemoteTree.list_paths_BaseRemoteTree.list_hashes.for_path_in_self_list_pat.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": 524, "end_line": 553, "span_ids": ["BaseRemoteTree.list_hashes", "BaseRemoteTree.list_paths"], "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 BaseRemoteTree:\n\n def list_paths(self, prefix=None, progress_callback=None):\n if prefix:\n if len(prefix) > 2:\n path_info = self.path_info / prefix[:2] / prefix[2:]\n else:\n path_info = self.path_info / prefix[:2]\n prefix = True\n else:\n path_info = self.path_info\n prefix = False\n if progress_callback:\n for file_info in self.walk_files(path_info, prefix=prefix):\n progress_callback()\n yield file_info.path\n else:\n yield from self.walk_files(path_info, prefix=prefix)\n\n def list_hashes(self, prefix=None, progress_callback=None):\n \"\"\"Iterate over hashes in this tree.\n\n If `prefix` is specified, only hashes which begin with `prefix`\n will be returned.\n \"\"\"\n for path in self.list_paths(prefix, progress_callback):\n try:\n yield self.path_to_hash(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_BaseRemoteTree.all_BaseRemoteTree.all.return.self_list_hashes_traverse": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_BaseRemoteTree.all_BaseRemoteTree.all.return.self_list_hashes_traverse", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 555, "end_line": 573, "span_ids": ["BaseRemoteTree.all"], "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 BaseRemoteTree:\n\n def all(self, jobs=None, name=None):\n \"\"\"Iterate over all hashes in this tree.\n\n Hashes 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 hashes from '{}'\".format(\n name if name else \"remote cache\"\n )\n )\n\n if not self.CAN_TRAVERSE:\n return self.list_hashes()\n\n remote_size, remote_hashes = self.estimate_remote_size(name=name)\n return self.list_hashes_traverse(\n remote_size, remote_hashes, 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_BaseRemoteTree._hashes_with_limit_BaseRemoteTree._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_BaseRemoteTree._hashes_with_limit_BaseRemoteTree._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": 575, "end_line": 594, "span_ids": ["BaseRemoteTree._hashes_with_limit", "BaseRemoteTree._max_estimation_size"], "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 BaseRemoteTree:\n\n def _hashes_with_limit(self, limit, prefix=None, progress_callback=None):\n count = 0\n for hash_ in self.list_hashes(prefix, progress_callback):\n yield hash_\n count += 1\n if count > limit:\n logger.debug(\n \"`list_hashes()` returned max '{}' hashes, \"\n \"skipping remaining results\".format(limit)\n )\n return\n\n def _max_estimation_size(self, hashes):\n # Max remote size allowed for us to use traverse method\n return max(\n self.TRAVERSE_THRESHOLD_SIZE,\n len(hashes)\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_BaseRemoteTree.estimate_remote_size_BaseRemoteTree.estimate_remote_size.return.remote_size_remote_hashe": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_BaseRemoteTree.estimate_remote_size_BaseRemoteTree.estimate_remote_size.return.remote_size_remote_hashe", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 596, "end_line": 629, "span_ids": ["BaseRemoteTree.estimate_remote_size"], "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 BaseRemoteTree:\n\n def estimate_remote_size(self, hashes=None, name=None):\n \"\"\"Estimate tree 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 hashes:\n max_hashes = self._max_estimation_size(hashes)\n else:\n max_hashes = None\n\n with Tqdm(\n desc=\"Estimating size of \"\n + (f\"cache in '{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_hashes:\n hashes = self._hashes_with_limit(\n max_hashes / total_prefixes, prefix, update\n )\n else:\n hashes = self.list_hashes(prefix, update)\n\n remote_hashes = set(hashes)\n if remote_hashes:\n remote_size = total_prefixes * len(remote_hashes)\n else:\n remote_size = total_prefixes\n logger.debug(f\"Estimated remote size: {remote_size} files\")\n return remote_size, remote_hashes", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_BaseRemoteTree.list_hashes_traverse_BaseRemoteTree.list_hashes_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_BaseRemoteTree.list_hashes_traverse_BaseRemoteTree.list_hashes_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": 631, "end_line": 684, "span_ids": ["BaseRemoteTree.list_hashes_traverse"], "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 BaseRemoteTree:\n\n def list_hashes_traverse(\n self, remote_size, remote_hashes, jobs=None, name=None\n ):\n \"\"\"Iterate over all hashes found in this tree.\n Hashes are fetched in parallel according to prefix, except in\n cases where the remote size is very small.\n\n All hashes from the remote (including any from the size\n estimation step passed via the `remote_hashes` argument) will be\n returned.\n\n NOTE: For large remotes the list of hashes 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 hashes that were already\n # fetched during remote size estimation\n traverse_prefixes = [None]\n initial = 0\n else:\n yield from remote_hashes\n initial = len(remote_hashes)\n traverse_prefixes = [f\"{i:02x}\" 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 + (f\"cache in '{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.list_hashes(\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/base.py_BaseRemoteTree.list_hashes_exists_BaseRemoteTree._remove_unpacked_dir.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_BaseRemoteTree.list_hashes_exists_BaseRemoteTree._remove_unpacked_dir.pass", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 686, "end_line": 712, "span_ids": ["BaseRemoteTree._remove_unpacked_dir", "BaseRemoteTree.list_hashes_exists"], "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 BaseRemoteTree:\n\n def list_hashes_exists(self, hashes, jobs=None, name=None):\n \"\"\"Return list of the specified hashes which exist in this tree.\n Hashes will be queried individually.\n \"\"\"\n logger.debug(\n \"Querying {} hashes via object_exists\".format(len(hashes))\n )\n with Tqdm(\n desc=\"Querying \"\n + (\"cache in \" + name if name else \"remote cache\"),\n total=len(hashes),\n unit=\"file\",\n ) as pbar:\n\n def exists_with_progress(path_info):\n ret = self.exists(path_info)\n pbar.update_msg(str(path_info))\n return ret\n\n with ThreadPoolExecutor(max_workers=jobs or self.JOBS) as executor:\n path_infos = map(self.hash_to_path_info, hashes)\n in_remote = executor.map(exists_with_progress, path_infos)\n ret = list(itertools.compress(hashes, in_remote))\n return ret\n\n def _remove_unpacked_dir(self, hash_):\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/remote/base.py_Remote_Remote.open.return.self_tree_open_args_k": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_Remote_Remote.open.return.self_tree_open_args_k", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 715, "end_line": 772, "span_ids": ["Remote.cache", "Remote.__repr__", "Remote.get_hash", "Remote.hash_to_path_info", "Remote.is_dir_hash", "Remote.path_to_hash", "Remote", "Remote.save_info", "Remote.__init__", "Remote.open", "Remote.scheme", "Remote.path_info"], "tokens": 357}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Remote:\n \"\"\"Cloud remote class.\n\n Provides methods for indexing and garbage collecting trees which contain\n DVC remotes.\n \"\"\"\n\n INDEX_CLS = RemoteIndex\n\n def __init__(self, tree):\n self.tree = tree\n self.repo = tree.repo\n\n config = tree.config\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.tree.CHECKSUM_DIR_SUFFIX\n )\n else:\n self.index = RemoteIndexNoop()\n\n @property\n def path_info(self):\n return self.tree.path_info\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 @property\n def cache(self):\n return getattr(self.repo.cache, self.scheme)\n\n @property\n def scheme(self):\n return self.tree.scheme\n\n def is_dir_hash(self, hash_):\n return self.tree.is_dir_hash(hash_)\n\n def get_hash(self, path_info, **kwargs):\n return self.tree.get_hash(path_info, **kwargs)\n\n def hash_to_path_info(self, hash_):\n return self.tree.hash_to_path_info(hash_)\n\n def path_to_hash(self, path):\n return self.tree.path_to_hash(path)\n\n def save_info(self, path_info, **kwargs):\n return self.tree.save_info(path_info, **kwargs)\n\n def open(self, *args, **kwargs):\n return self.tree.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/remote/base.py_CloudCache.save_CloudCache._save.return.self__save_file_path_info": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_CloudCache.save_CloudCache._save.return.self__save_file_path_info", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1159, "end_line": 1176, "span_ids": ["CloudCache._save", "CloudCache.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 CloudCache:\n\n def save(self, path_info, tree, hash_info, save_link=True, **kwargs):\n if path_info.scheme != self.scheme:\n raise RemoteActionNotImplemented(\n f\"save {path_info.scheme} -> {self.scheme}\", self.scheme,\n )\n\n if not hash_info:\n hash_info = self.tree.save_info(path_info, tree=tree, **kwargs)\n hash_ = hash_info[self.tree.PARAM_CHECKSUM]\n return self._save(path_info, tree, hash_, save_link, **kwargs)\n\n def _save(self, path_info, tree, hash_, save_link=True, **kwargs):\n to_info = self.hash_to_path_info(hash_)\n logger.debug(\"Saving '%s' to '%s'.\", path_info, to_info)\n\n if tree.isdir(path_info):\n return self._save_dir(path_info, tree, hash_, save_link, **kwargs)\n return self._save_file(path_info, tree, hash_, save_link, **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/remote/gdrive.py_io_FOLDER_MIME_TYPE._application_vnd_google_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_io_FOLDER_MIME_TYPE._application_vnd_google_a", "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": 23, "span_ids": ["imports"], "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 io\nimport logging\nimport os\nimport posixpath\nimport re\nimport threading\nfrom collections import defaultdict\nfrom contextlib import contextmanager\nfrom urllib.parse import urlparse\n\nfrom funcy import cached_property, retry, wrap_prop, wrap_with\nfrom funcy.py3 import cat\n\nfrom dvc.exceptions import DvcException, FileMissingError\nfrom dvc.path_info import CloudURLInfo\nfrom dvc.progress import Tqdm\nfrom dvc.remote.base import BaseRemoteTree\nfrom dvc.scheme import Schemes\nfrom dvc.utils import format_link, tmp_fname\nfrom dvc.utils.stream import IterStream\n\nlogger = logging.getLogger(__name__)\nFOLDER_MIME_TYPE = \"application/vnd.google-apps.folder\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_GDriveAuthError_GDriveAuthError.__init__.super___init___message_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_GDriveAuthError_GDriveAuthError.__init__.super___init___message_", "embedding": null, "metadata": {"file_path": "dvc/remote/gdrive.py", "file_name": "gdrive.py", "file_type": "text/x-python", "category": "implementation", "start_line": 26, "end_line": 39, "span_ids": ["GDriveAuthError.__init__", "GDriveAuthError"], "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": "class GDriveAuthError(DvcException):\n def __init__(self, cred_location):\n\n if cred_location:\n message = (\n \"GDrive remote auth failed with credentials in '{}'.\\n\"\n \"Backup first, remove or fix them, and run DVC again.\\n\"\n \"It should do auth again and refresh the credentials.\\n\\n\"\n \"Details:\".format(cred_location)\n )\n else:\n message = \"Failed to authenticate GDrive remote\"\n\n super().__init__(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/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": 42, "end_line": 69, "span_ids": ["_gdrive_retry"], "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 _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 = exc.GetField(\"reason\") in [\n \"userRateLimitExceeded\",\n \"rateLimitExceeded\",\n ]\n if result:\n logger.debug(f\"Retrying GDrive API call, error: {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_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": 72, "end_line": 84, "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/remote/gdrive.py_GDriveRemoteTree_GDriveRemoteTree.__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_GDriveRemoteTree_GDriveRemoteTree.__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": 87, "end_line": 139, "span_ids": ["GDriveRemoteTree.__init__", "GDriveRemoteTree"], "tokens": 495}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GDriveRemoteTree(BaseRemoteTree):\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\n self.path_info = self.PATH_CLS(config[\"url\"])\n\n if not self.path_info.bucket:\n raise DvcException(\n \"Empty GDrive URL '{}'. Learn more at {}\".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(GDriveRemoteTree.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_GDriveRemoteTree._validate_config_GDriveRemoteTree._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_GDriveRemoteTree._validate_config_GDriveRemoteTree._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": 141, "end_line": 165, "span_ids": ["GDriveRemoteTree._validate_config"], "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": "class GDriveRemoteTree(BaseRemoteTree):\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, set `gdrive_service_account_email`,\\n\"\n \"`gdrive_service_account_p12_file_path`, and optionally \"\n \"`gdrive_service_account_user_email`\\nin DVC config. \"\n \"Learn more at {}\".format(\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 GDrive's client ID and secret in \"\n \"DVC config or omit both to use the defaults.\\n\"\n \"Learn more at {}\".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_GDriveRemoteTree.credentials_location_GDriveRemoteTree.credentials_location.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_GDriveRemoteTree.credentials_location_GDriveRemoteTree.credentials_location.return.None", "embedding": null, "metadata": {"file_path": "dvc/remote/gdrive.py", "file_name": "gdrive.py", "file_type": "text/x-python", "category": "implementation", "start_line": 167, "end_line": 178, "span_ids": ["GDriveRemoteTree.credentials_location"], "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": "class GDriveRemoteTree(BaseRemoteTree):\n\n @cached_property\n def credentials_location(self):\n \"\"\"\n Helper to determine where will GDrive remote read credentials from.\n Useful for tests, exception messages, etc. Returns either env variable\n name if it's set or actual path to the credentials file.\n \"\"\"\n if os.getenv(GDriveRemoteTree.GDRIVE_CREDENTIALS_DATA):\n return GDriveRemoteTree.GDRIVE_CREDENTIALS_DATA\n if os.path.exists(self._gdrive_user_credentials_path):\n return self._gdrive_user_credentials_path\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/remote/gdrive.py_GDriveRemoteTree._validate_credentials_GDriveRemoteTree._validate_credentials.if_not_os_getenv_GDriveRe.if_.logger_warning_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_GDriveRemoteTree._validate_credentials_GDriveRemoteTree._validate_credentials.if_not_os_getenv_GDriveRe.if_.logger_warning_", "embedding": null, "metadata": {"file_path": "dvc/remote/gdrive.py", "file_name": "gdrive.py", "file_type": "text/x-python", "category": "implementation", "start_line": 180, "end_line": 204, "span_ids": ["GDriveRemoteTree._validate_credentials"], "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 GDriveRemoteTree(BaseRemoteTree):\n\n @staticmethod\n def _validate_credentials(auth, settings):\n \"\"\"\n Detects discrepancy in DVC config and cached credentials file.\n Usually happens when a second remote is added and it is using\n the same credentials default file. Or when someones decides to change\n DVC config client id or secret but forgets to remove the cached\n credentials file.\n \"\"\"\n if not os.getenv(GDriveRemoteTree.GDRIVE_CREDENTIALS_DATA):\n if (\n settings[\"client_config\"][\"client_id\"]\n != auth.credentials.client_id\n or settings[\"client_config\"][\"client_secret\"]\n != auth.credentials.client_secret\n ):\n logger.warning(\n \"Client ID and secret configured do not match the \"\n \"actual ones used\\nto access the remote. Do you \"\n \"use multiple GDrive remotes and forgot to\\nset \"\n \"`gdrive_user_credentials_file` for one or more of them? \"\n \"Learn more at\\n{}.\\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_GDriveRemoteTree._drive_GDriveRemoteTree._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_GDriveRemoteTree._drive_GDriveRemoteTree._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": 206, "end_line": 274, "span_ids": ["GDriveRemoteTree._drive"], "tokens": 569}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GDriveRemoteTree(BaseRemoteTree):\n\n @wrap_prop(threading.RLock())\n @cached_property\n def _drive(self):\n from pydrive2.auth import GoogleAuth\n from pydrive2.drive import GoogleDrive\n\n if os.getenv(GDriveRemoteTree.GDRIVE_CREDENTIALS_DATA):\n with open(self._gdrive_user_credentials_path, \"w\") as cred_file:\n cred_file.write(\n os.getenv(GDriveRemoteTree.GDRIVE_CREDENTIALS_DATA)\n )\n\n auth_settings = {\n \"client_config_backend\": \"settings\",\n \"save_credentials\": True,\n \"save_credentials_backend\": \"file\",\n \"save_credentials_file\": self._gdrive_user_credentials_path,\n \"get_refresh_token\": True,\n \"oauth_scope\": [\n \"https://www.googleapis.com/auth/drive\",\n \"https://www.googleapis.com/auth/drive.appdata\",\n ],\n }\n\n if self._use_service_account:\n auth_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 auth_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\n GoogleAuth.DEFAULT_SETTINGS.update(auth_settings)\n\n # Pass non existent settings path to force DEFAULT_SETTINGS loadings\n gauth = GoogleAuth(settings_file=\"\")\n\n try:\n logger.debug(\n \"GDrive remote auth with config '{}'.\".format(\n GoogleAuth.DEFAULT_SETTINGS\n )\n )\n if self._use_service_account:\n gauth.ServiceAuth()\n else:\n gauth.CommandLineAuth()\n GDriveRemoteTree._validate_credentials(gauth, auth_settings)\n\n # Handle AuthenticationError, RefreshError and other auth failures\n # It's hard to come up with a narrow exception, since PyDrive throws\n # a lot of different errors - broken credentials file, refresh token\n # expired, flow failed, etc.\n except Exception as exc:\n raise GDriveAuthError(self.credentials_location) from exc\n finally:\n if os.getenv(GDriveRemoteTree.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_GDriveRemoteTree._ids_cache_GDriveRemoteTree._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_GDriveRemoteTree._ids_cache_GDriveRemoteTree._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": 276, "end_line": 297, "span_ids": ["GDriveRemoteTree._ids_cache"], "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 GDriveRemoteTree(BaseRemoteTree):\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(\n self.path_info,\n use_cache=False,\n hint=\"Confirm the directory exists and you can access it.\",\n ),\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_GDriveRemoteTree._cache_path_id_GDriveRemoteTree._list_params.return.params": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_GDriveRemoteTree._cache_path_id_GDriveRemoteTree._list_params.return.params", "embedding": null, "metadata": {"file_path": "dvc/remote/gdrive.py", "file_name": "gdrive.py", "file_type": "text/x-python", "category": "implementation", "start_line": 299, "end_line": 317, "span_ids": ["GDriveRemoteTree._cache_path_id", "GDriveRemoteTree._list_params"], "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 GDriveRemoteTree(BaseRemoteTree):\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 logger.debug(\n \"GDrive remote '{}' is using shared drive id '{}'.\".format(\n self.path_info, drive_id\n )\n )\n params[\"driveId\"] = drive_id\n params[\"corpora\"] = \"drive\"\n return 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/remote/gdrive.py_GDriveRemoteTree._gdrive_shared_drive_id_GDriveRemoteTree._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_GDriveRemoteTree._gdrive_shared_drive_id_GDriveRemoteTree._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": 319, "end_line": 346, "span_ids": ["GDriveRemoteTree._gdrive_shared_drive_id"], "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 GDriveRemoteTree(BaseRemoteTree):\n\n @_gdrive_retry\n def _gdrive_shared_drive_id(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 # ID of the shared drive the item resides in.\n # Only populated for items in shared drives.\n try:\n item.FetchMetadata(\"driveId\")\n except ApiRequestError as exc:\n error_code = exc.error.get(\"code\", 0)\n if error_code == 404:\n raise DvcException(\n \"'{}' for '{}':\\n\\n\"\n \"1. Confirm the directory exists and you can access it.\\n\"\n \"2. Make sure that credentials in '{}'\\n\"\n \" are correct for this remote e.g. \"\n \"use the `gdrive_user_credentials_file` config\\n\"\n \" option if you use multiple GDrive remotes with \"\n \"different email accounts.\\n\\nDetails\".format(\n item_id, self.path_info, self.credentials_location\n )\n ) from exc\n raise\n\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_GDriveRemoteTree._gdrive_upload_file_GDriveRemoteTree._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_GDriveRemoteTree._gdrive_upload_file_GDriveRemoteTree._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": 348, "end_line": 375, "span_ids": ["GDriveRemoteTree._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 GDriveRemoteTree(BaseRemoteTree):\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_GDriveRemoteTree._gdrive_download_file_GDriveRemoteTree._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_GDriveRemoteTree._gdrive_download_file_GDriveRemoteTree._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": 377, "end_line": 392, "span_ids": ["GDriveRemoteTree._gdrive_download_file"], "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 GDriveRemoteTree(BaseRemoteTree):\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\n with Tqdm(\n desc=progress_desc,\n disable=no_progress_bar,\n bytes=True,\n # explicit `bar_format` as `total` will be set by `update_to`\n bar_format=Tqdm.BAR_FMT_DEFAULT,\n ) as pbar:\n gdrive_file.GetContentFile(to_file, callback=pbar.update_to)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_GDriveRemoteTree.open_GDriveRemoteTree.open.yield_stream": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_GDriveRemoteTree.open_GDriveRemoteTree.open.yield_stream", "embedding": null, "metadata": {"file_path": "dvc/remote/gdrive.py", "file_name": "gdrive.py", "file_type": "text/x-python", "category": "implementation", "start_line": 394, "end_line": 409, "span_ids": ["GDriveRemoteTree.open"], "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 GDriveRemoteTree(BaseRemoteTree):\n\n @contextmanager\n @_gdrive_retry\n def open(self, path_info, mode=\"r\", encoding=None):\n assert mode in {\"r\", \"rt\", \"rb\"}\n\n item_id = self._get_item_id(path_info)\n param = {\"id\": item_id}\n # it does not create a file on the remote\n gdrive_file = self._drive.CreateFile(param)\n fd = gdrive_file.GetContentIOBuffer()\n stream = IterStream(iter(fd))\n\n if mode != \"rb\":\n stream = io.TextIOWrapper(stream, encoding=encoding)\n\n yield stream", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_GDriveRemoteTree.gdrive_delete_file_GDriveRemoteTree.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_GDriveRemoteTree.gdrive_delete_file_GDriveRemoteTree.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": 411, "end_line": 441, "span_ids": ["GDriveRemoteTree.gdrive_delete_file"], "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 GDriveRemoteTree(BaseRemoteTree):\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 exc.GetField(\"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_GDriveRemoteTree._gdrive_list_GDriveRemoteTree._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_GDriveRemoteTree._gdrive_list_GDriveRemoteTree._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": 443, "end_line": 474, "span_ids": ["GDriveRemoteTree._gdrive_create_dir", "GDriveRemoteTree._gdrive_list", "GDriveRemoteTree._create_dir"], "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 GDriveRemoteTree(BaseRemoteTree):\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_GDriveRemoteTree._get_remote_item_ids_GDriveRemoteTree._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_GDriveRemoteTree._get_remote_item_ids_GDriveRemoteTree._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": 476, "end_line": 492, "span_ids": ["GDriveRemoteTree._get_remote_item_ids"], "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 GDriveRemoteTree(BaseRemoteTree):\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 f\"'{parent_id}' in parents\" 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_GDriveRemoteTree._get_cached_item_ids_GDriveRemoteTree._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_GDriveRemoteTree._get_cached_item_ids_GDriveRemoteTree._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": 494, "end_line": 514, "span_ids": ["GDriveRemoteTree._path_to_item_ids", "GDriveRemoteTree._get_cached_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 GDriveRemoteTree(BaseRemoteTree):\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_GDriveRemoteTree._get_item_id_GDriveRemoteTree._list_paths.for_item_in_self__gdrive_.yield_posixpath_join_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_GDriveRemoteTree._get_item_id_GDriveRemoteTree._list_paths.for_item_in_self__gdrive_.yield_posixpath_join_", "embedding": null, "metadata": {"file_path": "dvc/remote/gdrive.py", "file_name": "gdrive.py", "file_type": "text/x-python", "category": "implementation", "start_line": 516, "end_line": 553, "span_ids": ["GDriveRemoteTree._get_item_id", "GDriveRemoteTree.exists", "GDriveRemoteTree._list_paths"], "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 GDriveRemoteTree(BaseRemoteTree):\n\n def _get_item_id(self, path_info, create=False, use_cache=True, hint=None):\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 assert not create\n raise FileMissingError(path_info, hint)\n\n def exists(self, path_info):\n try:\n self._get_item_id(path_info)\n except FileMissingError:\n return False\n else:\n return True\n\n def _list_paths(self, prefix=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 f\"'{dir_id}' in parents\" for dir_id in dir_ids\n )\n query = f\"({parents_query}) and trashed=false\"\n\n for item in self._gdrive_list(query):\n parent_id = item[\"parents\"][0][\"id\"]\n yield posixpath.join(\n self._ids_cache[\"ids\"][parent_id], item[\"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_GDriveRemoteTree.walk_files_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gdrive.py_GDriveRemoteTree.walk_files_", "embedding": null, "metadata": {"file_path": "dvc/remote/gdrive.py", "file_name": "gdrive.py", "file_type": "text/x-python", "category": "implementation", "start_line": 555, "end_line": 583, "span_ids": ["GDriveRemoteTree.get_file_hash", "GDriveRemoteTree.walk_files", "GDriveRemoteTree._upload", "GDriveRemoteTree._download", "GDriveRemoteTree.remove"], "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 GDriveRemoteTree(BaseRemoteTree):\n\n def walk_files(self, path_info, **kwargs):\n use_prefix = kwargs.pop(\"prefix\", False)\n if path_info == self.path_info or not use_prefix:\n prefix = None\n else:\n prefix = path_info.path\n for fname in self._list_paths(prefix=prefix, **kwargs):\n yield path_info.replace(fname)\n\n def remove(self, path_info):\n item_id = self._get_item_id(path_info)\n self.gdrive_delete_file(item_id)\n\n def get_file_hash(self, path_info):\n raise NotImplementedError\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_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": 44, "span_ids": ["imports", "dynamic_chunk_size"], "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 logging\nimport os.path\nimport threading\nfrom datetime import timedelta\nfrom functools import wraps\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 BaseRemoteTree\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 # pylint: disable=protected-access\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_open_from_file_mode.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_open_from_file_mode.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": 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": "@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 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/gs.py_GSRemoteTree_GSRemoteTree.gs.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gs.py_GSRemoteTree_GSRemoteTree.gs.return._", "embedding": null, "metadata": {"file_path": "dvc/remote/gs.py", "file_name": "gs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 68, "end_line": 92, "span_ids": ["GSRemoteTree", "GSRemoteTree.__init__", "GSRemoteTree.gs"], "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 GSRemoteTree(BaseRemoteTree):\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 )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_GSRemoteTree._generate_download_url_GSRemoteTree._generate_download_url.return.signing_credentials_signe": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gs.py_GSRemoteTree._generate_download_url_GSRemoteTree._generate_download_url.return.signing_credentials_signe", "embedding": null, "metadata": {"file_path": "dvc/remote/gs.py", "file_name": "gs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 94, "end_line": 119, "span_ids": ["GSRemoteTree._generate_download_url"], "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 GSRemoteTree(BaseRemoteTree):\n\n def _generate_download_url(self, path_info, expires=3600):\n import google.auth\n from google.auth import compute_engine\n\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\n if isinstance(\n blob.client._credentials, # pylint: disable=protected-access\n google.auth.credentials.Signing,\n ):\n # sign if we're able to sign with credentials.\n return blob.generate_signed_url(expiration=expiration)\n\n auth_request = google.auth.transport.requests.Request()\n # create signing credentials with the default credentials\n # for use with Compute Engine and other environments where\n # Client credentials cannot sign.\n signing_credentials = compute_engine.IDTokenCredentials(\n auth_request, \"\"\n )\n return signing_credentials.signer.sign(blob)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_GSRemoteTree.exists_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gs.py_GSRemoteTree.exists_", "embedding": null, "metadata": {"file_path": "dvc/remote/gs.py", "file_name": "gs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 121, "end_line": 220, "span_ids": ["GSRemoteTree._download", "GSRemoteTree.exists", "GSRemoteTree.copy", "GSRemoteTree._list_paths", "GSRemoteTree.isdir", "GSRemoteTree.remove", "GSRemoteTree.makedirs", "GSRemoteTree.get_file_hash", "GSRemoteTree.isfile", "GSRemoteTree._upload", "GSRemoteTree.walk_files"], "tokens": 720}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GSRemoteTree(BaseRemoteTree):\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 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 _list_paths(self, path_info, max_items=None):\n for blob in self.gs.bucket(path_info.bucket).list_blobs(\n prefix=path_info.path, max_results=max_items\n ):\n yield blob.name\n\n def walk_files(self, path_info, **kwargs):\n if not kwargs.pop(\"prefix\", False):\n path_info = path_info / \"\"\n for fname in self._list_paths(path_info, **kwargs):\n # skip nested empty directories\n if fname.endswith(\"/\"):\n continue\n yield path_info.replace(fname)\n\n def remove(self, path_info):\n if path_info.scheme != \"gs\":\n raise NotImplementedError\n\n logger.debug(f\"Removing gs://{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 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 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 = f\"'{from_info.path}' doesn't exist in the cloud\"\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 get_file_hash(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 _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 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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_HDFSRemoteTree.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_HDFSRemoteTree.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": 54, "span_ids": ["HDFSRemoteTree.hdfs", "imports", "HDFSRemoteTree", "HDFSRemoteTree.__init__"], "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 io\nimport logging\nimport os\nimport re\nimport subprocess\nfrom collections import deque\nfrom contextlib import closing, contextmanager\nfrom urllib.parse import urlparse\n\nfrom dvc.scheme import Schemes\nfrom dvc.utils import fix_env, tmp_fname\n\nfrom .base import BaseRemoteTree, RemoteCmdError\nfrom .pool import get_connection\n\nlogger = logging.getLogger(__name__)\n\n\nclass HDFSRemoteTree(BaseRemoteTree):\n scheme = Schemes.HDFS\n REQUIRES = {\"pyarrow\": \"pyarrow\"}\n REGEX = r\"^hdfs://((?P.*)@)?.*$\"\n PARAM_CHECKSUM = \"checksum\"\n TRAVERSE_PREFIX_LEN = 2\n\n def __init__(self, repo, config):\n super().__init__(repo, config)\n\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 @staticmethod\n def hdfs(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_HDFSRemoteTree.open_HDFSRemoteTree.exists.with_self_hdfs_path_info_.return.hdfs_exists_path_info_pat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_HDFSRemoteTree.open_HDFSRemoteTree.exists.with_self_hdfs_path_info_.return.hdfs_exists_path_info_pat", "embedding": null, "metadata": {"file_path": "dvc/remote/hdfs.py", "file_name": "hdfs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 56, "end_line": 79, "span_ids": ["HDFSRemoteTree.open", "HDFSRemoteTree.exists"], "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": "class HDFSRemoteTree(BaseRemoteTree):\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 OSError 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\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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_HDFSRemoteTree.walk_files_HDFSRemoteTree.walk_files.with_self_hdfs_self_path_.while_dirs_.try_.except_OSError_.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_HDFSRemoteTree.walk_files_HDFSRemoteTree.walk_files.with_self_hdfs_self_path_.while_dirs_.try_.except_OSError_.pass", "embedding": null, "metadata": {"file_path": "dvc/remote/hdfs.py", "file_name": "hdfs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 81, "end_line": 103, "span_ids": ["HDFSRemoteTree.walk_files"], "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 HDFSRemoteTree(BaseRemoteTree):\n\n def walk_files(self, path_info, **kwargs):\n if not self.exists(path_info):\n return\n\n root = path_info.path\n dirs = deque([root])\n\n with self.hdfs(self.path_info) as hdfs:\n if not hdfs.exists(root):\n return\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 path = urlparse(entry[\"name\"]).path\n yield path_info.replace(path=path)\n except OSError:\n # When searching for a specific prefix pyarrow raises an\n # exception if the specified cache dir does not exist\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/remote/hdfs.py_HDFSRemoteTree.remove_HDFSRemoteTree.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_HDFSRemoteTree.remove_HDFSRemoteTree.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": 105, "end_line": 131, "span_ids": ["HDFSRemoteTree.makedirs", "HDFSRemoteTree.remove", "HDFSRemoteTree.copy"], "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 HDFSRemoteTree(BaseRemoteTree):\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(f\"Removing {path_info.path}\")\n with self.hdfs(path_info) as hdfs:\n hdfs.rm(path_info.path)\n\n def makedirs(self, path_info):\n with self.hdfs(path_info) as hdfs:\n # NOTE: hdfs.mkdir creates parents by default\n hdfs.mkdir(path_info.path)\n\n def copy(self, from_info, to_info, **_kwargs):\n with self.hdfs(to_info) as hdfs:\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_HDFSRemoteTree.hadoop_fs_HDFSRemoteTree.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_HDFSRemoteTree.hadoop_fs_HDFSRemoteTree.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": 133, "end_line": 156, "span_ids": ["HDFSRemoteTree.hadoop_fs"], "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 HDFSRemoteTree(BaseRemoteTree):\n\n def hadoop_fs(self, cmd, user=None):\n cmd = \"hadoop fs -\" + cmd\n if user:\n cmd = f\"HADOOP_USER_NAME={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/hdfs.py_HDFSRemoteTree._group_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_HDFSRemoteTree._group_", "embedding": null, "metadata": {"file_path": "dvc/remote/hdfs.py", "file_name": "hdfs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 158, "end_line": 183, "span_ids": ["HDFSRemoteTree._upload", "HDFSRemoteTree._download", "HDFSRemoteTree.get_file_hash", "HDFSRemoteTree._group"], "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": "class HDFSRemoteTree(BaseRemoteTree):\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_hash(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 f\"checksum {path_info.path}\", user=path_info.user\n )\n return self._group(regex, stdout, \"checksum\")\n\n def _upload(self, from_file, to_info, **_kwargs):\n with self.hdfs(to_info) as hdfs:\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": 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": "import logging\nimport os.path\nimport threading\n\nfrom funcy import cached_property, memoize, wrap_prop, wrap_with\n\nimport dvc.prompt as prompt\nfrom dvc.exceptions import DvcException, HTTPError\nfrom dvc.path_info import HTTPURLInfo\nfrom dvc.progress import Tqdm\nfrom dvc.remote.base import BaseRemoteTree\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_HTTPRemoteTree_HTTPRemoteTree.__init__.self.headers._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_HTTPRemoteTree_HTTPRemoteTree.__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": 53, "span_ids": ["HTTPRemoteTree", "HTTPRemoteTree.__init__"], "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 HTTPRemoteTree(BaseRemoteTree): # pylint:disable=abstract-method\n scheme = Schemes.HTTP\n PATH_CLS = HTTPURLInfo\n PARAM_CHECKSUM = \"etag\"\n CAN_TRAVERSE = False\n\n SESSION_RETRIES = 5\n SESSION_BACKOFF_FACTOR = 0.1\n REQUEST_TIMEOUT = 10\n CHUNK_SIZE = 2 ** 16\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_HTTPRemoteTree._auth_method_HTTPRemoteTree._session.return.session": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_HTTPRemoteTree._auth_method_HTTPRemoteTree._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": 55, "end_line": 90, "span_ids": ["HTTPRemoteTree._session", "HTTPRemoteTree._auth_method"], "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 HTTPRemoteTree(BaseRemoteTree):\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_HTTPRemoteTree.request_HTTPRemoteTree.request.try_.except_requests_exception.raise_DvcException_f_coul": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_HTTPRemoteTree.request_HTTPRemoteTree.request.try_.except_requests_exception.raise_DvcException_f_coul", "embedding": null, "metadata": {"file_path": "dvc/remote/http.py", "file_name": "http.py", "file_type": "text/x-python", "category": "implementation", "start_line": 92, "end_line": 122, "span_ids": ["HTTPRemoteTree.request"], "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 HTTPRemoteTree(BaseRemoteTree):\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(f\"could not perform a {method} request\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_HTTPRemoteTree.exists_HTTPRemoteTree.get_file_hash.return.etag": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_HTTPRemoteTree.exists_HTTPRemoteTree.get_file_hash.return.etag", "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": 144, "span_ids": ["HTTPRemoteTree.get_file_hash", "HTTPRemoteTree.exists"], "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": "class HTTPRemoteTree(BaseRemoteTree):\n\n def exists(self, path_info):\n return bool(self.request(\"HEAD\", path_info.url))\n\n def get_file_hash(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/http.py_HTTPRemoteTree._download_HTTPRemoteTree._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_HTTPRemoteTree._download_HTTPRemoteTree._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": 146, "end_line": 162, "span_ids": ["HTTPRemoteTree._download"], "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": "class HTTPRemoteTree(BaseRemoteTree):\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_HTTPRemoteTree._upload_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_HTTPRemoteTree._upload_", "embedding": null, "metadata": {"file_path": "dvc/remote/http.py", "file_name": "http.py", "file_type": "text/x-python", "category": "implementation", "start_line": 164, "end_line": 191, "span_ids": ["HTTPRemoteTree._content_length", "HTTPRemoteTree._upload"], "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 HTTPRemoteTree(BaseRemoteTree):\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)\n\n @staticmethod\n def _content_length(response):\n res = response.headers.get(\"Content-Length\")\n return int(res) if res else 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/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": 8, "span_ids": ["imports", "HTTPSRemoteTree"], "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.scheme import Schemes\n\nfrom .http import HTTPRemoteTree\n\n\nclass HTTPSRemoteTree(HTTPRemoteTree): # pylint:disable=abstract-method\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/remote/local.py_LocalRemoteTree_LocalRemoteTree.symlink.System_symlink_from_info_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_LocalRemoteTree_LocalRemoteTree.symlink.System_symlink_from_info_", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 41, "end_line": 163, "span_ids": ["LocalRemoteTree.move", "LocalRemoteTree.is_empty", "LocalRemoteTree.copy_fobj", "LocalRemoteTree.exists", "LocalRemoteTree.isfile", "LocalRemoteTree.__init__", "LocalRemoteTree.open", "LocalRemoteTree.work_tree", "LocalRemoteTree.makedirs", "LocalRemoteTree.state", "LocalRemoteTree.copy", "LocalRemoteTree.symlink", "LocalRemoteTree.iscopy", "LocalRemoteTree.remove", "LocalRemoteTree", "LocalRemoteTree.isdir", "LocalRemoteTree.walk_files"], "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 LocalRemoteTree(BaseRemoteTree):\n scheme = Schemes.LOCAL\n PATH_CLS = PathInfo\n PARAM_CHECKSUM = \"md5\"\n PARAM_PATH = \"path\"\n TRAVERSE_PREFIX_LEN = 2\n UNPACKED_DIR_SUFFIX = \".unpacked\"\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 url = config.get(\"url\")\n self.path_info = self.PATH_CLS(url) if url else None\n\n @property\n def state(self):\n from dvc.state import StateNoop\n\n return self.repo.state if self.repo else StateNoop()\n\n @cached_property\n def work_tree(self):\n # When using repo.brancher, repo.tree may change to/from WorkingTree to\n # GitTree arbitarily. When repo.tree is GitTree, local cache needs to\n # use its own WorkingTree instance.\n if self.repo:\n return WorkingTree(self.repo.root_dir)\n return None\n\n @staticmethod\n def open(path_info, mode=\"r\", encoding=None):\n return open(path_info, mode=mode, encoding=encoding)\n\n def exists(self, path_info):\n assert isinstance(path_info, str) or path_info.scheme == \"local\"\n if not self.repo:\n return os.path.exists(path_info)\n return self.work_tree.exists(path_info)\n\n def isfile(self, path_info):\n if not self.repo:\n return os.path.isfile(path_info)\n return self.work_tree.isfile(path_info)\n\n def isdir(self, path_info):\n if not self.repo:\n return os.path.isdir(path_info)\n return self.work_tree.isdir(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 def walk_files(self, path_info, **kwargs):\n for fname in self.work_tree.walk_files(path_info):\n yield PathInfo(fname)\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 def remove(self, path_info):\n if isinstance(path_info, PathInfo):\n if path_info.scheme != \"local\":\n raise NotImplementedError\n path = path_info.fspath\n else:\n path = path_info\n\n if self.exists(path):\n remove(path)\n\n def makedirs(self, path_info):\n makedirs(path_info, exist_ok=True, mode=self.dir_mode)\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)\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(tmp_info, self.file_mode)\n os.rename(tmp_info, to_info)\n except Exception:\n self.remove(tmp_info)\n raise\n\n def copy_fobj(self, fobj, to_info):\n self.makedirs(to_info.parent)\n tmp_info = to_info.parent / tmp_fname(to_info.name)\n try:\n copy_fobj_to_file(fobj, tmp_info)\n os.chmod(tmp_info, self.file_mode)\n os.rename(tmp_info, 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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_LocalRemoteTree.is_symlink_LocalRemoteTree.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_LocalRemoteTree.is_symlink_LocalRemoteTree.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": 165, "end_line": 193, "span_ids": ["LocalRemoteTree.is_symlink", "LocalRemoteTree.hardlink"], "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": "class LocalRemoteTree(BaseRemoteTree):\n\n @staticmethod\n def is_symlink(path_info):\n return System.is_symlink(path_info)\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 hash\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/local.py_LocalRemoteTree.is_hardlink_LocalRemoteTree._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_LocalRemoteTree.is_hardlink_LocalRemoteTree._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": 195, "end_line": 227, "span_ids": ["LocalRemoteTree.is_hardlink", "LocalRemoteTree._unprotect_file", "LocalRemoteTree.reflink"], "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 LocalRemoteTree(BaseRemoteTree):\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(tmp_info, self.file_mode)\n os.rename(tmp_info, to_info)\n\n def _unprotect_file(self, path):\n if System.is_symlink(path) or System.is_hardlink(path):\n logger.debug(f\"Unprotecting '{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_LocalRemoteTree._unprotect_dir_LocalRemoteTree.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_LocalRemoteTree._unprotect_dir_LocalRemoteTree.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": 229, "end_line": 263, "span_ids": ["LocalRemoteTree._unprotect_dir", "LocalRemoteTree.protect", "LocalRemoteTree.unprotect"], "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 LocalRemoteTree(BaseRemoteTree):\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(f\"can't unprotect non-existing data '{path}'\")\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 = os.fspath(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_LocalRemoteTree.is_protected_LocalRemoteTree._remove_unpacked_dir.self_remove_path_info_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_LocalRemoteTree.is_protected_LocalRemoteTree._remove_unpacked_dir.self_remove_path_info_", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 265, "end_line": 321, "span_ids": ["LocalRemoteTree.is_protected", "LocalRemoteTree.list_paths", "LocalRemoteTree._download", "LocalRemoteTree._upload", "LocalRemoteTree.get_file_hash", "LocalRemoteTree._remove_unpacked_dir", "LocalRemoteTree.getsize"], "tokens": 395}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LocalRemoteTree(BaseRemoteTree):\n\n def is_protected(self, path_info):\n try:\n mode = os.stat(path_info).st_mode\n except FileNotFoundError:\n return False\n\n return stat.S_IMODE(mode) == self.CACHE_MODE\n\n def get_file_hash(self, path_info):\n return file_md5(path_info)[0]\n\n @staticmethod\n def getsize(path_info):\n return os.path.getsize(path_info)\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\n self.protect(tmp_file)\n os.rename(tmp_file, to_info)\n\n @staticmethod\n def _download(\n 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 def list_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 if not self.exists(path_info):\n return\n else:\n path_info = self.path_info\n # NOTE: use utils.fs walk_files since tree.walk_files will not follow\n # symlinks\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 _remove_unpacked_dir(self, hash_):\n info = self.hash_to_path_info(hash_)\n path_info = info.with_name(info.name + self.UNPACKED_DIR_SUFFIX)\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/oss.py_logging_OSSRemoteTree.__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_OSSRemoteTree.__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": 59, "span_ids": ["OSSRemoteTree", "imports", "OSSRemoteTree.__init__"], "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": "import logging\nimport os\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 BaseRemoteTree\nfrom dvc.scheme import Schemes\n\nlogger = logging.getLogger(__name__)\n\n\nclass OSSRemoteTree(BaseRemoteTree): # pylint:disable=abstract-method\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_OSSRemoteTree.oss_service_OSSRemoteTree.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_OSSRemoteTree.oss_service_OSSRemoteTree.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": ["OSSRemoteTree.oss_service"], "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 OSSRemoteTree(BaseRemoteTree):\n\n @wrap_prop(threading.Lock())\n @cached_property\n def oss_service(self):\n import oss2\n\n logger.debug(f\"URL: {self.path_info}\")\n logger.debug(f\"key id: {self.key_id}\")\n logger.debug(f\"key secret: {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/oss.py_OSSRemoteTree._generate_download_url_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/oss.py_OSSRemoteTree._generate_download_url_", "embedding": null, "metadata": {"file_path": "dvc/remote/oss.py", "file_name": "oss.py", "file_type": "text/x-python", "category": "implementation", "start_line": 85, "end_line": 133, "span_ids": ["OSSRemoteTree.exists", "OSSRemoteTree._generate_download_url", "OSSRemoteTree.remove", "OSSRemoteTree._upload", "OSSRemoteTree._download", "OSSRemoteTree._list_paths", "OSSRemoteTree.walk_files"], "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": "class OSSRemoteTree(BaseRemoteTree):\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)\n return any(path_info.path == path for path in paths)\n\n def _list_paths(self, path_info):\n import oss2\n\n for blob in oss2.ObjectIterator(\n self.oss_service, prefix=path_info.path\n ):\n yield blob.key\n\n def walk_files(self, path_info, **kwargs):\n if not kwargs.pop(\"prefix\", False):\n path_info = path_info / \"\"\n for fname in self._list_paths(path_info):\n if fname.endswith(\"/\"):\n continue\n\n yield path_info.replace(path=fname)\n\n def remove(self, path_info):\n if path_info.scheme != self.scheme:\n raise NotImplementedError\n\n logger.debug(f\"Removing oss://{path_info}\")\n self.oss_service.delete_object(path_info.path)\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 )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_threading_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_threading_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": "import threading\nfrom collections import deque\nfrom contextlib import contextmanager\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": 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": "class Pool:\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_logging_S3RemoteTree.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_logging_S3RemoteTree.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": 86, "span_ids": ["S3RemoteTree", "S3RemoteTree.__init__", "imports", "S3RemoteTree.get_etag", "S3RemoteTree.get_head_object", "S3RemoteTree.s3"], "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": "import logging\nimport os\nimport threading\n\nfrom funcy import cached_property, wrap_prop\n\nfrom dvc.config import ConfigError\nfrom dvc.exceptions import DvcException, ETagMismatchError\nfrom dvc.path_info import CloudURLInfo\nfrom dvc.progress import Tqdm\nfrom dvc.remote.base import BaseRemoteTree\nfrom dvc.scheme import Schemes\n\nlogger = logging.getLogger(__name__)\n\n\nclass S3RemoteTree(BaseRemoteTree):\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.sse_kms_key_id = config.get(\"sse_kms_key_id\")\n if self.sse_kms_key_id:\n self.extra_args[\"SSEKMSKeyId\"] = self.sse_kms_key_id\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 @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(f\"s3://{bucket}/{path} does not exist\") 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_S3RemoteTree._append_aws_grants_to_extra_args_S3RemoteTree._append_aws_grants_to_extra_args.for_grant_option_extra_a.if_config_get_grant_optio.self_extra_args_extra_arg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_S3RemoteTree._append_aws_grants_to_extra_args_S3RemoteTree._append_aws_grants_to_extra_args.for_grant_option_extra_a.if_config_get_grant_optio.self_extra_args_extra_arg", "embedding": null, "metadata": {"file_path": "dvc/remote/s3.py", "file_name": "s3.py", "file_type": "text/x-python", "category": "implementation", "start_line": 88, "end_line": 117, "span_ids": ["S3RemoteTree._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 S3RemoteTree(BaseRemoteTree):\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/s3.py_S3RemoteTree._generate_download_url_S3RemoteTree.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/s3.py_S3RemoteTree._generate_download_url_S3RemoteTree.exists.return.self_isfile_path_info_or", "embedding": null, "metadata": {"file_path": "dvc/remote/s3.py", "file_name": "s3.py", "file_type": "text/x-python", "category": "implementation", "start_line": 119, "end_line": 131, "span_ids": ["S3RemoteTree.exists", "S3RemoteTree._generate_download_url"], "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 S3RemoteTree(BaseRemoteTree):\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 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/s3.py_S3RemoteTree.isdir_S3RemoteTree.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_S3RemoteTree.isdir_S3RemoteTree.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": 133, "end_line": 155, "span_ids": ["S3RemoteTree.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 S3RemoteTree(BaseRemoteTree):\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_S3RemoteTree.isfile_S3RemoteTree.copy.self__copy_self_s3_from_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_S3RemoteTree.isfile_S3RemoteTree.copy.self__copy_self_s3_from_", "embedding": null, "metadata": {"file_path": "dvc/remote/s3.py", "file_name": "s3.py", "file_type": "text/x-python", "category": "implementation", "start_line": 157, "end_line": 218, "span_ids": ["S3RemoteTree.makedirs", "S3RemoteTree._list_objects", "S3RemoteTree.copy", "S3RemoteTree.walk_files", "S3RemoteTree.isfile", "S3RemoteTree.remove", "S3RemoteTree._list_paths"], "tokens": 467}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class S3RemoteTree(BaseRemoteTree):\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 _list_objects(self, path_info, max_items=None):\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 paginator = self.s3.get_paginator(self.list_objects_api)\n for page in paginator.paginate(**kwargs):\n contents = page.get(\"Contents\", ())\n yield from contents\n\n def _list_paths(self, path_info, max_items=None):\n return (\n item[\"Key\"] for item in self._list_objects(path_info, max_items)\n )\n\n def walk_files(self, path_info, **kwargs):\n if not kwargs.pop(\"prefix\", False):\n path_info = path_info / \"\"\n for fname in self._list_paths(path_info, **kwargs):\n if fname.endswith(\"/\"):\n continue\n\n yield path_info.replace(path=fname)\n\n def remove(self, path_info):\n if path_info.scheme != \"s3\":\n raise NotImplementedError\n\n logger.debug(f\"Removing {path_info}\")\n self.s3.delete_object(Bucket=path_info.bucket, Key=path_info.path)\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=\"\")\n\n def copy(self, from_info, to_info):\n self._copy(self.s3, from_info, to_info, self.extra_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/remote/s3.py_S3RemoteTree._copy_multipart_S3RemoteTree._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_S3RemoteTree._copy_multipart_S3RemoteTree._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": 220, "end_line": 262, "span_ids": ["S3RemoteTree._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 S3RemoteTree(BaseRemoteTree):\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 = S3RemoteTree.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 = f\"bytes={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_S3RemoteTree._copy_S3RemoteTree._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_S3RemoteTree._copy_S3RemoteTree._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": 264, "end_line": 311, "span_ids": ["S3RemoteTree._copy"], "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": "class S3RemoteTree(BaseRemoteTree):\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 = S3RemoteTree.get_head_object(\n s3, from_info.bucket, from_info.path\n )\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 = S3RemoteTree.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/s3.py_S3RemoteTree.get_file_hash_S3RemoteTree._upload.with_Tqdm_.self_s3_upload_file_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_S3RemoteTree.get_file_hash_S3RemoteTree._upload.with_Tqdm_.self_s3_upload_file_", "embedding": null, "metadata": {"file_path": "dvc/remote/s3.py", "file_name": "s3.py", "file_type": "text/x-python", "category": "implementation", "start_line": 313, "end_line": 327, "span_ids": ["S3RemoteTree._upload", "S3RemoteTree.get_file_hash"], "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 S3RemoteTree(BaseRemoteTree):\n\n def get_file_hash(self, path_info):\n return self.get_etag(self.s3, path_info.bucket, path_info.path)\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 )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_S3RemoteTree._download_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_S3RemoteTree._download_", "embedding": null, "metadata": {"file_path": "dvc/remote/s3.py", "file_name": "s3.py", "file_type": "text/x-python", "category": "implementation", "start_line": 329, "end_line": 342, "span_ids": ["S3RemoteTree._download"], "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 S3RemoteTree(BaseRemoteTree):\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 )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": 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 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 first, memoize, silent, wrap_with\n\nimport dvc.prompt as prompt\nfrom dvc.progress import Tqdm\nfrom dvc.remote.base import BaseRemoteTree, Remote\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_SSHRemoteTree_SSHRemoteTree.ssh.return.get_connection_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_SSHRemoteTree_SSHRemoteTree.ssh.return.get_connection_", "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": 149, "span_ids": ["SSHRemoteTree.__init__", "SSHRemoteTree._load_user_ssh_config", "SSHRemoteTree.ensure_credentials", "SSHRemoteTree.ssh", "SSHRemoteTree._try_get_ssh_config_keyfile", "SSHRemoteTree._try_get_ssh_config_port", "SSHRemoteTree.ssh_config_filename", "SSHRemoteTree"], "tokens": 811}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SSHRemoteTree(BaseRemoteTree):\n scheme = Schemes.SSH\n REQUIRES = {\"paramiko\": \"paramiko\"}\n JOBS = 4\n\n PARAM_CHECKSUM = \"md5\"\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 DEFAULT_CACHE_TYPES = [\"copy\"]\n TRAVERSE_PREFIX_LEN = 2\n\n DEFAULT_PORT = 22\n TIMEOUT = 1800\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 = SSHRemoteTree.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 )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_SSHRemoteTree.open_SSHRemoteTree.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_SSHRemoteTree.open_SSHRemoteTree.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": 151, "end_line": 211, "span_ids": ["SSHRemoteTree.open", "SSHRemoteTree.remove", "SSHRemoteTree.isdir", "SSHRemoteTree.copy", "SSHRemoteTree.symlink", "SSHRemoteTree.makedirs", "SSHRemoteTree.walk_files", "SSHRemoteTree.isfile", "SSHRemoteTree.exists", "SSHRemoteTree.move"], "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 SSHRemoteTree(BaseRemoteTree):\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 exists(self, path_info):\n with self.ssh(path_info) as ssh:\n return ssh.exists(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 walk_files(self, path_info, **kwargs):\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 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 makedirs(self, path_info):\n with self.ssh(path_info) as ssh:\n ssh.makedirs(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 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/dvc/remote/ssh/__init__.py_SSHRemoteTree.hardlink_SSHRemoteTree.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_SSHRemoteTree.hardlink_SSHRemoteTree.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": 213, "end_line": 231, "span_ids": ["SSHRemoteTree.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 SSHRemoteTree(BaseRemoteTree):\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_SSHRemoteTree.reflink_SSHRemoteTree.list_paths.with_self_ssh_self_path_i.if_progress_callback_.else_.yield_from_ssh_walk_files": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_SSHRemoteTree.reflink_SSHRemoteTree.list_paths.with_self_ssh_self_path_i.if_progress_callback_.else_.yield_from_ssh_walk_files", "embedding": null, "metadata": {"file_path": "dvc/remote/ssh/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 233, "end_line": 285, "span_ids": ["SSHRemoteTree.list_paths", "SSHRemoteTree._upload", "SSHRemoteTree.getsize", "SSHRemoteTree.get_file_hash", "SSHRemoteTree.reflink", "SSHRemoteTree._download"], "tokens": 389}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SSHRemoteTree(BaseRemoteTree):\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 get_file_hash(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 getsize(self, path_info):\n with self.ssh(path_info) as ssh:\n return ssh.getsize(path_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 def list_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 prefix and not ssh.exists(root):\n return\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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_SSHRemote_SSHRemote.batch_exists.with_self_tree_ssh_path_i.return.results": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_SSHRemote_SSHRemote.batch_exists.with_self_tree_ssh_path_i.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": 288, "end_line": 315, "span_ids": ["SSHRemote", "SSHRemote.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 SSHRemote(Remote):\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 OSError as exc:\n if exc.errno != errno.ENOENT:\n raise\n ret.append(False)\n callback(path)\n return ret\n\n with self.tree.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/__init__.py_SSHRemote.hashes_exist_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_SSHRemote.hashes_exist_", "embedding": null, "metadata": {"file_path": "dvc/remote/ssh/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 317, "end_line": 348, "span_ids": ["SSHRemote.hashes_exist"], "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": "class SSHRemote(Remote):\n\n def hashes_exist(self, hashes, 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.tree.CAN_TRAVERSE:\n return list(set(hashes) & set(self.tree.all()))\n\n # possibly prompt for credentials before \"Querying\" progress output\n self.tree.ensure_credentials()\n\n with Tqdm(\n desc=\"Querying \"\n + (\"cache in \" + name if name else \"remote cache\"),\n total=len(hashes),\n unit=\"file\",\n ) as pbar:\n\n def exists_with_progress(chunks):\n return self.batch_exists(chunks, callback=pbar.update_msg)\n\n with ThreadPoolExecutor(\n max_workers=jobs or self.tree.JOBS\n ) as executor:\n path_infos = [self.hash_to_path_info(x) for x in hashes]\n chunks = to_chunks(path_infos, num_chunks=self.tree.JOBS)\n results = executor.map(exists_with_progress, chunks)\n in_remote = itertools.chain.from_iterable(results)\n ret = list(itertools.compress(hashes, 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_format_num_": {"__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_format_num_", "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": 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 errno\nimport logging\nimport os\nimport posixpath\nimport stat\nfrom contextlib import suppress\n\nfrom funcy import cached_property\n\nfrom dvc.exceptions import DvcException\nfrom dvc.progress import Tqdm\nfrom dvc.remote.base import RemoteCmdError\nfrom dvc.utils import tmp_fname\n\ntry:\n import paramiko\nexcept ImportError:\n paramiko = None\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 f\"{num:3.1f}{unit}{suffix}\"\n num /= 1024.0\n return \"{:.1f}{}{}\".format(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_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": 92, "span_ids": ["SSHConnection.sftp", "SSHConnection.isfile", "SSHConnection", "SSHConnection.islink", "SSHConnection.getsize", "SSHConnection.exists", "SSHConnection.__init__", "SSHConnection.isdir", "SSHConnection.st_mode", "SSHConnection.close"], "tokens": 441}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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\n # Explicitly disable paramiko logger. Due to how paramiko dynamically\n # loads loggers, it is not disabled by DVC disable_other_loggers().\n # See https://github.com/iterative/dvc/issues/3482\n self._ssh.set_log_channel(\"dvc.paramiko\")\n logging.getLogger(\"dvc.paramiko\").disabled = True\n logging.getLogger(\"dvc.paramiko.sftp\").disabled = True\n\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):\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/remote/ssh/connection.py_SSHConnection.makedirs_SSHConnection.makedirs.if_tail_.try_.except_OSError_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_OSError_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": 94, "end_line": 120, "span_ids": ["SSHConnection.makedirs"], "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": "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 f\"a file with the same name '{path}' already exists\"\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 OSError 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 f\"unable to create remote directory '{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_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": 122, "end_line": 153, "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 OSError 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/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": 155, "end_line": 224, "span_ids": ["SSHConnection.download", "SSHConnection.walk_files", "SSHConnection.upload", "SSHConnection._remove_dir", "SSHConnection.move", "SSHConnection._remove_file", "SSHConnection.atomic_copy", "SSHConnection.remove"], "tokens": 480}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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, _, 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.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": 226, "end_line": 277, "span_ids": ["SSHConnection.execute"], "tokens": 302}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 selectors\n\n selector = selectors.DefaultSelector()\n selector.register(stdout.channel, selectors.EVENT_READ)\n\n got_chunk = False\n events = selector.select(self.timeout)\n for key, _ in events:\n c = key.fileobj\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/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": 279, "end_line": 303, "span_ids": ["SSHConnection.uname", "SSHConnection.md5"], "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 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 f\"'{self.uname}' is not supported as a SSH remote\"\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": 305, "end_line": 337, "span_ids": ["SSHConnection.symlink", "SSHConnection.reflink", "SSHConnection.copy", "SSHConnection.open", "SSHConnection.open_max_sftp_channels", "SSHConnection.hardlink"], "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": "class SSHConnection:\n\n def copy(self, src, dest):\n self.execute(f\"cp {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(f\"cp --reflink {src} {dest}\")\n\n if self.uname == \"Darwin\":\n return self.execute(f\"cp -c {src} {dest}\")\n\n raise DvcException(f\"'{self.uname}' is not supported as a SSH remote\")\n\n def hardlink(self, src, dest):\n self.execute(f\"ln {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/tree.py_logging_DvcTree._get_granular_checksum.raise_FileNotFoundError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tree.py_logging_DvcTree._get_granular_checksum.raise_FileNotFoundError", "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": 56, "span_ids": ["DvcTree.__init__", "imports", "DvcTree._find_outs", "DvcTree._get_granular_checksum", "DvcTree"], "tokens": 414}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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.dvcfile import is_valid_filename\nfrom dvc.exceptions import OutputNotFoundError\nfrom dvc.path_info import PathInfo\nfrom dvc.remote.base import RemoteActionNotImplemented\nfrom dvc.scm.tree import BaseTree\nfrom dvc.utils import file_md5\nfrom dvc.utils.fs import copy_fobj_to_file, makedirs\n\nlogger = logging.getLogger(__name__)\n\n\nclass DvcTree(BaseTree):\n \"\"\"DVC repo tree.\n\n Args:\n repo: DVC repo.\n fetch: if True, uncached DVC outs will be fetched on `open()`.\n stream: if True, uncached DVC outs will be streamed directly from\n remote on `open()`.\n\n `stream` takes precedence over `fetch`. If `stream` is enabled and\n a remote does not support streaming, uncached DVC outs will be fetched\n as a fallback.\n \"\"\"\n\n def __init__(self, repo, fetch=False, stream=False):\n self.repo = repo\n self.fetch = fetch\n self.stream = stream\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 _get_granular_checksum(self, path, out, remote=None):\n if not self.fetch and not self.stream:\n raise FileNotFoundError\n dir_cache = out.get_dir_cache(remote=remote)\n for entry in dir_cache:\n entry_relpath = entry[out.remote.tree.PARAM_RELPATH]\n if os.name == \"nt\":\n entry_relpath = entry_relpath.replace(\"/\", os.sep)\n if path == out.path_info / entry_relpath:\n return entry[out.remote.tree.PARAM_CHECKSUM]\n raise FileNotFoundError", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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 = f\"No such file in branch '{self.rev}'\"\n raise OSError(errno.ENOENT, msg, relative_path)\n if obj.mode == GIT_MODE_DIR:\n raise OSError(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/scm/tree.py_os_BaseTree.walk_files.for_root___files_in_sel.for_file_in_files_.yield_f_root_os_sep_fi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/tree.py_os_BaseTree.walk_files.for_root___files_in_sel.for_file_in_files_.yield_f_root_os_sep_fi", "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": 38, "span_ids": ["BaseTree.open", "imports", "BaseTree.tree_root", "BaseTree.exists", "BaseTree.isdir", "BaseTree.walk_files", "BaseTree", "BaseTree.isfile", "BaseTree.walk"], "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": "import os\nimport stat\nfrom multiprocessing import cpu_count\n\nfrom funcy import cached_property\n\n\nclass BaseTree:\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, onerror=None):\n \"\"\"Directory tree generator.\n\n See `os.walk` for the docs. Differences:\n - no support for symlinks\n \"\"\"\n\n def walk_files(self, top):\n for root, _, files in self.walk(top):\n for file in files:\n # NOTE: os.path.join is ~5.5 times slower\n yield f\"{root}{os.sep}{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/scm/tree.py_WorkingTree_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/tree.py_WorkingTree_", "embedding": null, "metadata": {"file_path": "dvc/scm/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 41, "end_line": 98, "span_ids": ["WorkingTree.__init__", "WorkingTree.tree_root", "WorkingTree.walk", "WorkingTree.isexec", "WorkingTree.hash_jobs", "WorkingTree.isdir", "WorkingTree.stat", "WorkingTree", "is_working_tree", "WorkingTree.exists", "WorkingTree.isfile", "WorkingTree.open"], "tokens": 392}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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=None):\n repo_root = repo_root or 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 if \"b\" in mode:\n encoding = None\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)\n\n def walk(self, top, topdown=True, onerror=None):\n \"\"\"Directory tree generator.\n\n See `os.walk` for the docs. Differences:\n - no support for symlinks\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 @staticmethod\n def stat(path):\n return os.stat(path)\n\n @cached_property\n def hash_jobs(self):\n return max(1, min(4, cpu_count() // 2))\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/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": 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": "import pytest\n\nfrom dvc.dvcfile import PIPELINE_FILE\nfrom dvc.stage.exceptions import StageCommitError\nfrom dvc.utils.yaml import dump_yaml, load_yaml\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_ignore.py_os_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_os_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": 35, "span_ids": ["imports", "test_ignore_unicode", "test_ignore"], "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": "import os\nimport shutil\n\nimport pytest\n\nfrom dvc.exceptions import DvcIgnoreInCollectedDirError\nfrom dvc.ignore import (\n DvcIgnore,\n DvcIgnoreDirs,\n DvcIgnorePatterns,\n DvcIgnoreRepo,\n)\nfrom dvc.repo import Repo\nfrom dvc.scm.tree import WorkingTree\nfrom dvc.utils import relpath\nfrom dvc.utils.fs import get_mtime_and_size\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_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": 50, "end_line": 86, "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__files_set_test_ignore_external.assert_result_y_back": {"__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_ignore_external.assert_result_y_back", "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": 151, "span_ids": ["test_ignore_external", "_files_set", "test_match_nested"], "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 _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 result = {os.fspath(os.path.normpath(f)) for f in dvc.tree.walk_files(\".\")}\n assert result == {\".dvcignore\", \"foo\"}\n\n\ndef test_ignore_external(tmp_dir, scm, dvc, tmp_path_factory):\n tmp_dir.gen(\".dvcignore\", \"*.backup\\ntmp\")\n ext_dir = TmpDir(os.fspath(tmp_path_factory.mktemp(\"external_dir\")))\n ext_dir.gen({\"y.backup\": \"y\", \"tmp\": \"ext tmp\"})\n\n result = {relpath(f, ext_dir) for f in dvc.tree.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_ignore.py_test_ignore_subrepo_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ignore.py_test_ignore_subrepo_", "embedding": null, "metadata": {"file_path": "tests/func/test_ignore.py", "file_name": "test_ignore.py", "file_type": "text/x-python", "category": "test", "start_line": 154, "end_line": 176, "span_ids": ["test_ignore_blank_line", "test_ignore_subrepo"], "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_ignore_subrepo(tmp_dir, scm, dvc):\n tmp_dir.gen({\".dvcignore\": \"foo\", \"subdir\": {\"foo\": \"foo\"}})\n scm.add([\".dvcignore\"])\n scm.commit(\"init parent dvcignore\")\n\n subrepo_dir = tmp_dir / \"subdir\"\n assert not dvc.tree.exists(subrepo_dir / \"foo\")\n\n with subrepo_dir.chdir():\n subrepo = Repo.init(subdir=True)\n scm.add(str(subrepo_dir / \"foo\"))\n scm.commit(\"subrepo init\")\n\n for _ in subrepo.brancher(all_commits=True):\n assert subrepo.tree.exists(subrepo_dir / \"foo\")\n\n\ndef test_ignore_blank_line(tmp_dir, dvc):\n tmp_dir.gen({\"dir\": {\"ignored\": \"text\", \"other\": \"text2\"}})\n tmp_dir.gen(DvcIgnore.DVCIGNORE_FILE, \"foo\\n\\ndir/ignored\")\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_ls.py_test_ls_granular_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ls.py_test_ls_granular_", "embedding": null, "metadata": {"file_path": "tests/func/test_ls.py", "file_name": "test_ls.py", "file_type": "text/x-python", "category": "test", "start_line": 450, "end_line": 475, "span_ids": ["test_ls_granular"], "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_ls_granular(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 entries = Repo.ls(os.fspath(erepo_dir), os.path.join(\"dir\", \"subdir\"))\n assert entries == [\n {\"isout\": False, \"isdir\": False, \"isexec\": False, \"path\": \"bar\"},\n {\"isout\": False, \"isdir\": False, \"isexec\": False, \"path\": \"foo\"},\n ]\n\n entries = Repo.ls(os.fspath(erepo_dir), \"dir\")\n assert entries == [\n {\"isout\": False, \"isdir\": False, \"isexec\": False, \"path\": \"1\"},\n {\"isout\": False, \"isdir\": False, \"isexec\": False, \"path\": \"2\"},\n {\"isout\": False, \"isdir\": True, \"isexec\": False, \"path\": \"subdir\"},\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_os_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_os_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": 39, "span_ids": ["TestWorkingTree.test_isdir", "imports", "TestWorkingTree.test_open", "TestWorkingTree", "TestWorkingTree.test_exists", "TestWorkingTree.setUp", "TestWorkingTree.test_isfile"], "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\nfrom os.path import join\n\nfrom dvc.ignore import CleanTree\nfrom dvc.path_info import PathInfo\nfrom dvc.repo import Repo\nfrom dvc.repo.tree import RepoTree\nfrom dvc.scm import SCM\nfrom dvc.scm.git import GitTree\nfrom dvc.scm.tree import WorkingTree\nfrom dvc.utils.fs import remove\nfrom tests.basic_env import TestDir, TestGit, 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/remotes/__init__.py_pytest_remote.yield_cloud": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/__init__.py_pytest_remote.yield_cloud", "embedding": null, "metadata": {"file_path": "tests/remotes/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 43, "span_ids": ["imports", "remote"], "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": "import pytest\n\nfrom .azure import Azure, azure # noqa: F401\nfrom .hdfs import HDFS, hdfs # noqa: F401\nfrom .http import HTTP, http, http_server # noqa: F401\nfrom .local import Local, local_cloud, local_remote # noqa: F401\nfrom .oss import OSS, TEST_OSS_REPO_BUCKET, oss # noqa: F401\nfrom .s3 import S3, TEST_AWS_REPO_BUCKET, real_s3, s3 # noqa: F401\n\nTEST_REMOTE = \"upstream\"\nTEST_CONFIG = {\n \"cache\": {},\n \"core\": {\"remote\": TEST_REMOTE},\n \"remote\": {TEST_REMOTE: {\"url\": \"\"}},\n}\n\n\nfrom .gdrive import ( # noqa: F401; noqa: F401\n TEST_GDRIVE_REPO_BUCKET,\n GDrive,\n gdrive,\n)\nfrom .gs import ( # noqa: F401; noqa: F401\n GCP,\n TEST_GCP_CREDS_FILE,\n TEST_GCP_REPO_BUCKET,\n gs,\n)\nfrom .ssh import ( # noqa: F401; noqa: F401\n SSH,\n SSHMocked,\n ssh,\n ssh_connection,\n ssh_server,\n)\n\n\n@pytest.fixture\ndef remote(tmp_dir, dvc, request):\n cloud = request.param\n assert cloud\n tmp_dir.add_remote(config=cloud.config)\n yield 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/remotes/__init__.py_workspace_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/__init__.py_workspace_", "embedding": null, "metadata": {"file_path": "tests/remotes/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 46, "end_line": 67, "span_ids": ["workspace"], "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": "@pytest.fixture\ndef workspace(tmp_dir, dvc, request):\n from dvc.cache import Cache\n\n cloud = request.param\n\n assert cloud\n\n tmp_dir.add_remote(name=\"workspace\", config=cloud.config, default=False)\n tmp_dir.add_remote(\n name=\"cache\", url=\"remote://workspace/cache\", default=False\n )\n\n scheme = getattr(cloud, \"scheme\", \"local\")\n if scheme != \"http\":\n with dvc.config.edit() as conf:\n conf[\"cache\"][scheme] = \"cache\"\n\n dvc.cache = Cache(dvc)\n\n return 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/remotes/azure.py__pylint_disable_abstract_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/azure.py__pylint_disable_abstract_", "embedding": null, "metadata": {"file_path": "tests/remotes/azure.py", "file_name": "azure.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 37, "span_ids": ["Azure.should_test", "Azure", "Azure.get_url", "azure", "docstring"], "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": "# pylint:disable=abstract-method\n\nimport os\nimport uuid\n\nimport pytest\n\nfrom dvc.path_info import CloudURLInfo\nfrom dvc.utils import env2bool\n\nfrom .base import Base\n\n\nclass Azure(Base, CloudURLInfo):\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()))\n\n\n@pytest.fixture\ndef azure():\n if not Azure.should_test():\n pytest.skip(\"no azure running\")\n yield Azure(Azure.get_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/hdfs.py_getpass_HDFS.should_test.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/hdfs.py_getpass_HDFS.should_test.return.True", "embedding": null, "metadata": {"file_path": "tests/remotes/hdfs.py", "file_name": "hdfs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 42, "span_ids": ["imports", "HDFS", "HDFS.should_test"], "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": "import getpass\nimport locale\nimport os\nimport platform\nfrom contextlib import contextmanager\nfrom subprocess import CalledProcessError, Popen, check_output\n\nimport pytest\n\nfrom dvc.path_info import URLInfo\n\nfrom .base import Base\nfrom .local import Local\n\n\nclass HDFS(Base, URLInfo):\n @staticmethod\n def should_test():\n if platform.system() != \"Linux\":\n return False\n\n try:\n # pylint: disable=unexpected-keyword-arg\n # see: https://github.com/PyCQA/pylint/issues/3645\n check_output(\n [\"hadoop\", \"version\"],\n shell=True,\n executable=os.getenv(\"SHELL\"),\n )\n except (CalledProcessError, OSError):\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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/hdfs.py_HDFS.get_url_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/remotes/hdfs.py_HDFS.get_url_", "embedding": null, "metadata": {"file_path": "tests/remotes/hdfs.py", "file_name": "hdfs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 44, "end_line": 111, "span_ids": ["HDFS.exists", "HDFS.get_url", "HDFS.write_text", "HDFS.read_text", "HDFS.read_bytes", "HDFS.is_file", "hdfs", "HDFS.is_dir", "HDFS.mkdir", "HDFS.write_bytes", "HDFS._hdfs"], "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": "class HDFS(Base, URLInfo):\n\n @staticmethod\n def get_url():\n return \"hdfs://{}@127.0.0.1{}\".format(\n getpass.getuser(), Local.get_storagepath()\n )\n\n @contextmanager\n def _hdfs(self):\n import pyarrow\n\n conn = pyarrow.hdfs.connect()\n try:\n yield conn\n finally:\n conn.close()\n\n def is_file(self):\n with self._hdfs() as _hdfs:\n return _hdfs.isfile(self.path)\n\n def is_dir(self):\n with self._hdfs() as _hdfs:\n return _hdfs.isfile(self.path)\n\n def exists(self):\n with self._hdfs() as _hdfs:\n return _hdfs.exists(self.path)\n\n def mkdir(self, mode=0o777, parents=False, exist_ok=False):\n assert mode == 0o777\n assert parents\n assert not exist_ok\n\n with self._hdfs() as _hdfs:\n # NOTE: hdfs.mkdir always creates parents\n _hdfs.mkdir(self.path)\n\n def write_bytes(self, contents):\n with self._hdfs() as _hdfs:\n # NOTE: hdfs.open only supports 'rb', 'wb' or 'ab'\n with _hdfs.open(self.path, \"wb\") as fobj:\n fobj.write(contents)\n\n def write_text(self, contents, encoding=None, errors=None):\n if not encoding:\n encoding = locale.getpreferredencoding(False)\n assert errors is None\n self.write_bytes(contents.encode(encoding))\n\n def read_bytes(self):\n with self._hdfs() as _hdfs:\n # NOTE: hdfs.open only supports 'rb', 'wb' or 'ab'\n with _hdfs.open(self.path, \"rb\") as fobj:\n return fobj.read()\n\n def read_text(self, encoding=None, errors=None):\n if not encoding:\n encoding = locale.getpreferredencoding(False)\n assert errors is None\n return self.read_bytes().decode(encoding)\n\n\n@pytest.fixture\ndef hdfs():\n if not HDFS.should_test():\n pytest.skip(\"no hadoop running\")\n yield HDFS(HDFS.get_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/ssh.py_getpass_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/ssh.py_getpass_SSH.get_url.return._ssh_127_0_0_1_22_", "embedding": null, "metadata": {"file_path": "tests/remotes/ssh.py", "file_name": "ssh.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 44, "span_ids": ["SSH.get_url", "imports", "SSH.should_test", "SSH"], "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": "import getpass\nimport locale\nimport os\nfrom contextlib import contextmanager\nfrom subprocess import CalledProcessError, check_output\n\nimport pytest\nfrom funcy import cached_property\n\nfrom dvc.path_info import URLInfo\nfrom dvc.utils import env2bool\n\nfrom .base import Base\nfrom .local import Local\n\nTEST_SSH_USER = \"user\"\nTEST_SSH_KEY_PATH = os.path.join(\n os.path.abspath(os.path.dirname(__file__)), f\"{TEST_SSH_USER}.key\"\n)\n\n\nclass 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, OSError):\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/ssh.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/ssh.py_SSHMocked_SSHMocked.get_url.return.url", "embedding": null, "metadata": {"file_path": "tests/remotes/ssh.py", "file_name": "ssh.py", "file_type": "text/x-python", "category": "implementation", "start_line": 47, "end_line": 67, "span_ids": ["SSHMocked", "SSHMocked.get_url"], "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 SSHMocked(Base, URLInfo):\n @staticmethod\n def get_url(user, port): # pylint: disable=arguments-differ\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 = f\"ssh://{user}@127.0.0.1:{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/unit/dependency/test_params.py_test_params_error_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_params.py_test_params_error_", "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": 47, "end_line": 110, "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_params_error", "test_read_params_unsupported_format", "test_save_info_missing_config", "test_loadd_from"], "tokens": 510}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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(\"params\", [[3], [{\"b_file\": \"cat\"}]])\ndef test_params_error(dvc, params):\n with pytest.raises(ValueError):\n loads_params(Stage(dvc), params)\n\n\ndef 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], ParamsDependency)\n assert deps[0].def_path == ParamsDependency.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 = ParamsDependency(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 = ParamsDependency(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 = ParamsDependency(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 = ParamsDependency(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 = ParamsDependency(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 = ParamsDependency(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 = ParamsDependency(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/remote/test_azure.py_pytest_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_azure.py_pytest_", "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": 49, "span_ids": ["test_init", "imports", "test_get_file_hash", "test_init_env_var"], "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": "import pytest\n\nfrom dvc.path_info import PathInfo\nfrom dvc.remote.azure import AzureRemoteTree\nfrom tests.remotes import Azure\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_env_var(monkeypatch, dvc):\n monkeypatch.setenv(\"AZURE_STORAGE_CONTAINER_NAME\", container_name)\n monkeypatch.setenv(\"AZURE_STORAGE_CONNECTION_STRING\", connection_string)\n\n config = {\"url\": \"azure://\"}\n tree = AzureRemoteTree(dvc, config)\n assert tree.path_info == \"azure://\" + container_name\n assert tree._conn_kwargs[\"connection_string\"] == connection_string\n\n\ndef test_init(dvc):\n prefix = \"some/prefix\"\n url = f\"azure://{container_name}/{prefix}\"\n config = {\"url\": url, \"connection_string\": connection_string}\n tree = AzureRemoteTree(dvc, config)\n assert tree.path_info == url\n assert tree._conn_kwargs[\"connection_string\"] == connection_string\n\n\ndef test_get_file_hash(tmp_dir):\n if not Azure.should_test():\n pytest.skip(\"no azurite running\")\n\n tmp_dir.gen(\"foo\", \"foo\")\n\n tree = AzureRemoteTree(None, {})\n to_info = tree.PATH_CLS(Azure.get_url())\n tree.upload(PathInfo(\"foo\"), to_info)\n assert tree.exists(to_info)\n hash_ = tree.get_file_hash(to_info)\n assert hash_\n assert isinstance(hash_, str)\n assert hash_.strip(\"'\").strip('\"') == hash_", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": 23, "span_ids": ["test_init", "imports"], "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": "from dvc.remote.oss import OSSRemoteTree\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 = f\"oss://{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 tree = OSSRemoteTree(dvc, config)\n assert tree.path_info == url\n assert tree.endpoint == endpoint\n assert tree.key_id == key_id\n assert tree.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/tests/unit/remote/test_remote_tree.py_test_walk_files_test_walk_files.assert_list_remote_tree_w": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_remote_tree.py_test_walk_files_test_walk_files.assert_list_remote_tree_w", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_remote_tree.py", "file_name": "test_remote_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 72, "end_line": 84, "span_ids": ["test_walk_files"], "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.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.tree.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/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": 105, "end_line": 130, "span_ids": ["test_skip_graph_checks"], "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": "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\", single_stage=True)\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\", single_stage=True)\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\", single_stage=True)\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/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": 32, "span_ids": ["imports", "mock_dvcignore", "test_ignore_from_file_should_filter_dirs_and_files"], "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": "import os\n\nimport pytest\nfrom mock import MagicMock, mock_open, patch\n\nfrom dvc.ignore import DvcIgnoreDirs, 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_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": 35, "end_line": 88, "span_ids": ["test_match_ignore_from_file"], "tokens": 366}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 ],\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": 91, "end_line": 117, "span_ids": ["test_ignore_order", "test_should_ignore_dir"], "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.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\"}\n\n\ndef test_ignore_order():\n dvcignore_path = os.path.join(os.path.sep, \"ignore_order\", \".dvcignore\")\n\n patterns = [\"!ac*\", \"a*\", \"!ab*\"]\n\n root = os.path.dirname(dvcignore_path)\n dirs = [\"ignore_order\"]\n files = [\"ac\", \"ab\", \"aa\"]\n\n ignore = mock_dvcignore(dvcignore_path, patterns)\n _, new_files = ignore(root, dirs, files)\n\n assert {\"ab\"} == 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"}}} \ No newline at end of file