{"docstore/metadata": {"/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/__init__.py____update_version_file.return.ver": {"doc_hash": "34892d943ec9f27b0313d060d5cf743e7f15fe20c624b9ce429a87e7a53e972e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/__init__.py__remove_version_file_": {"doc_hash": "9da285fda8afd06803a21a23bdaa1291198a542bed71a05e05169dd787198060"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/__main__.py__": {"doc_hash": "97c65f7899e6226c89c19045be8bf6a43b05cd9beaf079b8de29ee4c20a3d22d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/analytics.py__Collect_and_send_usage_Analytics._collect_linux.return.info": {"doc_hash": "aeea53ea98c2727ed76a7d6d84eff3fff8d9eb564881a847f19b32001f1b1474"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/analytics.py_Analytics._collect_system_info_Analytics.collect.try_.except_NotDvcRepoError_.pass": {"doc_hash": "4edfd3603531ff4aee413b0437a5b48c4a15e01b8350b743010b471e2eb33ae4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/analytics.py_Analytics._is_enabled_Analytics._is_enabled.return.enabled": {"doc_hash": "d6b1bcdc0817dfaeb17a82a3c7c7172ad798e9dd6656f768e27ce3b00cfe3792"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/analytics.py_Analytics.send_cmd_": {"doc_hash": "999261eb92b0e46fa90bc5b3769bc4e7e731e09e5cf7c2d46e6caa712d11476c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cache.py__Manages_cache_of_a_dvc_": {"doc_hash": "b860ab2a2250cbdd385373fde2db1925dbeaae67a1f087efd3793637e2b0267c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cli.py__Command_line_interface_VersionAction.__call__.sys_exit_0_": {"doc_hash": "082477dfec65b79a480e18336ce4c9793a5ff7ed41d079f080ab080288997b6d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cli.py_get_parent_parser_get_parent_parser.return.parent_parser": {"doc_hash": "4370871e5863de968c8d9b09abe46e518060f4923dc7179e295972a518840d8c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cli.py_parse_args_": {"doc_hash": "8c975a84ee2a01f52bdc35968206cdb02d6ce581b972fe488aaf67fc59394cd8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/base.py_CmdBase_": {"doc_hash": "19fd9381c5f45249ba8da902155dc4ab0bd4510c677172aca3d56fbb3e06e38e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/cache.py_from___future___import_un_": {"doc_hash": "99a8d70655f06390c02d2902c7fb21fcb1bcb1782f0d7aa2e78f11826477b27e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/checkout.py_from___future___import_un_": {"doc_hash": "9449d22f87d16f9b24afb3232152bc8bd716c2777e675ff78758735f5db94852"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/commit.py_from___future___import_un_CmdCommit.run.return.0": {"doc_hash": "aadb717d4bbdb94cb1233ad18b6387d96817fb632c09d8acf4df4969267b4867"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/commit.py_add_parser_": {"doc_hash": "457ad587e7d48d1d2df333bfc5f20c91eca51a19fb5a3b011c2a9e637645e4fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/config.py_from___future___import_un_CmdConfig.run.if_self_args_unset_.else_.return.self__set_section_opt_s": {"doc_hash": "9c0a3d52ac7c27a5e7ad2e92c4fd956815a7b55f7ac3788e7c5ad4fddc608fb9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/config.py_parent_config_parser_": {"doc_hash": "64fb6df81d5dc2e14445dd3c1e303635c0dcec3a1fd6437c7d749d42761a5f0c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/daemon.py_from___future___import_un_CmdDaemonAnalytics.run.return.0": {"doc_hash": "8d659d3e6c36506836df37c5b13d6fbc1b0a0e148a448b3c0d62e04f8edb08cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/daemon.py_add_parser_": {"doc_hash": "cc7fb8b84100e0a62a0302639ce50bc46f2de33987c4344023d9f1aa6f044ef1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_from___future___import_un_CmdDataBase.check_up_to_date.if_processed_files_count_.logger_info_cls_UP_TO_DAT": {"doc_hash": "5f0a2854a971363e008ae748aaa1b3f24311c7ce7855d13dceb5f52c78febf13"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_CmdDataPull_CmdDataPull.do_run.return.0": {"doc_hash": "c6912a642da8c8cc089d9fab033377afeeeed1ed1170efe403b725abfe48cefc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_CmdDataPush_CmdDataPush.do_run.return.0": {"doc_hash": "879119776a27a58cee5b871cb7495b8dc34d5c34a31dd7ce52e4381f52513805"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_CmdDataFetch_CmdDataFetch.do_run.return.0": {"doc_hash": "f29cebd95aa617522dd9fe66811fb93ade83780589cb71223798e65122384781"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_shared_parent_parser_shared_parent_parser.return.shared_parent_parser": {"doc_hash": "843bf46f1bcccef410b3030b203d7f1eedf3369da01e349db6e1d1df24693790"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/destroy.py_from___future___import_un_CmdDestroy.run_cmd.return.0": {"doc_hash": "ca85cd7470d3fc0b3b870b9f9d39627673985845384a09ece4f03db5a682307c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/destroy.py_add_parser_": {"doc_hash": "9448a074cf9b65a9893abfad548b847fa4ba137c70413b1ad8608f04a2d641e5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/gc.py_from___future___import_un_CmdGC.run.return.0": {"doc_hash": "28dc39c44c3225ced53344745211a03999ec0f57a03011e0bd3b90ba44f373b3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/gc.py_add_parser_": {"doc_hash": "c9d2b71f3dc4c2126636c39521bc64f1a279ade8c58f98b3e6f4bfa89fc20391"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/imp.py_from___future___import_un_CmdImport.run.return.0": {"doc_hash": "ce0fd3c953f7a08758d502fdccadd4f06fa80fc8925c7ba6f38dc71bd1249fdc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/imp.py_add_parser_": {"doc_hash": "bfa63e0876a29ca7c7ea611a6955152303df39201b0da32397f1b9acfd743f9f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/install.py_from___future___import_un_": {"doc_hash": "6b65c82465b58d4fb48948d3e7aa5f19b5b14ee738730fc8802f7eda66020dd5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/lock.py_add_parser_": {"doc_hash": "db2b29427e5945c8f0e832c0f4353e5ce82c9259d55871d3251d34cd38e70bd0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_CmdMetricsModify_CmdMetricsRemove.run.return.0": {"doc_hash": "a2ef4e44bbb4c55a3861b302a1f0115ab55a4e666626fef164eae905052d35c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_add_parser_": {"doc_hash": "9bf36434bc8722df28362f4743082c059e308853bef965d67ff4b95951772075"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/move.py_from___future___import_un_": {"doc_hash": "7ecd9cb7ae4faf16c1888ecc2dee61d29cac5fc2a92f145b18cbfa4c22cc388a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pipeline.py_from___future___import_un_CmdPipelineShow._show.for_n_in_networkx_dfs_pos.if_commands_.else_.logger_info_n_": {"doc_hash": "6628f592e729f89f52201098823b9f5164b37c93e3bd1df09ecf61011834b1a6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pipeline.py_add_parser_": {"doc_hash": "c1283db6b92882bfa96bb775ba25c1e08b67dfd7ef05e016e1ea014f4d6009c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_from___future___import_un_CmdRemoteAdd.resolve_path.return.os_path_relpath_path_os_": {"doc_hash": "ccc5520864832963b4f9fef85eea12448d11a1ba66c54ebd6aa87fd99b7fe8cb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_CmdRemoteAdd.run_CmdRemoteAdd.run.return.ret": {"doc_hash": "d1f6488a39366ba4638194286d5848583f23f26fec453bf96071d1fa8851e23d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_CmdRemoteRemove_CmdRemoteRemove.run.return.0": {"doc_hash": "b5c17f93d56047038d41ad64075ae8e02e2ca3a18f16352f99efa25c3daa2d9d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_CmdRemoteModify_CmdRemoteList.run.return.0": {"doc_hash": "83613d7abf72b106147c11fbd9cc67dfa297d23a6600add34de414285af06338"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_add_parser_": {"doc_hash": "45be5e2b06f69f93e0e7ce7f975b08562d7b9e7c3e28d1a86b302736ad72ddcb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remove.py_from___future___import_un_CmdRemove.run.return.0": {"doc_hash": "d7146822ac0a5d50ca7a145ab4e288dc53f2efc7f31f5e62cfea2fc91c04eb83"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remove.py_add_parser_": {"doc_hash": "de5e6a35be9e41af8562d11ca539aae212ca52bcf683e549b15317197e46f3ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/repro.py_from___future___import_un_CmdRepro.run.return.ret": {"doc_hash": "46ec09f82e05c16eeb451adc73be8f9670d135533657f2c8af37f02c1fc52ab2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/repro.py_add_parser_": {"doc_hash": "64228e14fffa59dad80eafb1e7744a74da294e1e0138e0f655c75d302841adc9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/root.py_from___future___import_un_": {"doc_hash": "a8847ae58760a066eb6f30b023be064f857a0a7b4069a6bc5e2f526b09999828"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/run.py_from___future___import_un_CmdRun.run.return.0": {"doc_hash": "858bbbcb0112d55b6ea6cc16d5985dfef0ad47e607df7fb22b77e0ff390c34a9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/run.py_CmdRun._parsed_cmd_CmdRun._quote_argument.return._format_argument_": {"doc_hash": "05708adf070cc30ec8cf0d4c2190f31674cdf1429e14948691007a4d89b2b61b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/run.py_add_parser_": {"doc_hash": "1e0ca8cafca6a1856f8965cb36368578fc4cb2475dcc4b2e02c8d27aac9e6b58"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/status.py_from___future___import_un_CmdDataStatus._show.for_key_value_in_status_.if_isinstance_value_str_.elif_value_.self__show_value_indent_": {"doc_hash": "b21cc21fddd0450f063cc3f9668bfbaadef22d677025803733305baa70371bc3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/status.py_CmdDataStatus.do_run_": {"doc_hash": "429d8c04a8d8d1cc16c80042646fa524f2ae83c4f4bd7b0d7d9eede1cdee2a39"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/unprotect.py_from___future___import_un_": {"doc_hash": "540b5cd783eddb23f1c90191cd1f783c23639b14456eb3057cd35cadf2e37206"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py__DVC_config_objects__is_percent.return.int_val_0_and_int_val": {"doc_hash": "e7a76e8f60b011d7fdc4c2d04843228d74886a8aeadaba9d10e14e5ed4b02da5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config_Config.SECTION_AWS_USE_SSL._use_ssl_": {"doc_hash": "ea3fc4d5e4d6bbca9424b40d55aceb2c11aa3e934db20f9d931399632e645c55"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config.SECTION_AWS_SCHEMA_Config.SCHEMA._": {"doc_hash": "356a0390d1cc78796f90e5ec7aac3c58dc3ff23cc17509764add033f9e1c7267"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config.__init___Config.init.return.Config_dvc_dir_": {"doc_hash": "7997278033b951a4e8d5f121e5cfc9a241bfe9b55ff2125314a5e54ed510dd51"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config._load_Config._load.self.config.None": {"doc_hash": "d1aec0ed67ba93943f094b518b3b759ff586625fc83a48f05a6f915f7324e885"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config._load_config_Config._resolve_paths.for_section_in_config_val.section_self_PRIVATE_CWD_": {"doc_hash": "0fe26a6cba48d48594a5b02cf7c05dd85a5f17d4d4cdf24a1b9792eb85d79bf1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config.load_Config.load.try_.except_Exception_as_ex_.raise_ConfigError_ex_": {"doc_hash": "7d90e6059d1e2e972d903e1e52a70cccda218dc01ddc4d13c5e195decc1aad07"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config._get_key_Config.save.for_conf_in_clist_.try_.except_Exception_as_exc_.raise_ConfigError_msg_ex": {"doc_hash": "301a5e003b1b04b9f01b329d5bee8385a3732aa872609fc2479ee8a3a4c1c215"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config.unset_Config.unset.if_not_config_section_.del_config_section_": {"doc_hash": "86e22f2bf688df288d521b44688781fe59d39024df1d8ca1a6c8bd4d3c14b95d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config.set_Config.show.logger_info_config_sectio": {"doc_hash": "f654db86e155cb114ee817e0f164380fa15325c60670793a30498c2881011df5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config._merge_": {"doc_hash": "326e4f7cbe4fe6faefa3a7871e3cc290687fb2a22ad7fcd50e62c384a688e0ed"}, "/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": "9c75f5594362ec4077071bdbd071673330198c4aab9f43d21e0f313ecfb2aed9"}, "/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": "25b17d3f34f336ef03df0c94b65a46971048876c7c692043f3d02aa6bec5a018"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/daemon.py_daemon_": {"doc_hash": "54a91f6aaaa5a7969afa5a1f3befc0b1f692e7b399e691ceb19f670b5db557f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py__Draws_DAG_in_ASCII__VertexViewer.w.return.self__w": {"doc_hash": "1f3e1628a76ea13e90d0f8ad764ebfbcbf53cf524cc7123d85933dee32880f48"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_AsciiCanvas_AsciiCanvas.draw.if_sys_stdout_isatty_.else_.for_line_in_self_canvas_.print_join_line_": {"doc_hash": "05e0c879bfb2ec4a09fe366382eb47e99737f1f6431ea930bb7511f04348a877"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_AsciiCanvas._do_draw_AsciiCanvas._do_draw.while_True_.if_offset_x_max_x_.elif_offset_x_0_.offset_x.0": {"doc_hash": "c79e7fc5a69b3fd9047c807b48b5c1f33cbcddb7fe92722973d01d4bc7f9faae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_AsciiCanvas.point_AsciiCanvas.point.self_canvas_y_x_char": {"doc_hash": "69c563ebb4f803aeee7aa09beaab0b111a7c29979a696db61974273bc198e2bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_AsciiCanvas.line_AsciiCanvas.line.if_dx_0_and_dy_0_.else_.for_y_in_range_y1_y0_1.self_point_x_y_char_": {"doc_hash": "77c41215300af920c49aaa6d3a8c5c309bca08a485791f9391b5028e1513b453"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_AsciiCanvas.text_AsciiCanvas.box.None_3": {"doc_hash": "60b384e2767490c98d73588238e46c94183b0899823d6396b0b1146883563241"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py__build_sugiyama_layout__build_sugiyama_layout.return.sug": {"doc_hash": "c89a02de60b926bb0adf1d56a9dc24314581afef5a220d200c52ed4f3ac39d43"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_draw_": {"doc_hash": "78f77c70b8ef631075bab17ab9722bba2e530b69009a7558fd4065460fc6edef"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py__Manages_dvc_remotes_th_from_dvc_remote_http_impo": {"doc_hash": "dd296df15950894db9ac7c2c882c63e61423ae98a8650aa34b5753a45bef6587"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud_DataCloud._init_remote.return.Remote_self_repo_cloud_c": {"doc_hash": "9f0606a6fdbedb5914adeaff9f468c1c9ceb6c3fa325ecd016152ccf3e066b24"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud._init_compat_DataCloud._init_compat.return.self__init_cloud_cloud_co": {"doc_hash": "165645cd4684c50cd0ddcd45a514fbbecb2513348d7c30a66b98fa59a4cb5cbf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud._init_cloud_DataCloud._get_cloud.raise_ConfigError_": {"doc_hash": "c6a3d91de1c1e921606da208ae5f824aada73943e515d97295e9e64bb89b3538"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud.push_DataCloud.push.return.self_repo_cache_local_pus": {"doc_hash": "4094381144095a8a94961dba47564e2a76119304895ab445aa22b6f044be1d8c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud.pull_DataCloud.pull.return.self_repo_cache_local_pul": {"doc_hash": "856eaa2691f8117071352022f0e5553ae6093ea5ff5ca1617c127bd37407c2fc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud.status_": {"doc_hash": "152c994e1311619e05a5c46719b359ee7e793a2c78e1c6a121c9441e68f23580"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/__init__.py_from___future___import_un_": {"doc_hash": "10fb42965c9c6657b61754bc223411ad9449d42442576d2da4c2c7090cfec42e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/base.py_from___future___import_un_": {"doc_hash": "ea3ce6d36ff602a180109278c0cfb707c92fc2aba29c8f4bfd0765332876dc68"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/gs.py__": {"doc_hash": "58c4f17a950a4c772361ea2b52b1e8fc1cf6d4b1312a009b978509c3e18f1723"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/hdfs.py__": {"doc_hash": "72a37ea416cf264d27a2e4ffa5c1b30f1bb52124fa94d293c4f5317987f82210"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/http.py_from___future___import_un_": {"doc_hash": "2de3eabafff25439da0c700c0d40be235ea9e8bf9fb645eec958426356aae38d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/local.py__": {"doc_hash": "4da2d004607637e3ae7e25e37d1d30dabf17fa9ce7bf45cf43ad232ec142e959"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/s3.py__": {"doc_hash": "872d080b27b0d66ff64a3c24417f34c5c3535fa1109f9cd03c6cd4dbed49fb13"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/ssh.py__": {"doc_hash": "ca1c27bcf3028feed1cb0d4f8e41cea24be5633c656be0d2182dfa25e3b2c3af"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py__Exceptions_raised_by_t_DvcException.__init__.super_DvcException_self_": {"doc_hash": "34eb0e2e7b68a4444c8f58c3b62e6ecebfab7528f4c525a5b67cb05269413603"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_OutputDuplicationError_OutputNotFoundError.__init__.super_OutputNotFoundError": {"doc_hash": "3c6e0541d69e1bad069313546900fd3bd1adc53f292ccd0a69009fedfd0ddc2e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_StagePathAsOutputError_StagePathAsOutputError.__init__.super_StagePathAsOutputEr": {"doc_hash": "a5470ca54fc7bfe1ac51e49f7123e262d8ee05c3ba1f61df13a2c7876dada827"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_CircularDependencyError_ArgumentDuplicationError.__init__.super_ArgumentDuplication": {"doc_hash": "0f9c1410fda0a666f45fa30dda38e9d3ccd2bccbe8c1781064e105aa7c41eb98"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_MoveNotDataSourceError_MoveNotDataSourceError.__init__.super_MoveNotDataSourceEr": {"doc_hash": "67fc312f673b4c2e2618a046bd90043f0674e30ec24d3d430e3f5caccc04939d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/istextfile.py__Use_heuristics_to_gues_TEXT_CHARS.b_join__int2byte_i_for": {"doc_hash": "d3251ef8d1f7c3be2cb62fdcae5c49d1d0a6bf64d591acd51404cc5cda1fb596"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/istextfile.py_istextfile_": {"doc_hash": "9ab08ad3b2769ac75c4978196ddf9e4335a8b6853ad49eafa388fd5e9fb8b27d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/lock.py__Manages_dvc_lock_file__": {"doc_hash": "3624d1af6ebf17c19a3162b4879504b9474cf290fe7b6383e89317f15679c78d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py__Manages_logger_for_dvc_error.logger_error_out_": {"doc_hash": "f632912b18c1ea66d0b037138417b69f900716453e76e62e5065330071796bb1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py_box_box.logger_info_box_str_": {"doc_hash": "68f29be8a9f59df9bc55f58ba253d7c8ef7733cc3dc5ebf4addf590303dd59ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py_level_set_default_level.logger_setLevel_logging_I": {"doc_hash": "54f78349fd0e2b4348c442f1f6f61bae86daacebb5cb5bf848651544f45b751c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py__add_handlers__add_handlers.logger_addHandler_sh_err_": {"doc_hash": "05fbb40b8b55ef1af768d023c604c040a7a8bc901223951a6638238415a4bc25"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py__walk_exc__walk_exc.return.exc_list_tb_list": {"doc_hash": "bb4c81ddb4081beed169a537c3d4b17f9f2fcafe66ec157553cc8d0dcec819b2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py__parse_exc_": {"doc_hash": "a192eabdf24ecdf183b05f48e61fa11ed8462bd0b91a6bd5f61de51e4c17544c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/main.py__Main_entry_point_for_d_": {"doc_hash": "3c5d2d939350d913d5e0bb19e08a73b0fd66e4876665cf6e93fa2377ee0f0a76"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/__init__.py_loadd_from_": {"doc_hash": "75168802649637cc768df1e1e35032877cd543a4e7118b926c857b2703e8ff83"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_from___future___import_un_OutputAlreadyTrackedError.__init__.super_OutputAlreadyTracke": {"doc_hash": "ae8722df00aa61c710e912afd3134c8b2aaa68924c1eab38f0a7b310839ce136"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.verify_metric_": {"doc_hash": "3d21484328080e60c7912421477cd144ac0e504d5439f72279dac42a4333949f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/gs.py__": {"doc_hash": "5964344295051e94ef37e791de7cdfc1d0201addecebe3c71a42d56a8f3bfa1d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/hdfs.py_from___future___import_un_": {"doc_hash": "9ff39c80a45bfff0ccabbecf2984710f6a88e84dab326d7d6c78c12c4b391452"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/local.py_from___future___import_un_OutputLOCAL.verify_metric.if_not_istextfile_self_pa.raise_DvcException_msg_fo": {"doc_hash": "d8adfdc87ae74c44915b3af090587a74bf6d831c6eb9cef6eebd1c4a271c502a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/local.py_OutputLOCAL.save_": {"doc_hash": "802bc84ebd598dd5257c04d4ea64d9894f3798fac3477785a24c211d07742875"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/s3.py_from___future___import_un_": {"doc_hash": "3b7884a7852934c01faa6c72bcb2d8e30d14ad6770e12ffd7ea00c957ffb97f5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/ssh.py_from___future___import_un_": {"doc_hash": "0f68fcb160b3ad0c547d63c1b6f75ba3886bc38e3ecfc2856bdf8d135e7f4f3c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/progress.py__Manages_progress_bars__Progress.finish_target.with_self__lock_.self._line.None": {"doc_hash": "86f4ed0669a289f22c1c44a12822a1250c71415d978e39ac85f6adb713be57d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/prompt.py__Manages_user_prompts__": {"doc_hash": "bc2675bc2ec4ecbd8e7bf74e896bc22914f4ac8868cc01f6cb929b51f292d847"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/__init__.py_from___future___import_un_": {"doc_hash": "eba6589ad1e2dd39b124fd93504fcd3622597e9736d0bf0027efa845acf51cf8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_from___future___import_ab_Callback.__call__.progress_update_target_se": {"doc_hash": "f28fa61e0d5a9a5a57bf30d4ae4ea3d03832352dc7505dd29482f1b2b925fa6c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_RemoteAzure_RemoteAzure.list_cache_paths.return.self__list_paths_self_buc": {"doc_hash": "745bf51de9483688fa925615c9336ab0aa20e7b2fa60f4592b0069f742386941"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_RemoteAzure.upload_RemoteAzure.upload.for_from_info_to_info_n.try_.else_.progress_finish_target_na": {"doc_hash": "b9249d468925183a97031ff6cbe9082d036bd667a2812c7da7e9eae9a508d3d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_RemoteAzure.download_": {"doc_hash": "b70a0b9257dfc68f228363371d1fd744652c1e652dbfacd13678d4f1ded67509"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_from___future___import_un_RemoteMissingDepsError.pass": {"doc_hash": "fb1d5e2187d88e2b081222d8eaed512514cdd2372588b81e6580c8988c8b7144"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBase_RemoteBase.save_info.raise_NotImplementedError": {"doc_hash": "768314d3408479e758dbb216869b70ebb1c338e47f6defd7b2157c54f24ddf22"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBase.changed_RemoteBase.changed.return.False": {"doc_hash": "160912b13568412a5d7bc7f5b24cd9076dc00b6c59936ca1e164286df6efaa26"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBase.save_RemoteBase.changed_cache.return.False": {"doc_hash": "b11e2d005c86f63155077364e7ac11922c6c80ace75f2a33a7a499d77e3252ff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBase.cache_exists_RemoteBase.cache_exists.return.list_filter_lambda_checks": {"doc_hash": "e479fac4c59080e13b5e4c9156636ff682ad2a37d54a036c2689282be8a4e892"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBase.already_cached_RemoteBase.do_checkout.self_copy_from_info_path": {"doc_hash": "c8a6e4f1a28a34654080ed4c429534a1a587eb0ccd6f0b18e9fe60eb16e47491"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBase.checkout_": {"doc_hash": "04ccdd7174fbb78840f6d8def295ceea06f00ab2a0a263fecb72ae52e24db608"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gs.py_from___future___import_un_RemoteGS.exists.return.any_path_info_path_": {"doc_hash": "dd200d38475efe8da160ece056e9790c24d5c03b06e85ac6926b8152939e83c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gs.py_RemoteGS.upload_RemoteGS.upload.for_from_info_to_info_n.progress_finish_target_na": {"doc_hash": "f33733a48c4a6103196f2b0eb0cd0b29cd05cd6f1c70b6f44c0b5edd2b2935a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gs.py_RemoteGS.download_": {"doc_hash": "5a02b4931fd51a86ec4d9260521ad1ee3ade3943b44f7a21beab6ae34240c87a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_from___future___import_un_RemoteHDFS.__init__.self.path_info._scheme_hdfs_user_": {"doc_hash": "7c907a104844ee5b8d244609c3db7f6d5e379286e14f5e3fa89778155ab66552"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_RemoteHDFS.hadoop_fs_RemoteHDFS.hadoop_fs.return.out_decode_utf_8_": {"doc_hash": "bfde1fb14d1b7a1261a76daecb92a7a454701463ae44b31777b609970f4f9e8d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_RemoteHDFS._group_RemoteHDFS.exists.try_.except_RemoteCmdError_.return.False": {"doc_hash": "13559d8e24029efda4925c8b36fa074823e9b4d718cc178d5155187824fdba29"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_RemoteHDFS.download_": {"doc_hash": "3c69ee271b262d87d1355398fd9fb427f93faebbe6061a0dcb22018d63261ee7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_from___future___import_un_ProgressBarCallback.__call__.with_self_lock_.progress_update_target_se": {"doc_hash": "217f2f9c8e7810024934387e79843c53c7327af4fd227937e702444941b90378"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP_RemoteHTTP.download.for_to_info_from_info_n.if_not_no_progress_bar_.progress_finish_target_na": {"doc_hash": "e26f2632634d2b9022a01d59bcfcc0c52e39f752f3ba30c1daa9ba10a7c240f5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP.exists_RemoteHTTP._content_length.return.self__request_HEAD_url": {"doc_hash": "458aedafd67b2c3732648a04115f598ec2b9f0f5ba769977fffb32ff5ad1ad26"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP._etag_RemoteHTTP._etag.return.etag": {"doc_hash": "d4ea49c5e6f7e60ab12d40a8c17e84066ef9b8eb5947cddb29d54f4ca616bd49"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP._write_request_content_": {"doc_hash": "84d662a7ef62361bc0d4824a384d77373c6ebd1da1662e964571ff8eff4802e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_from___future___import_un_from_dvc_utils_fs_import_": {"doc_hash": "44d06bab1f573aaf25b8041c67d28b7f6485dabece3bcad988b1fd8573e26e7f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL_RemoteLOCAL.exists.return.os_path_exists_path_info_": {"doc_hash": "0015965c8e66ba5a252a3a96b0409097c41b7b77b048d1c984f346ebaaeb5cf4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.changed_cache_RemoteLOCAL.changed_cache.return.False": {"doc_hash": "ab6a85a1e6c8221955cbbc2d602f2f59827231e193ef4c139ad471d4641ae145"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.link_RemoteLOCAL.link.raise_DvcException_no_po": {"doc_hash": "8aba5b336bd7784595ac0dfd8fb65c99e937832b8a49617b32e6053c3976adbe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.ospath_RemoteLOCAL.ntpath.return.path_replace_": {"doc_hash": "84de7ebfd09c731995ad40682965e469d5f89e27e096d6d402b768067a39ed2a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.collect_dir_cache_RemoteLOCAL.collect_dir_cache.return._md5_dir_info_": {"doc_hash": "3b4ff7b0576c05e7e6c5f6ef9d69360cf0dcd07e5869c1140cd4284df1ff25c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.load_dir_cache_RemoteLOCAL.load_dir_cache.return.d": {"doc_hash": "b4f61631bfd0af44a54cc6c694bad58674a6acb1f010273b419142be1aa5b6dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.dump_dir_cache_RemoteLOCAL.is_dir_cache.return.cache_endswith_cls_MD5_DI": {"doc_hash": "a7456bf18ec28ed185981d21a6d131b7b8e6aa908934e05e0f510bc37840f239"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._save_dir_RemoteLOCAL._save_dir.if_bar_.progress_finish_target_di": {"doc_hash": "699dc8e08f46162731f17d621844e6f7b22c25d08826028874c0adc024f49467"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.save_RemoteLOCAL.cache_exists.return.list_filter_lambda_md5_n": {"doc_hash": "1403887835002e49608c67cb78251201406f888d3f762da4b04ccd29187c2c25"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.upload_RemoteLOCAL.upload.for_from_info_to_info_n.try_.except_Exception_.logger_error_": {"doc_hash": "6fb1aaa4ef6bd6104e0067f0ac363b8965831105b62fd229bf3b9d0ecb8daf65"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._group_RemoteLOCAL._group.return.by_md5": {"doc_hash": "4a58af6cab2328ad7a8a9b9325b2d7ce84a86e487924bab7a119bcbe7cb57c23"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._get_chunks_RemoteLOCAL._get_chunks.return.list_": {"doc_hash": "be2d8a05e3bca71c728702ddfec9d38fc3381d479f5f4ba78d01ad7fb1c100e1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._process_RemoteLOCAL._process.return.len_chunks_": {"doc_hash": "240df5762168f74ad3ef688a41001d6a19b83415328714f9e454437e0df988ab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_from___future___import_un_Callback.__call__.with_self_lock_.progress_update_target_se": {"doc_hash": "df326f1ab42a652421c8c55d2ca1135979b77c17072dad27556bb603ea8b2818"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3.download_": {"doc_hash": "940a1f407f1a88d5e9f78c1de05cd2c83cfa2559d228769a8c56c9cce117d8af"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_from___future___import_un_RemoteSSH.__init__.self.path_info._": {"doc_hash": "2bba6692797280f8055c9e8922180a4251a598d33fc5a9c34c014ee8e12f0f6d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.ssh_RemoteSSH.ssh.return.SSHConnection_": {"doc_hash": "1eba6cc77a3ef29714542f8037dad99d051e6e37e31611eb38df9ec3da2b3c12"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.exists_RemoteSSH.remove.with_self_ssh_path_info.ssh_remove_path_info_pat": {"doc_hash": "523a8a5c61ca2c209e8ae17a489fd479dbfe21e0d40335b3e047a7ab7d8683f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.download_RemoteSSH.download.ssh_close_": {"doc_hash": "26653ba2ed6523a15fe21dc5b04dc363351ebc0e74fbcab40783f2be67062ead"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.upload_": {"doc_hash": "ab24b71ecea3d1e5c0bc56f85023337546c013ad72a3c897295d0b8c24b58558"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection_SSHConnection.makedirs.if_tail_.self__sftp_mkdir_path_": {"doc_hash": "4304bf7ca264d2401623e0888338aacbcd10078771e407c45199de1c204f217b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.upload_SSHConnection.upload.self__sftp_rename_tmp_fil": {"doc_hash": "2604ea58f8820db5686d54ff308041e5b8f9c09eb2246b7787a8b37ed1d4432a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.execute_SSHConnection.execute.return.b_join_stdout_chunks_d": {"doc_hash": "8c22cd64f04337cfdcdd7c7c1d8b64e0230f3b4f58d84c55dcdb182fc1060e4d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.md5_": {"doc_hash": "1a875a3942c4c7200ab14e3e24de0f4521214c910465d51dea0a57c6593a144e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_from___future___import_un_Repo.check_dag.self_graph_stages_stages_": {"doc_hash": "d7e413ab50083f772bcd6dc16614dbe60ec48578bacf2d426ea3d3c71fcc304a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo._check_cyclic_graph_Repo.collect.return.ret": {"doc_hash": "1fdd18c730366fb24204b06b78566a296108277338d7bfe83fd37e40689f2ec0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo._collect_dir_cache_Repo._collect_dir_cache.return.ret": {"doc_hash": "1f59f079d473cfe272755cde9d34490985323967f00b3c3a0321a73c54f32da8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo._collect_used_cache_Repo._collect_used_cache.return.self__collect_dir_cache_": {"doc_hash": "739ee2b946f750244f7d7cc7e7818d313fccdbcd38e31be6afb8846d8607e0e9"}, "/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": "333f9ccb668f03d7533a83fd3e30f975c8f697fcde5e7170666e8685671fe776"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.graph_Repo.graph.return.G_G_active": {"doc_hash": "3d7264c2413f1bb102a102cb005590fd0f5ed7b721c527eba697e8d76213dc35"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.pipelines_Repo.stages.return.stages": {"doc_hash": "288b74f0c632b505a804429e7add98bd6e35330ed1ab6566882c18fa8a705d64"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.active_stages_": {"doc_hash": "34b990bf2fd750d557f0424e60dd0f17f96a6c2557193887a4a28266bd8c4329"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/add.py_os_": {"doc_hash": "2e5ae34e2a7cca29ddd770f0ce898b8a94c00db42d4ab44018085c7f47d67ea6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/commit.py__": {"doc_hash": "98edb4d5fcb8d4d820f09167b013ea6861da12eb36a5164e508c1acd4d0814a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/destroy.py__": {"doc_hash": "56d22ce46d228414d9cff45a223df19dd32742d0d663598813186e5e01d93252"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/fetch.py_from___future___import_un_": {"doc_hash": "db7a416f2e3949d8340967bb045ac72a9e43d7f7f04022d3ba6789690de34ed3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/gc.py_from___future___import_un__do_gc.if_not_removed_.logger_info_No_unused_": {"doc_hash": "5227f2dc843197d8c3a02e5f35d093f20c0195d36babb95de39e8650cc5cc456"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/gc.py_gc_": {"doc_hash": "c57c6699463b8ae1952577fc277e8b88490a8220a93b96202bcfa27d7e536e66"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/imp.py__": {"doc_hash": "78513308a19e94a6298308ca0b84bcadb752482876cf9713868793ea82dfc260"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/init.py_os__welcome_message.logger_info_msg_": {"doc_hash": "3368f9747c8ca04ea484223abfde6769cf229d7ca975e9e4c5152f67d45c26f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/init.py_init_": {"doc_hash": "08ecc782120995593c7d778ef16341b49d61119dfc5145e3fb2c1dbc34f1661b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/install.py__": {"doc_hash": "6985f24eab57597cd6337307f6aa634c4a4c60d1e022f9f8c88020808029227d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/lock.py__": {"doc_hash": "7602292f5f7006c6ec55d048acd4256879f7d3c225b99d7c44c027c2447fc23d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/__init__.py_Metrics_": {"doc_hash": "4ff5c9603e1a4b9aa9b97e3ecdc7db54cd509093fa525a3dabef01208d04f42d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/add.py__": {"doc_hash": "805d721aaafd7c6cba208326a28bd26dc4a0ab1730f24584bd263c446ba970ee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/modify.py_from___future___import_un_": {"doc_hash": "245debd837eae7f50723d121c4d91e44207ea35377b16807849c43dcad8cf05b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/remove.py__": {"doc_hash": "2916b49dc071cb1c7df1a14213d572557779bb8643d1d4bf097d76709b6986ee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/show.py_from___future___import_un__read_metric_xsv.return._do_read_metric_xsv_reade": {"doc_hash": "5e50b8f3f17489a2fce137b4f16553f15973834060bd25f3b62d4eacf006cdbd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/show.py__read_typed_metric__read_typed_metric.return.ret": {"doc_hash": "36ddf6ceff71ffbb0704812927e1cbc6b4a4307ae71fbfeed6bb98b26078cdd5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/show.py__collect_metrics__collect_metrics.return.res": {"doc_hash": "75eeeb7af14b6cee3ff6b405ac1ce21fcfb1531e1c7e4bcfb0b0344b6d2166bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/move.py_os_": {"doc_hash": "c3c8310737ef95670446e6dcc5aa75d054d0123f5453edfc206f01e748bf6ddb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/pull.py_from___future___import_un_": {"doc_hash": "3e1f175736edd402da9fd8ca571a7a054c926532d0705e22e8a7fa9444e3999b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/push.py_from___future___import_un_": {"doc_hash": "5cde3bedfdcd994ac1092d6b59b97642015011b9f908be6b313d278398c3fa46"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/remove.py__": {"doc_hash": "5f23a2ad62b7c5ea91dafb8947e3b1a4cc8ed71ce91698388674dcb44f318411"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/reproduce.py_from___future___import_un__reproduce_stage.return._stage_": {"doc_hash": "b8ae3428eb3accaf2567b50635d378acb374233571d1828ef6ac5d91d6c407ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/reproduce.py_reproduce_reproduce.return.ret": {"doc_hash": "8721d646ea084490d2a1bd4ff005ba30e194f49485f8fe6d46a01c0baa6046e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/reproduce.py__reproduce__reproduce.return.ret": {"doc_hash": "317ca5249cfe3dff3309ecf1c9cf4e62e073fbd2dfd4f6d1d9e23b14f1c57039"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/reproduce.py__reproduce_stages_": {"doc_hash": "b8f89e50860358000e109dc639a710b1830ff1a1634dd86c9065096f234cd425"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/run.py_from___future___import_un_": {"doc_hash": "cbfd051ba11e94a272f5b7e892352f594d5523ba9ea9522d60674197ab9a2d2c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/status.py_from___future___import_un__local_status.return.status": {"doc_hash": "dc67b8ed7951484800b555c4413c2faba63551d8fbbb972e9fb56ff17f274c8c"}, "/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": "0c0c2cf41056b5fdeaa70c2e8b0a1f45e611baf05d316299504874aaf7dcfa98"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/status.py_status_": {"doc_hash": "a8f6291aa5f32cd956371026428e06460e592d40dc3e718fd5ede51f0c2de81e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/__init__.py__Manages_source_control_": {"doc_hash": "7e9b760559003c34f2b41c1052aa7d14a465fc6595e4a0f991d93d832c1f4f72"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_from___future___import_un_MissingDataSource.__init__.super_MissingDataSource_": {"doc_hash": "1e254f7899a93c1fc2323338e7f4cbcf218b8657dfa97c112a769cb96b57e2c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage_Stage.is_import.return.not_self_cmd_and_len_self": {"doc_hash": "6da418bfeff7a53874adcd5884492dc5bcb133266d56c8e9c0e0711442958170"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage._changed_deps_Stage._changed_deps.return.False": {"doc_hash": "e4b556557b2917ecfd250246d5d2657404836e162ce2e68bd50d453852da19c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage._changed_outs_Stage.remove.os_unlink_self_path_": {"doc_hash": "2b347479621f11f2c6ccf2e19dbced065e0b3eb35d0f2ce767175dba27be2c46"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage.reproduce_Stage.reproduce.return.self": {"doc_hash": "e686eb885401965fd963b5a7cc5bd9fb63a90ee00ff15b9e5fabb4faceef9e7f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage.is_cached_Stage.is_cached.return.old_d_new_d": {"doc_hash": "bb3903ec5649d29bbb6d6941ce294466843c6b9e59628af230dcc228f5114641"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage.create_Stage.create.return.stage": {"doc_hash": "632f81fb5c9e44a2d6925349efc9451e9f20fd78342d7593fc5e5e4d42298d0c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage.load_Stage.load.return.stage": {"doc_hash": "5b83644ee83a5869ad6bcaf1eb9e584f59b238c96310163e6baba8156a2361fe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage.save_Stage.check_can_commit.if_changed_deps_or_change.self_save_": {"doc_hash": "f8e98fd0c972d24368eba02dbd84817102e35ce54e6598f2896ed7b269491d15"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage.commit_Stage._warn_if_fish.logger_warning_": {"doc_hash": "77e872955240f7fe985e346dfa513f87d2a8f2b3ab41663f516422c135af4c2a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage._check_circular_dependency_Stage._run.if_p_returncode_0_.raise_StageCmdFailedError": {"doc_hash": "3810ee7ade106c5d35c0e37b6e3b819ef926d71eaa2dba6365cfba1064f809d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage.run_Stage.run.if_not_dry_.if_not_no_commit_.self_commit_": {"doc_hash": "dcad915cf9a3344064a712dc68e0044aa55197d06cc35b879adaa8cb95351ab7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage.check_missing_outputs_": {"doc_hash": "47fe96ffe2f4b4a74b1f5fb3659f015979c9ff8808bdbcf0794950c058287074"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py__Manages_state_database__file_metadata_changed.return.actual_mtime_mtime_or_": {"doc_hash": "b6ccc5421863e691fae935f2e3ffd3d54359f72d494e6a66f685f2ded7364b88"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State_State._collect.return._file_md5_path_0_None_": {"doc_hash": "7537bcc35a46774d205768bd6c4a892d53c63fcdac3c468103e3f58d42abe1a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.changed_State.changed.return.actual_split_0_m": {"doc_hash": "3d4c48fbca484c62cfb5d2975b770220a54bf8d00b173bda889506e0a02967b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State._execute_State._from_sqlite.return.num": {"doc_hash": "cc07e454f72ece4ff80234e624c0e2d14065cbf75c6b47a1a0f5a22d84cefc4b"}, "/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": "9dd75b6b12cf95bc5637c6bb7099bf82a61e120e55709bb34814f435520d4f79"}, "/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": "0b45fd8c22a6f45e77374203cacfd67ef32a042660c0b2b2a7dae0a7ae544775"}, "/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": "10643ccb0d0719b9defa2879d51d23c9a0319a857e18de96e072ab2ee3160cc7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State._do_update_State._do_update.return.md5_info": {"doc_hash": "4429d43e77cfbda0dc300e36ec8eff6cee19ed15165faa7c1a96bfd66b0403a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State._update_existing_state_record_State._update_state_record_timestamp_for_inode.self__execute_": {"doc_hash": "f78684554795e284c233b779f44bf3bdcb22cb1861dc28460ef5ff455c7fe4cd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State._update_state_for_path_changed_State._update_state_for_path_changed.return.md5_info": {"doc_hash": "dabe34e99ead64346a5a982d29734f471135f89f221a05a30cf2364b804e1278"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State._insert_new_state_record_State._insert_new_state_record.return.md5_info": {"doc_hash": "b492753c70b32db8acf3f3faa736c9c8efe8ec3119fabe68abe0a7a066145e11"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.get_state_record_for_inode_State.update.return.self__do_update_path_kno": {"doc_hash": "5c8100b8fa06611823be052cc64ead655645b07be1c11beb9493a74839c9fc6f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.update_info_State.update_info.return._md5_info_": {"doc_hash": "31120d150e5604b734a2db886bfdfbd2d300910e2a63fcc6a442fe97d737d87e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.update_link_State.update_link.self__execute_cmd_": {"doc_hash": "9ef540cd60faa2a276501ab999dc3874ac14cb70de1b282c2ab959ea162e4043"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.remove_unused_links_State.remove_unused_links.for_relpath_in_unused_.self__execute_cmd_format_": {"doc_hash": "176d3413cf6246bf9cd4693c81f070e5f31dc5796d9d3f3761007513e218a36a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State._update_cache_directory_state_": {"doc_hash": "033198c63154fa094c1209aeb30262bcc10629ab3b9e056b4d5fe6737d4ae89e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_from___future___import_un_System.hardlink.if_res_0_.raise_DvcException_Creat": {"doc_hash": "8c47f3122f3acd28da7d58237b133efd86cf277614abf98da1fa046d8c0a423e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System.symlink_System.symlink.if_func_link_name_source.raise_DvcException_Creat": {"doc_hash": "5ec3685184c95f2d8e0cbdb76c669d8924e8e7dfc561704dfdf7e5751053d69c"}, "/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": "282e5cfd6896e385f28f5584b1ec8a13d7700171b4336ef811cda24d3e4f5364"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System._reflink_windows_System._reflink_linux.return.ret": {"doc_hash": "9f2a50f0992b7c99250e1859895f486ed5d925c031dae97a0c6af4c62ebed97a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System.reflink_System.reflink.if_ret_0_.raise_DvcException_refli": {"doc_hash": "c563a7debc8cf6269c571c3d2754f73e512734c5937f48da7eb897e94a18191a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System.getdirinfo_System.getdirinfo.FILETIME._fields_._dwLowDateTime_DWORD_": {"doc_hash": "1adaba20ae429f3aba8874a955e7c39eb28c6064e8c8e6d8978557713c89ff15"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System.getdirinfo.BY_HANDLE_FILE_INFORMATION_System.getdirinfo.BY_HANDLE_FILE_INFORMATION._fields_._": {"doc_hash": "0fad7ce79fec6282a4f7fd24b183cca845d46e7169041df0ae5a43606f5d11b5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System.getdirinfo.flags_System.getdirinfo.return.info": {"doc_hash": "974046fbddfddaaafed4e1bd8bdd3294f6219a7560296ab93b287003cba12f2b"}, "/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": "729c303a9f30c0fc367b5e0fc670739b239116c167a13e680df59b09fc9920b3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System._wait_for_input_windows_System._wait_for_input_windows.if_rc_not_in_WAIT_OBJECT.raise_RuntimeError_rc_": {"doc_hash": "bcee8205e4a62d3e649dbc84973cbd17be0d7f5491a709b3ff2e002f70795bbc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System._wait_for_input_posix_": {"doc_hash": "34c918cf704689071d3bc9f655e55087aa81bb45a8626f84a304ade51f148082"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_from___future___import_un_Updater.check.self__with_lock_self__che": {"doc_hash": "6e91b32a5bd5cb6bf64ad3697bf25e07176dd1e7158702d7cc0631f5ebad5ff1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater._check_Updater._check.if_self__is_outdated_.self__notify_": {"doc_hash": "a1a9e380127f8dec539bb50bd14bcd0145116311724b12333a52451801960bc8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater.fetch_Updater._is_outdated.return.l_patch_c_patch": {"doc_hash": "14e0f635a075d53051d3ba47f94784fb022a7ef6c438ebc965c478c0571d01a9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater._notify_Updater._notify.logger_box_message_borde": {"doc_hash": "b654dcda7e714879d97fced4ed63667bcd3682090e4de8c3ccafbe525efb6331"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater._get_update_instructions_Updater._get_update_instructions.return.instructions_package_mana": {"doc_hash": "66662f76f6a97727c8134223a1f40ab1c9e1b9ab12279dc5aa5cbc68aeaabf7e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater._get_linux_Updater._get_darwin.return.None": {"doc_hash": "2a6bec890c8888981c6296d2403b7c1b0b4bfa3f968a0c5cef59491314c0a9f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater._get_windows_": {"doc_hash": "a3f22183823968d185e6a2dbdb081a957db5c52b385687cc988e5d4528cd2dbf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_bytes_md5_dict_md5.return.bytes_md5_byts_": {"doc_hash": "9935d3aab4f2b0c5c779065553dd2c3d2b913618aa59c255e5b54e8db24d6a71"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_copyfile_copyfile.fdest_close_": {"doc_hash": "b995f1132e4a183bb343f0a10f959387746919b37647ce1628cca1a2f33e1f13"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_move_": {"doc_hash": "19eb8249db6901c3e129a0c41d4726c898464d0c8526171475bfb92a3abacab7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/compat.py_if_is_py2__": {"doc_hash": "db2c8b59bc80365ca92f962e3321b7325125e792d394e7b07254f7d2d91abba6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/hooks/hook-checksumdir.py__": {"doc_hash": "8dec50281030d5270aa07b227bf68f5dce1ed03e1a0dab18afdba018e2c42d79"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/hooks/hook-google.api.py__": {"doc_hash": "b4298378973060ec5b52ffe30b6d117391e334013daac22e05219ee4496f9c79"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/hooks/hook-google.cloud.py__": {"doc_hash": "f3e8663630363fbd809d63a575113a8c4b28cbffc201e158b2667f6909f65400"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/hooks/hook-google.cloud.storage.py__": {"doc_hash": "255f57cdfd1ca77219378dbc07c7c3b38b6e228508e2c7d5c36e21222854275f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/hooks/hook-google_compute_engine.logger.py__": {"doc_hash": "da126273167e3367df6b4152ac179e4638b8dacd8c4935b9540a059fdb34a4d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/innosetup/config_gen.py__": {"doc_hash": "4d86e59935fcd01c5456fc61ed376fd427dd7ca1ea5a2e34d7a4f42d547df54c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/setup.py_from_setuptools_import_se_": {"doc_hash": "1d6a1a6df76ac112804faeb66995498aa390255afb5a94771bd0b1067c0ff84d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/__init__.py__": {"doc_hash": "090e9dc619428f73ec23b8606bfcfe243447f1336ef70b47e4525200faeb0c50"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/__main__.py_os_": {"doc_hash": "ec7d152ad19a9737dff5e2e7bcc6b36ac435e6fd25c36a26f2a0e16beeb3a2f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestAddUnupportedFile_TestAddDirectory.test.for_info_in_dir_info_.self_assertTrue_not_": {"doc_hash": "50281e7d69fd33eb463d9a8609c19bfabbefb422835390ff76ee3094c0df9a5d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestAddDirectoryRecursive_TestAddTrackedFile.test.with_self_assertRaises_Ou.self_dvc_add_fname_": {"doc_hash": "8d676665c6ca0d46f9d08b2ae7aacb5f981526aa06776d9bddfa308363220de6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestAddDirWithExistingCache_TestAddDirWithExistingCache.test.None_5": {"doc_hash": "09502e35c5343478a8c351243a67a33b41adce89e17d23a069f26584c7a6ce4a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestAddModifiedDir_TestAddFileInDir.test.self_assertEqual_stage_re": {"doc_hash": "d8199ff07eeba7f3a00ec5ef7a5e81d76b341666cfd682a9bd14d653a43db3de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestAddExternalLocalFile_TestAddExternalLocalFile.test.self_assertTrue_filecmp_c": {"doc_hash": "122f272ba49e2dd4d1951d536dc1c8baee69f84251a7f48d819be28f4e641177"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestCmdAdd_TestDoubleAddUnchanged.test_dir.None_1": {"doc_hash": "362b30993bb2f894b90c43e78addd9c853af07b29af5dc979f72162f8fe21a6e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestShouldUpdateStateEntryForFileAfterAdd_TestShouldUpdateStateEntryForFileAfterAdd.test.with_patch_object_dvc_sta.None_6": {"doc_hash": "d6cf3f81d3ae3c01522a7b1e3922d68d6b952fb68bca3a64b908d2d2bfb95927"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestShouldUpdateStateEntryForDirectoryAfterAdd_TestShouldUpdateStateEntryForDirectoryAfterAdd.test.with_patch_object_dvc_sta.None_6": {"doc_hash": "9742deffef20a9237e1b864eaffaf9cc4fee2760a7465945e6efa00c1775bb46"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestAddCommit_TestAddCommit.test.None_5": {"doc_hash": "0a5e4f5219fdc8336614ac37c3c7fa48292736808b46983b3f9f94dca3b56e59"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_analytics.py_TestAnalyticsGit_": {"doc_hash": "5cc246ee81aa48e7db526e398b663982b9771e231756ecaf34bf2bae3ff92d1c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_cache.py_os_TestCache.test_get.self_assertEqual_cache_s": {"doc_hash": "f9361af0d6a0e2e51e73fa21e6b52545f5017f23923c9ec83cd0923314cef934"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_cache.py_TestCacheLoadBadDirCache_TestCacheLoadBadDirCache.test.None_3": {"doc_hash": "7ace623923b5e6d4b7cb8f7bc3ed413b2ffda7fed76f16cc321eb80722683201"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_cache.py_TestExternalCacheDir_TestExternalCacheDir.test.self_assertNotEqual_len_o": {"doc_hash": "cd0df741d6875c2fc0fd86813dc5267db7591d7106923b755ba267d782b66a52"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_cache.py_TestSharedCacheDir_TestSharedCacheDir.test.None_5": {"doc_hash": "ec70b31b55d5ee0f6d710d79bcd2eeedfea56701eed56851fa218ca80dee4d3f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_cache.py_TestCacheLinkType_": {"doc_hash": "bae4c46e14e3062b4a8e4c131417e22641db03563b061676b816c9b9bd432ff9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_checkout.py_TestCheckoutSingleStage_TestCheckoutCorruptedCacheFile.test.None_2": {"doc_hash": "ef6c1dc5e5e7df3a5cbb220878afb28d3376bb4f413ba743ac7eae7b4d256f03"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_checkout.py_TestRemoveFilesWhenCheckout_TestRemoveFilesWhenCheckout.test.self_assertFalse_os_path_": {"doc_hash": "b73d80d2d62e758c709cb9af7cc09d236263d34b441c2f396547fc2293408a7d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_checkout.py_TestCheckoutCleanWorkingDir_TestCheckoutCleanWorkingDir.test.self_assertFalse_os_path_": {"doc_hash": "a1f8ad6fcb9ba5b798431d912bd9383a9f27bffb3edf9bd7ca19a3a7e97fe241"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_checkout.py_TestCheckoutCleanWorkingDir.test_force_TestCheckoutCleanWorkingDir.test_force.self_assertRaises_DvcExce": {"doc_hash": "8d1d8edd417b87c9cf5e86f9014f9635e0e64fd829486208173b06d7716f9302"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_checkout.py_TestCheckoutSelectiveRemove_TestCheckoutSelectiveRemove.test.None_7": {"doc_hash": "09896002f2d308194dd06974a6be6e6972d6a7f5dc0619684a6d4d5c928cfe2a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_checkout.py_TestGitIgnoreBasic_TestGitIgnoreBasic.test.None_9": {"doc_hash": "0d5ef3d8aa4af64f803a4f83cbe00911c36dcab682513bedb93d5755c7e25d6f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_checkout.py_TestGitIgnoreWhenCheckout_TestGitIgnoreWhenCheckout.test.None_12": {"doc_hash": "619a37fd71b9d346aef4c9923f002bcb0c3ca6738437aaf4f1832b209a353132"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_checkout.py_TestCheckoutMissingMd5InStageFile_TestCheckoutEmptyDir.test.self_assertEqual_len_os_l": {"doc_hash": "3232a1563e9521b7da551805009981f398ad0b4c9647f7c9b2d29b02cf7f6472"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_checkout.py_TestCheckoutNotCachedFile_TestCheckoutDirectory.test.self_assertTrue_os_path_e": {"doc_hash": "f317bea1c4d5058737ce8a2a5ff82a706c97ac04035bfaff040098b1ea6f7c7c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_checkout.py_TestCheckoutHook_TestCheckoutHook.test.with_self_assertRaises_Co.self_dvc_checkout_": {"doc_hash": "916edda5f818e444cbebf0d54e07046d42f63c79c24b012d5b4b260f7ed8e401"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_cli.py_os_TestArgParse.test.self_assertIsInstance_arg": {"doc_hash": "f46308bc2323c525b1eff26266e755945f61d022d757b77a44cbd08fd0a2c540"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_cli.py_TestRun_TestRun.test.self_assertEqual_args_com": {"doc_hash": "9fcd51076a7c672d22c0b54b33f897f396a108346eed8a81106ae70abba543bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_cli.py_TestPull_": {"doc_hash": "0854c78f4a7ff655e5ea6db961e972a26ba045c1ccffd2d26771d646618dde98"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_commit.py_yaml_TestCommitForce.test.self_assertEqual_self_dvc": {"doc_hash": "665310fa270787b7da5d1889a70230be1d4acc752d488d900382afd442bec76f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_commit.py_TestCommitWithDeps_TestCommitWithDeps.test.None_1.self_assertFalse_stage_ou": {"doc_hash": "54d396d9d479cabb086f4f707a961ace89db954af81237b8ccd3240346f1686c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_commit.py_TestCommitChangedMd5_": {"doc_hash": "b43f07b94183415fc6ac4367fb98e8fc9fab73e43ca98b56a13038a281763eff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_config.py_configobj_TestConfigCLI.test_root.None_1": {"doc_hash": "b9f9a69c817c9c7ff04cecca4895d1e71105f730157889ad3a8b108b8dac56df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_config.py_TestConfigCLI._do_test_TestConfigCLI.test_local.self__do_test_True_": {"doc_hash": "eba72efb6d86f7f8b331460f9a3a085824a760a76fa6c1ca6751c20d77e81e89"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_config.py_TestConfigCLI.test_non_existing_": {"doc_hash": "9c27a109dde883c8b2c15d4eb49852cb795be99a841fcaf5b87ec2c7896ad693"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_from_subprocess_import_Ca__should_test_aws.return.False": {"doc_hash": "42d456331a5d9da9eef5190799e72de53fb7d4f36e6bc8afc66aee4ad21f81c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py__should_test_gcp__should_test_gcp.return.False": {"doc_hash": "2c36baaa3b49151dbbed0fad9416990ca8bcaa071a80eac53d2e6a807485446d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py__should_test_azure__should_test_ssh.return.True": {"doc_hash": "0b657d08fec2455ee25bf302d278bad442e648bf87ebe5aa09a1b534067fde36"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py__should_test_hdfs__should_test_hdfs.return.True": {"doc_hash": "707d4e7b9d66c9552af6891b4e69227fdbeec7f61334c5200dfd25f00b534095"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_get_local_storagepath_get_azure_url.return._azure_format_co": {"doc_hash": "d50b2c65a19e0cddb69f5393dc5d384e5b5598b4f1afdfa659ac8ccffff4b29b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestDataCloud_TestDataCloud.test.for_scheme_cl_in_clist_.self__test_cloud_config_": {"doc_hash": "335a0da1916fd88e7cd21846f625896c9d8a5ab957167f24523995aed6e482eb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestDataCloudBase_TestDataCloudBase._setup_cloud.self_assertIsInstance_sel": {"doc_hash": "68ba65daf40213e8a05ba30ad3580355ca17467eea505e48c05e4e10f347e01b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestDataCloudBase._test_cloud_TestDataCloudBase.test.self__test_cloud_": {"doc_hash": "805860021a82e98167fcf966621af870b3cb663332f6353688392a6e944881b3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestRemoteS3_TestRemoteGS._get_cloud_class.return.RemoteGS": {"doc_hash": "38212620e6e4b3166e3159d27e9ff4fa07da37bdfe664841111c043c505f8ba6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestRemoteAzureCompat_TestRemoteHDFS._get_cloud_class.return.RemoteHDFS": {"doc_hash": "6686b2dc785400d0e8c5b1f27e0bceace3a8b3588bcb56a1587d728532263b44"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestDataCloudCLIBase_TestDataCloudCLIBase.test.if_self__should_test_.self__test_": {"doc_hash": "1e2f921394fd6759bfef59361133085e7024eb05763ba0f4d1e9eaa3a1789bb2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestCompatRemoteLOCALCLI_TestDataCloudErrorCLI.test_error.self_main_fail_fetch_": {"doc_hash": "ceb6eae765cbe70abb14c52bcb427c43984c7a0625209559195682b6e4350af2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestRecursiveSyncOperations_TestRecursiveSyncOperations._clear_local_cache.shutil_rmtree_self_dvc_ca": {"doc_hash": "3b7eaa66aae0cfb21bf6afc05180311a03980697ea840d1cdab9794021dd224f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestRecursiveSyncOperations._test_recursive_fetch_TestRecursiveSyncOperations._test_recursive_fetch.None_5": {"doc_hash": "07b7b04c89fa1ead57b057ea4f26f496be88d4c380573f87843858f0eaf88e26"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestRecursiveSyncOperations._test_recursive_push_TestRecursiveSyncOperations.test.self__test_recursive_pull": {"doc_hash": "51c19423c7f4a92bdc5c18d0b83b65df59ddf403efba77463d08940a1aabde82"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_dependency.py__": {"doc_hash": "db99062799fab460012ad60ec5c0cc40a8bcd0246df37a068dcc73b923bc94b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_destroy.py_os_": {"doc_hash": "76186786a760d708b8c381e0c9999625ee6eadc4311ea539482c8814c97f12d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_gc.py_os_TestGC._test_gc.for_c_in_self_good_cache_.self_assertTrue_os_path_e": {"doc_hash": "d0e850359b99c38e405878d5fc10f0fcc1b88f464c16c2ba2fd383b474798649"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_gc.py_TestGCBranchesTags_TestGCBranchesTags.test.self__check_cache_1_": {"doc_hash": "7b722a7339c5df7470ac18bddc3309a1937b19767d2ce2a54aea70ba24234a7d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_gc.py_TestGCMultipleDvcRepos_TestGCMultipleDvcRepos.setUp.self.additional_dvc_7.DvcRepo_self_additional_p": {"doc_hash": "ed26c7760c882645b78c713999bc49d8872ca8e436f2c84834d91dfe5956ffe7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_gc.py_TestGCMultipleDvcRepos.test_": {"doc_hash": "e6afecc855db51ee48ce7ee718781dc3354bb09c20028c13df641979dfd6c630"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_import.py_TestFailedImportMessage_TestFailedImportMessage._test.with_MockLoggerHandlers_l.self_assertIn_": {"doc_hash": "f9ced2b000b085012dc51fff1951c73a42babbc60b20a031b34235620f40e9b3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_import.py_TestInterruptedDownload_TestInterruptedDownload._import_with_interrupt.with_patch_.with_patch_.self_assertEqual_result_": {"doc_hash": "1d3de702013ff3730d1ff9bd7d71c0ed8a42e9856f40fadee0293d1b5b664f73"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_import.py_TestShouldResumeDownload_TestShouldResumeDownload.test.m_handle_write_assert_has": {"doc_hash": "cbb28ee449d021620fa9267bbf51ac9b1d8f4b8f4bdd931ea90b8650bcdaedd7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_init.py_os_": {"doc_hash": "5a1c40b25ddd61bc802ac7f675f1a399430418f580c6fcb003045903cf7c96fa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_install.py_os_": {"doc_hash": "2b809345e52665c8ba0e6e6ce5d1a7242ab9430f1e919f1e97340cc03b6ce60e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_lock.py_from_dvc_lock_import_Lock_": {"doc_hash": "6734dfec40257814a7a7fe24d3dc8a01898a2023dca28a200a8f27b35f995d17"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_logger.py_traceback_TestLogger.test_error_with_chained_exception_and_message.self_assertEqual_self_std": {"doc_hash": "424523517b77202b46b428bcddbae8f558d810efd33b2f1c0b256b4ecdcb1a9f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_logger.py_TestLogger.test_traceback_TestLogger.test_traceback.self_assertEqual_self_std": {"doc_hash": "6d1d0c9042c8f371054ea6f965b842c6e2bff7a220c8a04925510a5ca736e2d1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_logger.py_TestLogger.test_box_": {"doc_hash": "d2f7eb881a336d179a87d572157859321a146b1c1d7662d3d560f6a097837b49"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetrics.test_show_TestMetrics.test_show.None_23": {"doc_hash": "aa3522eef1645fdd27b94321b633879ee47091e6d2b38569e1067ddc1f668391"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetrics.test_unknown_type_ignored_TestMetrics.test_xpath_all_with_header.for_b_in_foo_bar_.self_assertSequenceEqual_": {"doc_hash": "40d3797e59b9db83d0f3af94c1e654c077174300cb96f3c7a83f9ce0d4606264"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetricsRecursive_TestMetricsRecursive.setUp.self_dvc_scm_checkout_ma": {"doc_hash": "2a01b0c72cb254148ddccbbe369ddfc676fe826a8751bc1986094e4728da9735"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetricsRecursive.test_TestMetricsRecursive.test.None_2": {"doc_hash": "48603f9581fd8cc02e8b3cef3056f23ceac1b7a060efc08dc4e747459774c62d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetricsReproCLI_TestMetricsReproCLI.test_binary.with_self_assertRaises_Dv.self_dvc_run_metrics_no_c": {"doc_hash": "f6df721d8e556658742d65928af069dfb709d9348df736bf5451f6109fe3f658"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetricsCLI_TestMetricsCLI.test.None_5": {"doc_hash": "af4163f1f7fb4622c9d763e108809bfef4653015802468f730c60919baa55916"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetricsCLI.test_dir_TestMetricsCLI.test_non_existing.None_2": {"doc_hash": "50953f40c16babf908cbac32e20d798bc6579c258e9a3749892a9ad9783ec58f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetricsCLI.test_wrong_type_show_TestMetricsCLI.test_wrong_type_show.with_MockLoggerHandlers_l.self_assertIn_": {"doc_hash": "975fb4d093a31f6bc1d3c26e973e76255e7bd7a12e298f38aabe7caf4b274c59"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestNoMetrics_TestCachedMetrics._do_add.self_dvc_scm_commit_branc": {"doc_hash": "aa4f33618734ffd09862b384c68aa08226c5429d76920215c28676bb811f5fb1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestCachedMetrics._do_run_TestCachedMetrics._do_run.self_dvc_scm_commit_branc": {"doc_hash": "118d9f784662d039ee0465abb4f67fad3651c9669880029b10bd34057e9cda59"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestCachedMetrics._test_metrics_": {"doc_hash": "3ad66b115cf452c2ceb7b51e92c3711fc659faff093bb47ce7906ee18c43dc7d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_move.py_os_TestMoveNotDataSource.test.self_assertNotEqual_ret_": {"doc_hash": "7393d064932e1ffa53a4528c925f2e821eba9d2be5f217dc4ca4bfaca39b185b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_move.py_TestMoveFileWithExtension_TestMoveFileWithExtension.test.None_7": {"doc_hash": "c2fe4c648a49f5241261ff3f3bc1fba1910292283743562b3f06fc74333ef676"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_move.py_TestMoveFileToDirectory_TestMoveFileToDirectory.test.None_6": {"doc_hash": "d97205ae43b32218ff80b55b3b471b529bd51a40f6ed0d22f610677c35e919fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_move.py_TestMoveFileToDirectoryWithoutSpecifiedTargetName_TestMoveFileToDirectoryWithoutSpecifiedTargetName.test.self_assertEqual_self_FOO": {"doc_hash": "5f0c55731bb973249bf61ffaabfc0bc3117ba36eee7eb219a2bec2c200fd61c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_move.py_TestMoveDirectoryShouldNotOverwriteExisting_TestMoveDirectoryShouldNotOverwriteExisting.test.self_assertEqual_os_listd": {"doc_hash": "ee8a99ab8e3e2cf0cc5603f1e79653017759b3d342273fabbe74924166e5ec38"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_output.py_from_dvc_stage_import_Sta_": {"doc_hash": "4ac7f5effbedbbeb2f18c58651f1c5c4be9f61b53b5ac0a71821aae6cf37b3ff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_pipeline.py_from_dvc_main_import_main_TestPipelineShowSingle.test_non_existing.self_assertNotEqual_ret_": {"doc_hash": "114c24b9ce745f237fca1dc5c958f8b811a311e9c8e1eec0f9375530abdb14ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_pipeline.py_TestPipelineShow_TestPipelineShow.test_non_existing.self_assertNotEqual_ret_": {"doc_hash": "46d8548762e8b05023151ed63f013cfa6fad472ba8f77af6ece5d61145141be6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_pipeline.py_TestPipelineShowDeep_TestPipelineShowDeep.test_non_existing.self_assertNotEqual_ret_": {"doc_hash": "4dc0dda6fd5173399e808c6af856e8d81f980d871df8f0cb63a8ce6a209e2fc9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_pipeline.py_TestPipelineListEmpty_TestDvcRepoPipeline.one_pipeline.None_5": {"doc_hash": "193171910a59fdeb6623f807368dc5b6e8799751a51a2d59e78d0e9bab9926ca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_pipeline.py_TestDvcRepoPipeline.two_pipelines_": {"doc_hash": "2dffa7b80795f300daf1431437b08310728a1d7b70cd855b0a73c99079fef707"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_remote.py_os_TestRemote.test.None_5": {"doc_hash": "7ef8c70970d9d5a2abe5b257cdfa7f2d3cc130ed779df25b73cf074a8a318b6e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_remote.py_TestRemote.test_failed_write_TestRemote.test_relative_path.self_assertEqual_config_": {"doc_hash": "7b66d1e7b1605c8ebb200612b54d6effa0ccd7e77588bc92446eeb9baad396cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_remote.py_TestRemoteRemoveDefault_TestRemoteRemoveDefault.test.None_1.self_assertTrue_Config_SE": {"doc_hash": "976f5f288ffd0d63fd42ca61a1a3e484942156cd2d8ee1ea355f567d1b906a02"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_remote.py_TestRemoteRemove_TestRemoteDefault.test.None_4": {"doc_hash": "d05e65993ad1128fc0ec7cfa6e841eb655d294a15aad8f2dabdf66041e0f0669"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_remote.py_TestRemoteShouldHandleUppercaseRemoteName_": {"doc_hash": "2c50b699006971b4c1ba3887c1f4a0f5b3fea2d0e2cbab229fac0b8f7decb1e3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_remove.py_os_TestRemove.test.None_8": {"doc_hash": "8f027df409d1696b35a1bec4a235b5c71e84c3da0e7dd4598cf680ef4b029434"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_remove.py_TestRemoveNonExistentFile_TestCmdRemove.test.self_assertNotEqual_ret_": {"doc_hash": "57158d0f6c38f903b77b00f03e415013ad00c3200163ad6fa8d6dd8d6a940210"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_remove.py_TestRemovePurge_": {"doc_hash": "e907635dbc0f73f037fd30360f87caf9ef9404a60e4ea66321689ff58063bfe5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestRepro_TestReproFail.test.self_assertNotEqual_ret_": {"doc_hash": "492d1f5ae27092b481006b74250fddca745a283cd1826a9ff737f906d44c527b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproCyclicGraph_TestReproCyclicGraph.test.with_self_assertRaises_Cy.self_dvc_reproduce_cycle": {"doc_hash": "f049b9ff05e900dbd745a170aa1bfbdae2c2317ee5c10039dba4aed10f163847"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproWorkingDirectoryAsOutput_TestReproWorkingDirectoryAsOutput.test.with_self_assertRaises_St.self_dvc_reproduce_faulty": {"doc_hash": "bea8f0d5bab8d47ac5b8ec2d84fc071f66bc2123ac9dcc492214fca78001a6aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproWorkingDirectoryAsOutput.test_nested_TestReproWorkingDirectoryAsOutput.test_nested.with_patch_object_DvcRepo.with_self_assertRaises_St.self_dvc_reproduce_error_": {"doc_hash": "39958b2932f6625e2a5aa278e4fea094f9e0fdc4b3a7a7de6ca90f65045ef0be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproWorkingDirectoryAsOutput.test_similar_paths_TestReproWorkingDirectoryAsOutput.test_similar_paths.try_.except_StagePathAsOutputE.self_fail_should_not_rai": {"doc_hash": "abb6fe166f5dcc5e58df13a2795cf4d1675500fd85280a9f29c4743372a414e1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproDepUnderDir_TestReproDepUnderDir.test.None_7": {"doc_hash": "fe0822e22356ffbc026efdd5c76c6ec07e1e993ce46054e7b359c613e767bb3b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproDepDirWithOutputsUnderIt_TestReproDepDirWithOutputsUnderIt.test.None_8": {"doc_hash": "4b7e657b6f734e5584195a57bc86aacfb63cf3cc1644dde7b8acb2c42dd1eb55"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproNoDeps_TestReproNoDeps.test.self_assertEqual_len_stag": {"doc_hash": "5f74d587a590b23f37d227be83d37ba125468c3be4b6bdf2c74f301906b991d6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproForce_TestReproChangedCode.swap_code.self_create_self_CODE_ne": {"doc_hash": "90d9413c90b72f636cd72d5a1ca53f70fcf10352c57d6a3ab033706620cd73d5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproChangedData_TestReproUpToDate.test.self_assertEqual_ret_0_": {"doc_hash": "8940a5ad69fcc2f1320a755e37928d53034758286d6f62e2bd63839b588221d5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproDryNoExec_TestReproDryNoExec.test.None_1": {"doc_hash": "be73f9bf0e0500a2f90f8a79dc16e6e5268b240fce52b64eba3884a99a2bc1b5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproChangedDeepData_TestReproChangedDeepData.test.self_assertEqual_len_stag": {"doc_hash": "5e3bf0fe420b5227e024ef8850610b4de447dcaf4c231d89264d34842b4d56b8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproIgnoreBuildCache_TestReproIgnoreBuildCache.test.self_assertEqual_stages_1": {"doc_hash": "9dd3eca9b08b436800ef5dc10803f6e3cf9de88b051e62dc080de19646fcbedc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproPipeline_TestReproPipelines.setUp.None_6": {"doc_hash": "cbed7ed1a559e3ee16a89cd014b8e982a772b6568cbb26e562ba9610be3de4f1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproPipelines.test_TestReproPipelines.test_cli.self_assertEqual_ret_0_": {"doc_hash": "9a9c5927c32e4133a94f600ee23bdfd2e32831d16c88aa15114c1e3ac0614e8f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproLocked_TestReproLocked.test_non_existing.self_assertNotEqual_ret_": {"doc_hash": "6b88981365f89b0d389fb490e1a282509b0e6b3b24d13d141c01eb7bd48f208d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproLockedCallback_TestReproLockedUnchanged.test.None_3": {"doc_hash": "2e5f0f283945e50fec634b5081a85f03cacee0a933c413ebc996626c59ff0ff5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproMetricsAddUnchanged_TestReproMetricsAddUnchanged.test.None_7": {"doc_hash": "561b066694ace8aba84e87e89833252f707fc703906bca4f80d19f952c4a7ebc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproPhony_TestReproDataSource.test.self_assertEqual_stages_0": {"doc_hash": "a8602d5910cd19efe60d7c7fef49ec344659c0afc08e03f1c1eadc60002a43a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproChangedDir_TestReproChangedDir.test.None_5": {"doc_hash": "a0a9ff8e12426342d78d61adfef46cb8644122cbabea311834d717c71999e730"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproChangedDirData_TestReproChangedDirData.test.None_9": {"doc_hash": "d78fa37db3de80af87f93c97ad606f98d71be731052eb459cecdd60318633a90"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproMissingMd5InStageFile_TestCmdRepro.test.self_assertNotEqual_ret_": {"doc_hash": "6b315eba6036f7dc8c5f38e4d56a38a5ab2f433ed96b0dc2f2568e5c716854f7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestCmdReproChdir_TestCmdReproChdir.test.None_11": {"doc_hash": "5697dba431b2061bb64b698544acbaf58774cadce47dbc1fb9f32df0df802940"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproExternalBase_TestReproExternalBase.check_already_cached.with_self_dvc_state_.with_patch_download_as_mo.with_patch_checkout_as_mo.with_patch_run_as_mock_ru.mock_checkout_assert_call": {"doc_hash": "ee0c0f0ee635b1ec794cd3126bf9a8f53fca8481f788ef69868dee1638a7de61"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproExternalBase.corrupted_cache_TestReproExternalBase.corrupted_cache.with_self_dvc_state_.with_patch_checkout_as_mo.with_patch_run_as_mock_ru.mock_checkout_assert_not_": {"doc_hash": "8b866c7c52d91c030c09883e56496750fa426cfffe4997196893332655599cbc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproExternalBase.test_TestReproExternalBase.test.self_corrupted_cache_": {"doc_hash": "4c7aa4af1d931f18232bca2f3a7663b8143bf418ec21646b65ddf418f1bcf0d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproExternalS3_TestReproExternalGS.write.bucket_blob_key_upload_f": {"doc_hash": "e88c00fcd3f6808e7e0fa63cf5f9fa3cded63d454acbaad99390508d5aaa9d9f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproExternalHDFS_TestReproExternalHDFS.write.None_2": {"doc_hash": "0749e1f2777744815ec095ab1207cfbcd83e0b80ea513935684c62fb0ce06a01"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproExternalSSH_TestReproExternalSSH.cmd.return._scp_format_i_o_": {"doc_hash": "05ec9a7e5002afd0e63e0d9995cca5868242420da53dbf67eb1aba3d5eabee8f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproExternalSSH.write_TestReproExternalSSH.write.with_sftp_open_path_w_.fobj_write_body_": {"doc_hash": "79a3831c02ded068dae0279ef1c0b3ef988ad988f54831c5b8d78e1295eea49d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproExternalLOCAL_TestReproExternalLOCAL.write.with_open_path_w_as_.fd_write_body_": {"doc_hash": "de4124c5cf400560be7e76660e4c19165e606e68f5ed39239e9d27a3a52d8d58"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproExternalHTTP_TestReproExternalHTTP.test.None_12": {"doc_hash": "755a959a822c7037cebef516b2bc2baebe52ff1ede4a636ef90f39b182b65854"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproShell_TestReproNoSCM.test.self_assertEqual_ret_0_": {"doc_hash": "c374785803a9555bcc08c8a1e722d89116c86c04414f8ab2730fb84eae083cb0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_os_from_tests_basic_env_impo": {"doc_hash": "44fc32ec99328bbefd6aa08850c86bd34bf0ae3df2dd20c9e85ee22c27f9b25b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRun_TestRun.test.with_self_assertRaises_Ou.self_dvc_run_": {"doc_hash": "66aa4e2e61fbed016a9885217f129ff74c566a73a69560d80549551b7c508dc6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunEmpty_TestRunMissingDep.test.with_self_assertRaises_Mi.self_dvc_run_": {"doc_hash": "209b1b74bdd5a4ea69f5e6dd08ca89ea44016f7b5e23e684fd246fe81d61d726"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunBadStageFilename_TestRunNoExec.test.self_assertFalse_os_path_": {"doc_hash": "6d8b84b61453af14ad587bd5520239d212599e9384162b2e78f09e2c9f0aa444"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunCircularDependency_TestRunCircularDependency.test_graph.with_self_assertRaises_Cy.self_dvc_run_": {"doc_hash": "b6522438ab56fa6d51a247c25570b1b9982ecebcdc2bc375d72d826837294cfb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunDuplicatedArguments_TestRunDuplicatedArguments.test_non_normalized_paths.with_self_assertRaises_Ar.self_dvc_run_": {"doc_hash": "18d1c234e091da30f7a36908f6c47352df23e305ff3c3123cf5c9bd51004d8e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunBadName_TestRunBadName.test_not_found.with_self_assertRaises_St.self_dvc_run_": {"doc_hash": "d7234ba20c2c07b11e60109870fbf186484c682884e90b315dbe22d192abcfac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestCmdRun_TestCmdRun.test_run.self_assertEqual_stage_cm": {"doc_hash": "2d80788b108415ccdb602ccce4b5c5b19d2f131287633a897bd28443f8d5693b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestCmdRun.test_run_args_from_cli_TestCmdRun.test_keyboard_interrupt.self_assertEqual_ret_252": {"doc_hash": "ba9f7e129735cfd4bdbce44855fdebfd0e5cb7043fb95935abf32f345458997d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunRemoveOuts_TestRunRemoveOuts.test.self_assertEqual_ret_0_": {"doc_hash": "dd2ceab7f7032d3093270546b211d26f796b408420b70dd05b5349c4b8e30cec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunUnprotectOutsCopy_TestRunUnprotectOutsCopy.test.None_7": {"doc_hash": "7740539d5d2ecb7d93b6df87affa09900df96a89a8c988292e968041e6fa5e69"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunUnprotectOutsSymlink_TestRunUnprotectOutsSymlink.test.None_10": {"doc_hash": "cd8b20d98255fe31510320e87fd82b03b93aaabbb39334f1fcacbbd36383e499"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunUnprotectOutsHardlink_TestRunUnprotectOutsHardlink.test.None_10": {"doc_hash": "5bedee79292c9b033e7195f06db76f6c6785c74cf3f86b3ea6dcc090fbbbd1e5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestCmdRunOverwrite_TestCmdRunOverwrite.test.None_9": {"doc_hash": "1c077ce0a1cddbcd5a52c03d7323bad7aae3ffe76f6337ee4bcfb3669c4a45cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestCmdRunCliMetrics_TestCmdRunCliMetrics.test_not_cached.self_assertEqual_open_me": {"doc_hash": "e87254021fb3ec87fad547ea0c9b3540782738efcada38f57dcc80f81c6dd3d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunDeterministicBase_TestRunDeterministicBase._run.self.stage.self_dvc_run_": {"doc_hash": "79f893bcce31d91608dd3679fe21b801ee9414612183d6fe5d6265be740ddfbe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunDeterministic_TestRunDeterministicChangedCmd.test.with_self_assertRaises_St.self__run_": {"doc_hash": "f094677a3aad96dd5f62ba6543e25259fdd520c8a7da80369fffebdc48e48604"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_stage.py_TestSchemaDepsOuts_TestSchemaDepsOuts.test_empty_list.None_1": {"doc_hash": "038a06b3c71101d23487715c7878acd1c522039ad9be1834bd47dbaa6b4dc8e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_stage.py_TestSchemaDepsOuts.test_list_TestSchemaDepsOuts.test_list.None_1": {"doc_hash": "f01a72ab99ccecfa0849d7da2ecaf73125d5772f82c48e5dfeba358b810f40db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_state.py_os_TestState.test_update.with_state_.None_2": {"doc_hash": "92d7ef568dc814aa609f38b1e18c88822658dc6d245d3de80a5b0dea173eebed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_status.py_os_": {"doc_hash": "4537a6b5802285eefa4f9d0f1e2e238583115c353b2af8625d591378bb4837f9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_system.py__": {"doc_hash": "05307307029acaaf4c82abc92587c0561600942f19f864ba72aca7da1fdf1a0a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_unprotect.py_os_": {"doc_hash": "170b7e359dbdbdcd66c210a4ba5d39fa19ce846b28ed61702e89db412d53514c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_updater.py_os_TestUpdater.test.os.environ.env_copy_": {"doc_hash": "619912b10c081659d8df846c2c38a69c013f2dffb8351eea6fbc51417f2a7935"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_updater.py_TestUpdater.test_check_version_newer_": {"doc_hash": "fb091045c63f9e33c136123e16b280793fe2ab8f2a13b3e336e8c4cbaf75353a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_utils.py_os_TestUtils.test_file_md5_crlf.self_assertEqual_utils_fi": {"doc_hash": "e276278992510edb76fe2dd2da975c7b147f3e37a8f67bfbd73e3b3c6de7bb0c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_utils.py_TestUtils.test_dict_md5_": {"doc_hash": "382b5e50874532494c243a00e25a636a4488ea4dbcd9398579a9a4df922e9ff6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/utils/httpd.py_hashlib_ContentMD5Handler.end_headers.SimpleHTTPRequestHandler_": {"doc_hash": "73ffc08bdc3b01dc22c3c4dacf7cc852ce72e1be4f8ddea2622c773e64b10269"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/utils/httpd.py_StaticFileServer_": {"doc_hash": "3eed8cba3590fdb3c4757bacd2d7c102e2b72f96a1f0adbada8b518afe8fe029"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/utils/logger.py_logging_": {"doc_hash": "13d7affe2c0e9b08be0d11e72d3baa8f61d8a47957a11800060b57f9c9c973c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage.validate_Stage._check_stage_path.if_not_real_path_os_pa.raise_StagePathOutsideErr": {"doc_hash": "d6fe6dbf870388040259193b7f3565d1b4205754cdf22199fdf6fe3fd4abac95"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage._compute_md5_Stage._compute_md5.return.m": {"doc_hash": "586feb04386871ab91b9c741e643485607165b78e0df12de01b6c59436eee5ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py__Helpers_for_other_modu_dos2unix.return.data_replace_b_r_n_b_": {"doc_hash": "d4f3cfa48797d066fa679e2321f6235a4a022f45644b097d8fd1cf913b1c2a8f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_file_md5_file_md5.if_os_path_exists_fname_.else_.return._None_None_": {"doc_hash": "824b9ad704583cbac54b91d499bee95bb709cef58cd1c8ef5ac9ae6c2506585e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/fs.py_from___future___import_un_get_mtime_and_size.return.str_int_nanotime_timestam": {"doc_hash": "42f87afe9ddc8e8e31d19489e78ca45a0355cb564212fe0c2a1a8cce3634732b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/fs.py_BasePathNotInCheckedPathException_": {"doc_hash": "8cc3e3a25de694168dd81275cb793b73df2d573e6cef14c2faf8668bf0e02ef7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestAddLocalRemoteFile_TestAddLocalRemoteFile.test.None_4": {"doc_hash": "3552a610ed403a9346a97c1ae3e12df38817e7f942a6db3b5c5ff4505fd215c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestShouldNotCheckCacheForDirIfCacheMetadataDidNotChange_TestShouldNotCheckCacheForDirIfCacheMetadataDidNotChange.test.with_patch_object_.None_4": {"doc_hash": "79e10f160519b08204a2da49ac01e6f14beb63412294f2c94c48eb679fc97030"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestShouldCollectDirCacheOnlyOnce_TestShouldCollectDirCacheOnlyOnce.test.self_assertEqual_1_colle": {"doc_hash": "cb75434d13327733fde5fd8f877b16c00f0ea00e73535a75ad254bd2c39e00aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_SymlinkAddTestBase_SymlinkAddTestBase._test.self_assertEqual_relative": {"doc_hash": "726b41558bd3f81bd6cc1f0aa215a318a39274c8bd77801e3b59591ee95d8f57"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestCmdReproChdirCwdBackwardCompatible_TestCmdReproChdirCwdBackwardCompatible.test.None_11": {"doc_hash": "d9bed8e3dde5c2aa1fd18a5ce86bcaadcab8172b4d469fd089af518a1510af2c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunStageInsideOutput_TestRunBadCwd.test_same_prefix.with_self_assertRaises_St.self_dvc_run_cmd_cwd_": {"doc_hash": "0ca91d0f0af03e9391b88c40c00e1daa1fc64bb74b58c2a558f130fc62203bf1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunBadWdir_TestRunBadWdir.test_not_dir.with_self_assertRaises_St.self_dvc_run_cmd_wdir": {"doc_hash": "d612414338fb34aeed0b18df17e6d6c4160485e7ffb77a5858f90d44525a15ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestCmdRunWorkingDirectory_TestCmdRunWorkingDirectory.test_default_wdir_is_written.None_1": {"doc_hash": "09153e0a60ff40be74030df6d71b36f75e958ef9e745d5ebdc6914f319970dde"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestCmdRunWorkingDirectory.test_fname_changes_path_and_wdir_TestCmdRunWorkingDirectory.test_fname_changes_path_and_wdir.self_assertEqual_d_Stage_": {"doc_hash": "df3e2216ef19762a543fea4562d00d348e59baabfde7573b7705931a737c998d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestCmdRunWorkingDirectory.test_cwd_is_ignored_TestCmdRunWorkingDirectory.test_cwd_is_ignored.self_assertEqual_": {"doc_hash": "3e0c929e271eeda88e5385a3d730eed9ffe67ec1924d654e17ea22a83f04710e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_stage.py_yaml_TestSchemaCmd.test_cmd_str.Stage_validate_d_": {"doc_hash": "081a812239d6ba5da8cae6e03bb1e0658d3a8587a3e77e522dfb42e0b78f2df8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_stage.py_TestReload_TestReload.test.self_assertEqual_d_stage_": {"doc_hash": "b1ac286481d01ced703817645c6d4b1d0ece6e6c93238e5c39c5a92f04845490"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_stage.py_TestDefaultWorkingDirectory_": {"doc_hash": "3e9fb7ac6d97fec7170466e0883a0c92a12a6a2d8e7bb031cc2a63866920c3b6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/add.py_from___future___import_un_CmdAdd.run.return.0": {"doc_hash": "be8c09b05f45aea751ee217947f43b771fa7038511edec79d26f23dcce8cc8e3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/add.py_add_parser_": {"doc_hash": "6c1e5e54ef64c2996e5f581f6155c9f59188bc5beef5f4308900f7367e153805"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_RemoteHDFS.upload_RemoteHDFS.upload.for_from_info_to_info_n.None_2": {"doc_hash": "fbbef349a64874ac8d128adccbe90a40d1275a8a117d629216724194c280ed45"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP._download_to_RemoteHTTP._download_to.move_partial_file_target": {"doc_hash": "10e2396e24d57310c2136ebdf3c96f956641ca6544c1534c31269f900c3797df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.download_RemoteLOCAL.download.for_to_info_from_info_n.try_.except_Exception_.continue": {"doc_hash": "addf3445beea319f95d13f78a15f49eccf03cbb2aca2327718960c9b50151554"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_from___future___import_un_from_tests_utils_logger_i": {"doc_hash": "0c7d13b938d616e799838d17f1b3fb852749ac1457ac92ee6dd7a7c5a4ef07c1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestAdd_TestAdd.test_unicode.self_assertTrue_os_path_i": {"doc_hash": "c203cac43da9d0ec67c18a7e52d9b4a4cb23a5e5530299e5aca0941a63ecb267"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestShouldAddDataFromExternalSymlink_TestShouldPlaceStageInDataDirIfRepositoryBelowSymlink.test.with_patch_object_.self_assertTrue_os_path_e": {"doc_hash": "331c4b2a11c3f4328e75c59cfff05ec5d7bf979547f97ba94cab0cab7305af0b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestShouldThrowProperExceptionOnCorruptedStageFile_TestShouldThrowProperExceptionOnCorruptedStageFile.test.with_MockLoggerHandlers_l.self_assertIn_": {"doc_hash": "a14662ce54ac8b2ba0b882afb11a71e614d18efe10e40d794457e81e68d3c66a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestWarnOnOutdatedStage_TestWarnOnOutdatedStage.test.with_ConsoleFontColorsRem.self__test_": {"doc_hash": "8cdca4e8655db332c4322104ec51eaa000a1d20c6b887a045215bbc3b3071c90"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproAllPipelines_TestReproNoCommit.test.self_assertEqual_len_os_l": {"doc_hash": "680473e76149a7a28009018cc6426aab5401e0095f4703c56ff3d0b231b16496"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproAlreadyCached_TestReproAlreadyCached.test_force_with_dependencies.self_assertNotEqual_run_o": {"doc_hash": "bd4de875d8e9bc4c577e1d26a7dc06b463f998d09e94db5553a3a4fc9f287ae5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/analytics.py_Analytics.collect_cmd_Analytics._is_enabled_config.return.core_get_Config_SECTION_C": {"doc_hash": "eb75f503a44352e667c5377ad7c3b29b874a0ba66ed43bc7e9039b75742be4f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/base.py_from___future___import_un_append_doc_link.return._message_ndocumentation": {"doc_hash": "e6e17ea2d50844ee099d48a80bfa82269b82c01594ca60cc1c2f410c29e65032"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_add_parser_add_parser.None_15": {"doc_hash": "268819919c7c9265cf2368ef277f47a76a8268a64384b0efac8dca1752a117e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_add_parser.None_16_": {"doc_hash": "6f7486d02e75545a314388cd55dd3089a36ead4b72f84a829432ff0e670cf621"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/init.py_from___future___import_un_CmdInit.run_cmd.return.0": {"doc_hash": "b5529a72aaee55775496ebc24aa9c53b43cd0e237180a2b3e1184c076f9a1206"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/init.py_add_parser_": {"doc_hash": "ad35f5883875f1b44d33b10079f4fdaeca3477ba1e3fc0343a8d1f6be0e350c0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/lock.py_from___future___import_un_CmdUnlock.run.return.self__run_True_": {"doc_hash": "e148ef7877816103b9ab16c289f760618afa66b754bc6560dcff02304881f816"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_from___future___import_un_show_metrics.for_branch_val_in_metric.for_fname_metric_in_val_.if_len_lines_1_.else_.logger_info_t_fo": {"doc_hash": "893849bdd60d0c9060d9e010c40466b9f90aff3338900a97ee93460b982ef277"}, "/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": "96517b1be959d89a4dddefb841fc401c9497118fd32dd802397e2c4b4d7606f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pipeline.py_CmdPipelineShow.__build_graph_CmdPipelineShow.__build_graph.return.nodes_edges_networkx_is": {"doc_hash": "010063cbfeb41f9045a82f47c191f925f75dca07eb07d24d9a5921be7d382192"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pipeline.py_CmdPipelineShow._show_ascii_CmdPipelineShow._show_dependencies_tree.tree_show_": {"doc_hash": "3b45c5f360c1fb2add0da7c06b80700fed03d871fc51d346e22758c96d3b00f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pipeline.py_CmdPipelineShow.__write_dot_CmdPipelineList.run.return.0": {"doc_hash": "1841681a48f8bfbeb6f35becb28fa22075a66ee04d242c0f0a39ca01e29bb52c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pkg.py_from___future___import_un_CmdPkg.run.pass": {"doc_hash": "3a6fc3e56d2a1552f4e3ec57ff4b100463f3a21c6673478b83e9a352941d4566"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pkg.py_add_parser_": {"doc_hash": "a35cd359bf1c00fb322f065613412077113a4e451aa6390eb0063ccfd5bca9ff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/tag.py_yaml_CmdTagList.run.return.0": {"doc_hash": "ed724937f751ba62c629aca1eca1318630d81db1a67361345ac87896726a54f4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/tag.py_add_parser_": {"doc_hash": "4ff03dc48caa40c5e8e611ab62256519a376a8d5f77e73a891ecf1067ad6e028"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_NotDvcRepoError_RecursiveAddingWhileUsingFilename.__init__.super_RecursiveAddingWhil": {"doc_hash": "0bbca815d24fd72e588e3de644068e431a800973d4728d6e49d35368dfc3c341"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_OverlappingOutputPathsError_": {"doc_hash": "8b088e0ae4f31b44a6ba10005908533d115c4ed4dc452a8832e79d299e5e8346"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/__init__.py_from___future___import_un_None_4": {"doc_hash": "cf970e90b81d82e154c1ae2e6965c4ffded4ead639a94920ddb85bfaf8cb69b5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/__init__.py__get__get.return.OutputLOCAL_": {"doc_hash": "7c28f5c1c03ca657d04c90020bc8b09891f8899fe22d4d5cc6df74cce8190494"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase_OutputBase.commit.if_self_use_cache_.getattr_self_repo_cache_": {"doc_hash": "497b7a4852fcb8dddd52284a99ab1b95d388bd79ba046a8e068f80319cb6eb3c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.dumpd_OutputBase.dumpd.return.ret": {"doc_hash": "6fd5b819a787337eadf27c69b04ea4cae7e3b5ca4c8db9895b00ed4de05182c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/progress.py_Progress._bar_Progress.__exit__.self__lock_release_": {"doc_hash": "2f9380b486ac36069e4c485c587f0cecf9c279d7c65596c65674b90b36f33ca9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/progress.py_progress_aware_": {"doc_hash": "a53e5aae063017fefd4fcc811049de987f1f6a31053ef6c1a0372774b26aa05f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.do_checkout_RemoteLOCAL.do_checkout.self_state_update_link_pa": {"doc_hash": "25df3ccbfa9182f5974ab1c8e0c08e61124abf7e9548502e87aa49f6a58679e1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.already_cached_RemoteLOCAL._move.move_tmp_outp_": {"doc_hash": "0df7d562abb65a028e2eac7c7d53b14b8a17618488ba53714910c6da85d0c33a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._save_file_RemoteLOCAL._save_file.return._self_PARAM_CHECKSUM_md5": {"doc_hash": "e609dcba72ef85f46d41000959cf89976786b8a12da609eb1cf7f91a520f2e84"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.status_RemoteLOCAL._fill_statuses.for_md5_info_in_checksum.info_status_status": {"doc_hash": "75fd2b7b72a8da9960d87b28b89bac1c9ca81579a566d5315718e2cf740e3409"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.push_RemoteLOCAL._cache_metadata_changed.return.True": {"doc_hash": "3821d3dd57bfdc26c773b9888af964af18b39a01ab47c69498bc935e004e5b4c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._log_missing_caches_RemoteLOCAL._log_missing_caches.if_missing_caches_.logger_warning_msg_": {"doc_hash": "b1a2d3b0baad9de260fa186bafba94819240299160a03b5947a7d74b73cfc923"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._unprotect_file_": {"doc_hash": "3758b9b7ac6acfb60a49d0a0868fd4ee5d16617594b29ad77a33f35a2f62d04c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3_RemoteS3.remove.self_s3_delete_object_": {"doc_hash": "c5d4729511d85ae718426490c2cc91921332beb0ad1e850ec2781fc7574b0537"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3._list_paths_RemoteS3.exists.return.any_path_info_path_": {"doc_hash": "622049d312c91bf92e9556afc2eef07325ce19272635012576a08eb88dd424fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3.upload_RemoteS3.upload.for_from_info_to_info_n.progress_finish_target_na": {"doc_hash": "d2fc75127533e96e9a3aa35321f3a6494b3fb04c04a78775744a8adf873bf0f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_errno_create_cb.return.lambda_cur_tot_percent_": {"doc_hash": "73dead8551cc5290a380fe976ab79b5f2bbd281155cc9481ace3a40d0701eb6b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.walk_files_SSHConnection.walk_files.for_entry_in_dir_entries_.if_S_ISDIR_entry_st_mode_.elif_S_ISREG_entry_st_mod.yield_path": {"doc_hash": "b262f1e2666668fb0e8140c64a68872c240a54f4090e674f08aa81a2cf023139"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.remove_SSHConnection.download.os_rename_tmp_file_dest_": {"doc_hash": "53238422098e68847b3d140f4ca693704ce8d0c5a661d3539f3191fd0828d583"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/brancher.py_brancher_": {"doc_hash": "ce653c0c0dd715baf7c625f122650dbeb0db23409e2ed4e47641253716e47f1c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/checkout.py_from___future___import_un_get_progress_callback.return.ProgressCallback_total_fi": {"doc_hash": "bd14431e4db3566b91f61d96a99194680f8695bac448aaf2ba5d9f256c9ee1ca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/checkout.py_checkout_": {"doc_hash": "e36ebd156d6a33e3404aa33adb4a4403ecf1d1d2c6ef8af2c3e8159748a3ac3b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/show.py__format_csv__format_csv.return._n_join_lines_": {"doc_hash": "999cabd1bc400ebcbfeb58e63216bf07d0a60807f3de240faf2ef4d6b5691820"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/show.py__format_output__format_output.return.content": {"doc_hash": "69900d3ac211864344e27c154717df32a6c428cf7f9c9f1821d72e52063e1143"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/show.py__read_metric__read_metric.try_.except_Exception_.return.None": {"doc_hash": "54323a2d7f97ee806daa1b07d688b7d13dd7d474e596763c3961209c0a952b18"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/show.py__read_metrics_filesystem__read_metrics.return.res": {"doc_hash": "626b2a0c5e28565ad67c9c5357b0a7cad3a890630bed692506e3748010d247f7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/show.py_show_": {"doc_hash": "a421d7f5ef7f85f89ca94b4e25cd1e87f6652c0be1c38c7752e88a61bb179ab6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/pkg.py_from___future___import_un_Package.is_in_root.return.True": {"doc_hash": "b78ab7c6182037b57bcd248a891cd65294572588cb85bec693374e190ba0775a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/pkg.py_GitPackage_GitPackage.install_or_update.parent_repo_checkout_dvc_": {"doc_hash": "37ea05138545bfc2c2e7c3ada7d397d1554b9c68d7c653daf587a8786db23eab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/pkg.py_GitPackage.persist_stage_and_scm_state_GitPackage.persist_stage_and_scm_state.stage_dump_": {"doc_hash": "93d10313d6b7feed40d89d942d0aa9cd84010f681a3b56314e59071cd898e6ef"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/pkg.py_GitPackage.create_module_dir_GitPackage.get_dvc_file_name.return.dvc_file_path": {"doc_hash": "d0d63b0f1b71be333113f45eca8c13a4d6866e67930d64c312443c0ad021a133"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/pkg.py_install_pkg_": {"doc_hash": "ac7ea3bafb5d2f8a5037dfafb695fc65d82cb7ef77b9ecfb72a030748d3a44a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/scm_context.py__": {"doc_hash": "a13c10b180fbfe413d7eca34fa668e8336a425bb0ef7d25224f27d8ee3d60457"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tag/__init__.py_Tag_": {"doc_hash": "ba74dad76851f143f3201d93fbbc2485a596c32a51026c06a351642c03d22133"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tag/add.py__": {"doc_hash": "40206386c3fc59d6e691adcde87d4f86f1571d1cb09d148c7caec25b7f785dc6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tag/list.py__": {"doc_hash": "c3f2d17647d497db5d4130801561ef0a141451f45b90992b94c5a18dedec0da3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tag/remove.py__": {"doc_hash": "26f39ac655a110dba323117c910f339aca141e696327b6902cbd06f4665a060d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/base.py__Manages_source_control_FileNotInTargetSubdirError._Thrown_when_trying_to_": {"doc_hash": "50be8fdb372c0190d79839c9c6101d881e9fd76d29b1ffb5c0dae4470470d4af"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/base.py_Base_": {"doc_hash": "1e62be8dba8fdc6d61c354d18b3a5f3051abb216754a69462b5a299eec8fca34"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py__Manages_Git__Git.ignore_file.return.self_GITIGNORE": {"doc_hash": "c6c5e6b642dda9463315291437b37df68910900cf57a6d4a59c2c40f8417c50a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git._get_gitignore_Git._get_gitignore.return.entry_gitignore": {"doc_hash": "54e5e437607e0599bc683ca6e3d9402ba46d50f79835001a25853b5c489c6f5f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.ignore_Git.ignore.self_ignored_paths_append": {"doc_hash": "7c69de759cd9870cb32ce3ffcaeac4322adf238f06307456a4bf7cd6ad02e034"}, "/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.ignore_remove.self_track_file_os_path_r": {"doc_hash": "5d4aa465c2a8b450501f39ab405fa189bedaf02e24a92f38bb329c72cb9fdab8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.add_Git.add.try_.except_AssertionError_.logger_error_msg_": {"doc_hash": "84e86d45e39c114d21f4180be06ab24986e84b5afbecf98924562b2dd44c4ed0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.commit_": {"doc_hash": "06823d8d10b5c2e231e7b289e2817b612b19f34a6143bf5d96986d34a711ac7d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_errno_GitTree.open.return.StringIO_obj_data_stream_": {"doc_hash": "33aef1f90596fac914fe98d809f81cbc9c510eb1cf56a5a37462e82114bdb761"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_GitTree.exists_": {"doc_hash": "9441b4697d772b12fa6b0ca22924a9fd9da8613ec8ee95f623ee917648d4b3a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/tree.py_os_BaseTree.walk._Directory_tree_generat": {"doc_hash": "5a5b8668282407673c58b6e6f00cc3859fb7a1074971b35e8948028fb110d135"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/tree.py_WorkingTree_WorkingTree.isfile.return.os_path_isfile_path_": {"doc_hash": "508422df88326048463ca879af820a71880f71c3b39a76c00a8ec736f91336a6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/tree.py_WorkingTree.walk_": {"doc_hash": "a9937551990e1fbd39ac6e6fd2e119c590c2acc0ab60428fba3fa3f8583910f7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage._fill_stage_outputs_Stage._fill_stage_outputs.None_4": {"doc_hash": "675f0bcbcd536e24527bb6ba5a66fd9c7a5af6a0c005230d18663f850567052e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage._check_dvc_filename_Stage._get_path_tag.return.match_group_path_matc": {"doc_hash": "355728c4f201facb2cd9564f7c1a290998c97f45009bbe182e437e4c83466868"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage.dumpd_Stage.dump.self_repo_scm_track_file_": {"doc_hash": "c1364d7bc9ac83ad04bbc6f33a3aee21e30d0789543de7fac6c4017f51ab25d6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/temp_git_repo.py_os_TempGitRepo._clone_to_temp_dir.return.result": {"doc_hash": "fc1f40ef9db2e38b6635f640851b1e22f146e83a46404a8fb8d9d39fd7fcb4f1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/temp_git_repo.py_TempGitRepo._remove_git_files_and_dirs_TempGitRepo._remove_git_files_and_dirs.for_item_in_TempGitRepo_G.if_os_path_exists_fname_.os_remove_fname_": {"doc_hash": "b6e81898b1f8cc519009213065ff8c5bf18fa2b2fbee4d22bd9ca0dfb78fdb32"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/temp_git_repo.py_TempGitRepo._clean_mod_temp_dir_TempGitRepo.persist_to.self__reset_state_": {"doc_hash": "923b479f933793d8b0ef2eb1c12ad48e5c37d56676043549a616ce2597601fe3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/temp_git_repo.py_TempGitRepo._move_all_cache_files_": {"doc_hash": "06e17c2078532b42dda9c6a2f02edceecc6df9a2df9e1603b132d1e2091fe3b8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/compat.py__Handle_import_compatib_encode.return.u_encode_encoding_repla": {"doc_hash": "6024b4a88250dbe04507c84a8fda3ed280a94e1e4cbaeed40a9014f18d5973a6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/compat.py_csv_reader_csv_reader.if_is_py3_.else_.for_row_in_reader_._noqa_F821": {"doc_hash": "aebe4cc6361e811ccc8edfa153de493a91e5ecd2aae8c00c64d9924bc60c9220"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/compat.py_utf_8_encoder__makedirs.try_.except_OSError_.if_not_exist_ok_or_not_os.raise": {"doc_hash": "76cba49db66dc891b7e70d36d851bc98d3510ea6206c33ad15d13e8a40d41f69"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py__encoding_utf_8_TestDirFixture.tearDown.self__popd_": {"doc_hash": "255d3aa9d706e415027b54a3cb930f200ce62da48d31fb56c3721ba1a20a8609"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py_TestGitFixture_TestGitFixture.setUp.self_git_index_commit_ad": {"doc_hash": "fe323640c023f9b776b5b02da4fd7bf66b543154f7e4d586d3c5259fa7ccbdd2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py_TestGitSubmoduleFixture_TestDvcGitInitializedFixture.setUp.self_git_init_": {"doc_hash": "daa4075cf4410d9ccb2ff13bbcf818e7997e4ef3847ac7de0a5312126e321e92"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py_TestDvcDataFileFixture_TestDvcDataFileFixture.setUp.self_git_index_commit_He": {"doc_hash": "0ffc1259705cbda2885a34451d4b46b67207ba4b78656739e01138bcec3cb294"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py__NOTE_Inheritance_order_TestDvc.__init__.TestCase___init___self_m": {"doc_hash": "cd7be39d53330f2a8f03b528f7f41f415de7db7404967f2cba419d5ff37aa248"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py_TestDvcPkg_": {"doc_hash": "d0a8404b0e373419fdbca6f43b0d0faf6be4ff2b0b28cc2dba30fd5a9222f876"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestAddFilename_TestAddFilename.test.None_10": {"doc_hash": "59e93bef8c0bee548010ce6a43f10c705e9068f20af2ee462302ea0644d90ca1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestShouldCleanUpAfterFailedAdd_TestShouldCleanUpAfterFailedAdd.test.self_assertNotIn_se": {"doc_hash": "e96326804f1796724d2991bbe7f6a23beaf3737192ac308f3133b38c3c60b5d4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestShouldNotTrackGitInternalFiles_": {"doc_hash": "9736b2e3969689d186ed9fdef04aa49500a17255d2547aafce8ab31906f30186"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_analytics.py_os_TestAnalytics.test_send.self_assertTrue_mockpost_": {"doc_hash": "b808b6c8c3ac177093742e9e01c96b6d63d3159c6187106aefec20c57eaf8873"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_analytics.py_TestAnalytics.test_send_failed_TestAnalytics.test_send_failed.self_assertTrue_mockpost_": {"doc_hash": "b7c8d3106e978efbafc39e50c94fae4af296df60b2aee3d104be00471912011a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_checkout.py_os_from_tests_utils_logger_i": {"doc_hash": "2126afc9c304057d2201ceb7ca3359962ca080ccbd38b06cfc4055693a8f8c64"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_checkout.py_TestCheckout_TestCheckout._test_checkout.self_assertTrue_filecmp_c": {"doc_hash": "c3987ece3fb91e0fd247f1845b4bd386c075e96643eb59a764532854ca24df88"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_checkout.py_TestCheckoutCorruptedCacheDir_TestCheckoutCorruptedCacheDir.test.self_assertFalse_os_path_": {"doc_hash": "e20f453accbfd33538e9a6dd2820749abb5a13b3b1532a4526a33c721d6061a0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_checkout.py_TestCmdCheckout_CheckoutBase.outs_info.return._": {"doc_hash": "f7d604d846cf9082cae4e77096d4946688b009be7a67cef718dc6b854c490d30"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_checkout.py_TestCheckoutSuggestGit_TestCheckoutSuggestGit.test.None_1.except_DvcException_as_ex.self_assertIsNone_exc_cau": {"doc_hash": "3932c0218e7f6e7abe1f49f60794c71b3a5928814dac57e01a5f7128c44f0637"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_checkout.py_TestCheckoutShouldHaveSelfClearingProgressBar_TestCheckoutShouldHaveSelfClearingProgressBar.test.self_assertTrue_finish_ba": {"doc_hash": "e45638b5b73f30d483da4613a50df71f163ee542251ab09d1d611fa2ef0ca4ce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_checkout.py_TestCheckoutShouldHaveSelfClearingProgressBar.filter_out_empty_write_calls_TestCheckoutShouldHaveSelfClearingProgressBar._prepare_repo.os_unlink_self_BAR_": {"doc_hash": "2b8e852d2fcba08a1e2011a6518461228e523a1dac8c2d0e6a781d700bb6e3d1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_checkout.py_TestCheckoutShouldHaveSelfClearingProgressBar._checkout_and_intercept_std_output_TestCheckoutShouldHaveSelfClearingProgressBar.assertAnyEndsWith.self_assertTrue_any_ub_fo": {"doc_hash": "39c87180adf80d82d4684ebfa245138e5fe23bbbde90479ebcfe4560654a8d4f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_checkout.py_TestCheckoutTargetRecursiveShouldNotRemoveOtherUsedFiles_": {"doc_hash": "ab3d45d7ab9544774171a5d0a61761c114b435af5b733ac7b9b95a6ff41792b9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestCheckSumRecalculation_TestCheckSumRecalculation.test.self_assertEqual_test_col": {"doc_hash": "89c572d644fceffd273c0707157181764d60dd564bda0fd88392fb7d6e95e5fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestShouldWarnOnNoChecksumInLocalAndRemoteCache_TestShouldWarnOnNoChecksumInLocalAndRemoteCache.setUp.self.message_foo_part._nname_md5_n_f": {"doc_hash": "25edd78eccfe4e4034eb499f126fed7a927c2b601d6c37353db6cb2e143802ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestShouldWarnOnNoChecksumInLocalAndRemoteCache.stderr_contains_message_": {"doc_hash": "6bd162f13264eff1587d8f34eb5b16e8f0fd7f46ba0cd530eba1642e85dde0db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_import.py_dvc_TestDefaultOutput.test.self_assertEqual_open_fil": {"doc_hash": "f6397285d66a2464ba728b5e1d395fa3bdf47b72aa03497126a6ced46067f2cb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_import.py_TestShouldNotResumeDownload_TestShouldNotResumeDownload.test.m_handle_write_assert_has": {"doc_hash": "7cf53f3315cb1ab9dfdfec1c297a9fd7ba7dc9685d363cef53d0df3a8c56cb03"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_import.py_TestShouldRemoveOutsBeforeImport_": {"doc_hash": "d65f68cac8b5db412ba49ccecce1bc4580afc12efe2642f2b96976cccb4829f5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py__coding_utf_8__TestMetrics.setUp.self_dvc_scm_checkout_ma": {"doc_hash": "8a3414c889664c88314f524a8f66ae5bf284a5a6f812dd329dafde61f8abae1c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetrics.test_formatted_output_TestMetrics.test_formatted_output.None_3": {"doc_hash": "2c7213483a545a1fbdf54ec4ce27c29e7804b0eeda37decee7d73d746260cd19"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetrics.test_formatted_output.with_MockLoggerHandlers_l_TestMetrics.test_formatted_output.with_MockLoggerHandlers_l.self_assertIn_expected_js": {"doc_hash": "9f9da79b989810f856cabb0c9955ed1f812b233a6a5228aa1a920285714f455c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetricsCLI.test_wrong_type_add_TestMetricsCLI.test_wrong_type_add.with_MockLoggerHandlers_l.None_6": {"doc_hash": "1724cd57b0baddff194293a1229bbddc8f8ab1050e414eb4147297902f237911"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetricsCLI.test_wrong_type_modify_TestMetricsCLI.test_wrong_type_modify.with_MockLoggerHandlers_l.None_6": {"doc_hash": "1b44dec6f66aa3d3e1e4f8f338766b5c41076dec35f38f376977c38b98015dfe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_move.py_TestMoveFileBetweenDirectories_TestMoveFileBetweenDirectories.test.self_assertEqual_": {"doc_hash": "4443a4fd08d1bb5d70d765ce3a9b7e76272f51b38b66537b26a72228fd5ed330"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_move.py_TestMoveFileInsideDirectory_": {"doc_hash": "ee3667e07df3db192ecaead8ff59cdefff0173fdd4587860917fe578690b5205"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_pkg.py_os_": {"doc_hash": "371886cc11fe9d66f0cfd80f4f72170b89650f9682a77f176b0dd833f4054473"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repo.py_from_tests_basic_env_impo_TestCollect.setUp.self_dvc_scm_checkout_ma": {"doc_hash": "50c867d682f1d5f20247379421b07409535df6c0fd9b0b33069295b07ff7e91a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repo.py_TestCollect._check_": {"doc_hash": "c4e29fe9b217203b9173f88f46940f296c35ef04893c3658859556673e9caaed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_from_dvc_logger_import_lo_from_tests_utils_logger_i": {"doc_hash": "4580cd2fc7414d269c604032d7696abaf23336b8cb443d15692f3868e8878145"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/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": "33f0616841d47ced0b90c6b01fd5c8ac6c9f7dd102e7098ea77d2f6ebff41661"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestShouldDisplayMetricsOnReproWithMetricsOption_": {"doc_hash": "70d0eecac537dc217c0ceff44a6d1cd5cfc9b6439fa7c79e36496193f2e15d78"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunCommit_TestRunCommit.test.None_5": {"doc_hash": "225d32a4fed807c8bfb7a360ebacc1f03e807d9a5963861eba01f760d1453889"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunPersist_TestRunPersist.should_remove_persistent_outs.self_assertFalse_os_path_": {"doc_hash": "26bafb72c370defc247e87cb222b386a8e6478ff67f402b20297eb11d2225222"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunPersistOuts_TestShouldRaiseOnOverlappingOutputPaths.test.None_4": {"doc_hash": "3a05dedf8bf270200f5e0a6008a2f123e091938b40c80d461fbbd035bf54ff03"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRerunWithSameOutputs_TestRerunWithSameOutputs._run_twice_with_same_outputs.None_2": {"doc_hash": "20aac8cf25e718f76f4ce8407884531119805831301fd3d02a55266bb961a791"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestNewRunShouldRemoveOutsOnNoPersist_": {"doc_hash": "ed5bd7d23d340e0009aea942539381300d6d4dbed981d0d871483964a146102d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_scm.py_from___future___import_un_TestSCM.test_git.self_assertIsInstance_SCM": {"doc_hash": "c65ca0c4138f331d42a8c3bdd66786f6bc68d2265ae9d529ae2ba94351949f16"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_scm.py_TestSCMGit_TestSCMGit.test_is_tracked.None_10": {"doc_hash": "8eec931fc3e812abd3c7b4d09e30de80f913262719c4e8a4fd3a182b6d7f501b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_scm.py_TestSCMGitSubmodule_TestIgnore.test_ignore.None_6": {"doc_hash": "e44a25cd0a5ba2bbb69be283e1024027d504e8ffd9ea5fa77a6c2b3e9c21f8c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_scm.py_TestIgnore.test_get_gitignore_TestIgnore.test_get_gitignore.None_3": {"doc_hash": "d86c2da3947fddd77e249f238af16906fc6af24ad6455bfd7ffb2e2eb99f5f63"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_scm.py_TestIgnore.test_get_gitignore_subdir_TestIgnore.test_get_gitignore_subdir.None_3": {"doc_hash": "97fe27239f6f44e2ae7ca1df8070434405b110331cda7f3c3fea3df3631d48d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_scm.py_TestIgnore.test_get_gitignore_ignorefile_dir_": {"doc_hash": "6c5eac0dfe29a6d55b0ac1851829347e4eacc31985eba0cf770945e8cc724298"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_state.py_TestStateOverflow_TestStateOverflow.test.None_2": {"doc_hash": "d500f5796c9fc0028a6168be6ba02e30ace46cfb47d342ad2205e3b2314ccd58"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_state.py_TestGetStateRecordForInode_": {"doc_hash": "19dc11b417a64298f7f3da2b2f4fa493e258a46bb110e29af0d98db9c50d9acc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_tag.py_os_TestTag.test.None_12": {"doc_hash": "00bcb6889c2f1f177c86f601ceceff4a55e92af33e91abf22640b6eaf48374e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_tag.py_TestTagAll_TestTagAll.test.None_2.self_assertEqual_logg": {"doc_hash": "26f99bea8306cfbcdd115b951360a4bed644885152a43750a3c6d5a458e8877f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_tag.py_TestTagAddNoChecksumInfo_TestTagAddNoChecksumInfo.test.with_MockLoggerHandlers_l.self_assertEqual_": {"doc_hash": "b64ba413182649bc9c5aec27f02481e5f8038550644062249b8e5ad2c804f5f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_tag.py_TestTagRemoveNoTag_": {"doc_hash": "d7645c42e588b2a3f3dd630841799ac213d8794507cc5b6da73e5cc26139f607"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_tree.py__encoding_utf_8_TestWorkingTree.test_isfile.None_2": {"doc_hash": "71f91db64d9d53e84361c9ec648a9158b9c573f5d92bdc24eb800eca362000a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_tree.py_TestGitTree_TestGitTree.test_isfile.None_4": {"doc_hash": "c18eb41e566b05e0ac122b3eef8ad7cdd4fae01c1b7a08a81cbe0727f46c6891"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_tree.py_AssertWalkEqualMixin_TestWalkInNoSCM.test_subdir.self_assertWalkEqual_": {"doc_hash": "5455fb35156a2d9e6eb6f7f670b7eba49a945179320cc70cc736b40819877e7a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_tree.py_TestWalkInGit_TestWalkInGit.test_nobranch.None_1": {"doc_hash": "c046dc6e8b7deae84945a48b2138ebe296dabb398b3a5d869ad26f77f23865c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_tree.py_TestWalkInGit.test_branch_": {"doc_hash": "6dc05d570521aa9a4260fa156f4d82b1046a976bc92772517932d6d5662fe17b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_run.py_mock_TestCli.test_file_name.cmd_mock_return_value_run": {"doc_hash": "112c9910cd5ea62dd043f6231013d639a2fa0792489f3d7eea18836cf6895f0f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_run.py_TestCli.test_file_name_default_TestCli.test_file_name_default.cmd_mock_return_value_run": {"doc_hash": "a393fdf7fcd3c4bdb7c0c7a9d8743d56bd9404b7dfa48cb4abb37e0e6f127bdd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_run.py_TestCli.test_wdir_TestCli.test_wdir.cmd_mock_return_value_run": {"doc_hash": "3692da87cf7a41dbe2fea1b1a3f1a292dc73c2bd343e09cd3c57ca1a492cca4b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_run.py_TestCli.test_wdir_default_": {"doc_hash": "14b4835b2486ea265636735bbb32fbd9d528cf2562969639707ea1fbfb32281f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_gs.py__": {"doc_hash": "d06416eaf067906769fec1122d17c6ef45362ed9b1bacde25941e933e28b8e5c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_hdfs.py__": {"doc_hash": "e24401d6875c606b2604b7a46852ecba0fc0d44ce0d75fbee60bbf25c38c8161"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_http.py__": {"doc_hash": "f870feb0e06a1de67ecb4f5a86d343d9d64f481348d9ccbe2416086e66b905be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_local.py_mock_": {"doc_hash": "fcb0cff4a47b23e253e54ea3c19ff8901ee91a479f6d9c606b067d5add1a771e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_s3.py__": {"doc_hash": "9592b1772c870aee1a0e161e2c1cfaca666d9dcb87db0001e2a1e6a897ae3143"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_ssh.py__": {"doc_hash": "51cab0b039a4d34cbd7be185d168d8976bf074e33cc386ca07e8bf1d9b411b0c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_gs.py__": {"doc_hash": "5f6f66ee8aee1b06d5f239f3b11d60786d241ca290ebe19e99ac33562ff56bab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_hdfs.py__": {"doc_hash": "99bca3c724b5e6b17ddb11e2adcdc5a7828167ed5d271a269bf982ac1d9e7a1d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_local.py_from_mock_import_patch_TestOutputLOCAL.test_save_missing.with_patch_object_o_remot.with_self_assertRaises_o_.o_save_": {"doc_hash": "71493c1e3a14b8ea8d55789ff596b7beb9d3f4af1554386d09ef629eb01be7f7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_local.py_TestGetFilesNumber_": {"doc_hash": "c100f2be9a566d1d9917997d31d388319455564df61798162fb2bb3534faad11"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_s3.py__": {"doc_hash": "6e8af605edf0a174deda32cc17b480be9d8640f7e90c7e9e748e07dc9d520061"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_ssh.py__": {"doc_hash": "9dd95d3c08383b2acdf62667be446a5e242acdd57895696444e3127e87d48f3c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_getpass_TestRemoteSSH.test_user.None_2": {"doc_hash": "13c97021466e3240d28644fd59fd1217a1dda1abb64be73c0eb59b10521d7e37"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_TestRemoteSSH.test_url_TestRemoteSSH.test_url.None_7": {"doc_hash": "e7ebc7027c3a3532354a531ff53a232d41fc34f82c882b0a5a4ca5734908d965"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_TestRemoteSSH.test_no_path_": {"doc_hash": "1f5e24ad1de319cb27f63d9e2496adb24e9bbf55722d384b85d41842957ce614"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_azure.py_from_unittest_import_Test_": {"doc_hash": "c099379a6fd8d41123885a026db7e0ae1c0051d5900d196402d8734352ec1c03"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_base.py_mock_TestMissingDeps.test.for_remote_class_in_remot.with_mock_patch_object_re.with_self_assertRaises_Re.remote_class_None_": {"doc_hash": "cc9363890a5d29391098c186ae43ad1f0439a69cc7b7f016a86b5e61e5834d4b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_base.py_TestCmdError_TestCmdError.test.for_remote_class_in_Remo.with_mock_patch_object_.with_self_assertRaises_Re.remote_class_repo_config": {"doc_hash": "7f0a17175142da28647b79c77d32754e4c9b2f9111b7a364e51fc78383f0ed38"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_base.py_TestCacheExists_": {"doc_hash": "b441e95f4c34f3b7399a9f5fb1271987c188123eafc5faa8efd678fcc3e5f7f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_gs.py_mock_": {"doc_hash": "b784c59b5856a249c0a791f24a937dccd34032b7f606c8ace561e37edefa0f6d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/scm/test_git.py_os_": {"doc_hash": "cdb986474faebfb1a7d21069c3560497582c9f3501239950cdea639f5b563d1f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/scm/test_scm.py_from_dvc_repo_import_Repo_": {"doc_hash": "4d3aaa895338edf7471034916130b6206f35510eca6df232dc503cd5a581379f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_daemon.py_os_": {"doc_hash": "8965bb20f95b9f3c5a03924ce8c6d720e66085aff6c11fd0bcfbba1ca60fe3b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_progress.py_mock_": {"doc_hash": "0aca8d51cce52da2207ab366e64d85ec9d21010b30900e27ef806bf27d859308"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_prompt.py__": {"doc_hash": "fa80963ec14d06d6aecd755aded0d6cb161f82fd555107a04616a2a577ad995c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_repo.py__": {"doc_hash": "190a13a0756038c88b3edfb34cb4cf57b3cd40bfb3508a187f30e1636cebb1fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_stage.py_mock_TestStageChecksum.test.with_mock_patch_object_st.self_assertEqual_": {"doc_hash": "280142ed499101124aece2d2cc89be775e67901d0cda671d78a5c53f1d3d3597"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_stage.py_TestStageChecksum.test_wdir_default_ignored_TestStageChecksum.test_wdir_default_ignored.with_mock_patch_object_st.self_assertEqual_": {"doc_hash": "80fb336c7c20193d0521840749c0cfee9dcabab90934bf47f7667f94d2c543d6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_stage.py_TestStageChecksum.test_wdir_non_default_is_not_ignored_": {"doc_hash": "ba5f373472c26cb69160dc6fa26cc19d8621e73a83b8e8835ca80515ab6905bb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_updater.py_os_mocked_requests_get.return.MockResponse_version_": {"doc_hash": "509a278e618b91095a7b58b3583aec57cc72a3f73c59c6fba97848ffbf2a001a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_updater.py_TestUpdater_": {"doc_hash": "edf2ec0dd6cbd02d3c97ae89c8bc892167de5696867ce2401f6f0475ea63b3f0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_os_TestMtimeAndSize.test.self_assertEqual_dir_size": {"doc_hash": "96148ac29196d84eb69f038147af66d35054aa4c95a0a7d9b16433794b281190"}, "/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/tests/unit/utils/test_fs.py_TestContainsLink.test_should_call_recursive_on_no_condition_matched_TestContainsLink.test_should_call_recursive_on_no_condition_matched.with_patch_object_.self_assertEqual_2_conta": {"doc_hash": "4e8ca8014ff973e6f44cc8f3571cf27175835ac5a98f722f65d7cd76939fc9fb"}, "/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_": {"doc_hash": "9fa1b06094207ad40a24b30bd221f564a2b6a49ed2f364c06681e8c27a35d1a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/utils/__init__.py_yaml_": {"doc_hash": "e9132cdf36a2aa86279bbb1eddd6dcc7268a1d64863a33f1d5e1b1bc08375680"}}, "docstore/data": {"/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/__init__.py____update_version_file.return.ver": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/__init__.py____update_version_file.return.ver", "embedding": null, "metadata": {"file_path": "dvc/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 45, "span_ids": ["_update_version_file", "docstring"], "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": "\"\"\"\nDVC\n----\nMake your data science projects reproducible and shareable.\n\"\"\"\n\nfrom __future__ import unicode_literals\n\nimport os\nimport warnings\n\n\nVERSION_BASE = \"0.33.1\"\n__version__ = VERSION_BASE\n\nPACKAGEPATH = os.path.abspath(os.path.dirname(__file__))\nHOMEPATH = os.path.dirname(PACKAGEPATH)\nVERSIONPATH = os.path.join(PACKAGEPATH, \"version.py\")\n\n\ndef _update_version_file():\n \"\"\"Dynamically update version file.\"\"\"\n try:\n from git import Repo\n from git.exc import InvalidGitRepositoryError\n except ImportError:\n return __version__\n\n try:\n repo = Repo(HOMEPATH)\n except InvalidGitRepositoryError:\n return __version__\n\n sha = repo.head.object.hexsha\n short_sha = repo.git.rev_parse(sha, short=6)\n dirty = \".mod\" if repo.is_dirty() else \"\"\n ver = \"{}+{}{}\".format(__version__, short_sha, dirty)\n\n # Write a helper file, that will be installed with the package\n # and will provide a true version of the installed dvc\n with open(VERSIONPATH, \"w+\") as fobj:\n fobj.write(\"# AUTOGENERATED by dvc/__init__.py\\n\")\n fobj.write('version = \"{}\"\\n'.format(ver))\n\n return ver", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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__remove_version_file_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/__init__.py__remove_version_file_", "embedding": null, "metadata": {"file_path": "dvc/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 48, "end_line": 99, "span_ids": ["impl:11", "_remove_version_file"], "tokens": 482}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _remove_version_file():\n \"\"\"Remove version.py so that it doesn't get into the release.\"\"\"\n if os.path.exists(VERSIONPATH):\n os.unlink(VERSIONPATH)\n\n\nif os.path.exists(os.path.join(HOMEPATH, \"setup.py\")):\n # dvc is run directly from source without installation or\n # __version__ is called from setup.py\n if (\n os.getenv(\"APPVEYOR_REPO_TAG\", \"\").lower() != \"true\"\n and os.getenv(\"TRAVIS_TAG\", \"\") == \"\"\n and os.getenv(\"DVC_TEST\", \"\").lower() != \"true\"\n ):\n __version__ = _update_version_file()\n else: # pragma: no cover\n _remove_version_file()\nelse: # pragma: no cover\n # dvc was installed with pip or something. Hopefully we have our\n # auto-generated version.py to help us provide a true version\n try:\n from dvc.version import version\n\n __version__ = version\n except Exception:\n pass\n\nVERSION = __version__\n\n\n# Ignore numpy's runtime warnings: https://github.com/numpy/numpy/pull/432.\n# We don't directly import numpy, but our dependency networkx does, causing\n# these warnings in some environments. Luckily these warnings are benign and\n# we can simply ignore them so that they don't show up when you are using dvc.\nwarnings.filterwarnings(\"ignore\", message=\"numpy.dtype size changed\")\nwarnings.filterwarnings(\"ignore\", message=\"numpy.ufunc size changed\")\n\n# Ignore paramiko's warning: https://github.com/paramiko/paramiko/issues/1386.\n# This only affects paramiko 2.4.2 and should be fixed in the next version.\n# Cryptography developers decided that it is a brilliant idea not to inherit\n# from DeprecationWarning [1] because it is invisible by default, and decided\n# to spam everyone instead. So it is their fault and not paramiko's.\n#\n# [1] https://github.com/pyca/cryptography/blob/2.6.1/src/cryptography/\n# utils.py#L14\ntry:\n from cryptography.utils import CryptographyDeprecationWarning\n\n warnings.simplefilter(\"ignore\", CryptographyDeprecationWarning)\nexcept ImportError:\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/__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": 11, "span_ids": ["docstring"], "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": "\"\"\"Main entry point for dvc command line tool.\"\"\"\n\nfrom __future__ import unicode_literals\n\nimport sys\n\nfrom dvc.main import main\n\nif __name__ == \"__main__\":\n 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/analytics.py__Collect_and_send_usage_Analytics._collect_linux.return.info": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/analytics.py__Collect_and_send_usage_Analytics._collect_linux.return.info", "embedding": null, "metadata": {"file_path": "dvc/analytics.py", "file_name": "analytics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 142, "span_ids": ["Analytics.load", "Analytics._read_user_id", "Analytics._write_user_id", "Analytics._collect_windows", "Analytics._get_user_id", "Analytics.__init__", "Analytics._collect_darwin", "docstring", "Analytics", "Analytics._collect_linux"], "tokens": 900}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Collect and send usage analytics\"\"\"\n\nfrom __future__ import unicode_literals\n\nfrom dvc.utils.compat import str\n\nimport os\nimport json\nimport errno\n\nimport dvc.logger as logger\nfrom dvc import VERSION\n\n\nclass Analytics(object):\n \"\"\"Class for collecting and sending usage analytics.\n\n Args:\n info (dict): optional existing analytics report.\n \"\"\"\n\n URL = \"https://analytics.dvc.org\"\n TIMEOUT_POST = 5\n\n USER_ID_FILE = \"user_id\"\n\n PARAM_DVC_VERSION = \"dvc_version\"\n PARAM_USER_ID = \"user_id\"\n PARAM_SYSTEM_INFO = \"system_info\"\n\n PARAM_OS = \"os\"\n\n PARAM_WINDOWS_VERSION_MAJOR = \"windows_version_major\"\n PARAM_WINDOWS_VERSION_MINOR = \"windows_version_minor\"\n PARAM_WINDOWS_VERSION_BUILD = \"windows_version_build\"\n PARAM_WINDOWS_VERSION_SERVICE_PACK = \"windows_version_service_pack\"\n\n PARAM_MAC_VERSION = \"mac_version\"\n\n PARAM_LINUX_DISTRO = \"linux_distro\"\n PARAM_LINUX_DISTRO_VERSION = \"linux_distro_version\"\n PARAM_LINUX_DISTRO_LIKE = \"linux_distro_like\"\n\n PARAM_SCM_CLASS = \"scm_class\"\n PARAM_IS_BINARY = \"is_binary\"\n PARAM_CMD_CLASS = \"cmd_class\"\n PARAM_CMD_RETURN_CODE = \"cmd_return_code\"\n\n def __init__(self, info=None):\n from dvc.config import Config\n from dvc.lock import Lock\n\n if info is None:\n info = {}\n\n self.info = info\n\n cdir = Config.get_global_config_dir()\n try:\n os.makedirs(cdir)\n except OSError as exc:\n if exc.errno != errno.EEXIST:\n raise\n\n self.user_id_file = os.path.join(cdir, self.USER_ID_FILE)\n self.user_id_file_lock = Lock(cdir, self.USER_ID_FILE + \".lock\")\n\n @staticmethod\n def load(path):\n \"\"\"Loads analytics report from json file specified by path.\n\n Args:\n path (str): path to json file with analytics report.\n \"\"\"\n with open(path, \"r\") as fobj:\n analytics = Analytics(info=json.load(fobj))\n os.unlink(path)\n return analytics\n\n def _write_user_id(self):\n import uuid\n\n with open(self.user_id_file, \"w+\") as fobj:\n user_id = str(uuid.uuid4())\n info = {self.PARAM_USER_ID: user_id}\n json.dump(info, fobj)\n return user_id\n\n def _read_user_id(self):\n if not os.path.exists(self.user_id_file):\n return None\n\n with open(self.user_id_file, \"r\") as fobj:\n try:\n info = json.load(fobj)\n return info[self.PARAM_USER_ID]\n except json.JSONDecodeError as exc:\n logger.debug(\"Failed to load user_id: {}\".format(exc))\n return None\n\n def _get_user_id(self):\n from dvc.lock import LockError\n\n try:\n with self.user_id_file_lock:\n user_id = self._read_user_id()\n if user_id is None:\n user_id = self._write_user_id()\n return user_id\n except LockError:\n msg = \"Failed to acquire '{}'\"\n logger.debug(msg.format(self.user_id_file_lock.lock_file))\n\n def _collect_windows(self):\n import sys\n\n version = sys.getwindowsversion() # pylint: disable=no-member\n info = {}\n info[self.PARAM_OS] = \"windows\"\n info[self.PARAM_WINDOWS_VERSION_MAJOR] = version.major\n info[self.PARAM_WINDOWS_VERSION_MINOR] = version.minor\n info[self.PARAM_WINDOWS_VERSION_BUILD] = version.build\n info[self.PARAM_WINDOWS_VERSION_SERVICE_PACK] = version.service_pack\n return info\n\n def _collect_darwin(self):\n import platform\n\n info = {}\n info[self.PARAM_OS] = \"mac\"\n info[self.PARAM_MAC_VERSION] = platform.mac_ver()[0]\n return info\n\n def _collect_linux(self):\n import distro\n\n info = {}\n info[self.PARAM_OS] = \"linux\"\n info[self.PARAM_LINUX_DISTRO] = distro.id()\n info[self.PARAM_LINUX_DISTRO_VERSION] = distro.version()\n info[self.PARAM_LINUX_DISTRO_LIKE] = distro.like()\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/analytics.py_Analytics._collect_system_info_Analytics.collect.try_.except_NotDvcRepoError_.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/analytics.py_Analytics._collect_system_info_Analytics.collect.try_.except_NotDvcRepoError_.pass", "embedding": null, "metadata": {"file_path": "dvc/analytics.py", "file_name": "analytics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 144, "end_line": 177, "span_ids": ["Analytics.collect", "Analytics._collect_system_info"], "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 Analytics(object):\n\n def _collect_system_info(self):\n import platform\n\n system = platform.system()\n\n if system == \"Windows\":\n return self._collect_windows()\n\n if system == \"Darwin\":\n return self._collect_darwin()\n\n if system == \"Linux\":\n return self._collect_linux()\n\n raise NotImplementedError\n\n def collect(self):\n \"\"\"Collect analytics report.\"\"\"\n from dvc.scm import SCM\n from dvc.utils import is_binary\n from dvc.repo import Repo\n from dvc.exceptions import NotDvcRepoError\n\n self.info[self.PARAM_DVC_VERSION] = VERSION\n self.info[self.PARAM_IS_BINARY] = is_binary()\n self.info[self.PARAM_USER_ID] = self._get_user_id()\n\n self.info[self.PARAM_SYSTEM_INFO] = self._collect_system_info()\n\n try:\n scm = SCM(root_dir=Repo.find_root())\n self.info[self.PARAM_SCM_CLASS] = type(scm).__name__\n except NotDvcRepoError:\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/analytics.py_Analytics._is_enabled_Analytics._is_enabled.return.enabled": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/analytics.py_Analytics._is_enabled_Analytics._is_enabled.return.enabled", "embedding": null, "metadata": {"file_path": "dvc/analytics.py", "file_name": "analytics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 211, "end_line": 240, "span_ids": ["Analytics._is_enabled"], "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 Analytics(object):\n\n @staticmethod\n def _is_enabled(cmd=None):\n from dvc.config import Config\n from dvc.repo import Repo\n from dvc.exceptions import NotDvcRepoError\n from dvc.command.daemon import CmdDaemonBase\n\n if os.getenv(\"DVC_TEST\"):\n return False\n\n if isinstance(cmd, CmdDaemonBase):\n return False\n\n if cmd is None or not hasattr(cmd, \"config\"):\n try:\n dvc_dir = Repo.find_dvc_dir()\n config = Config(dvc_dir)\n assert config is not None\n except NotDvcRepoError:\n config = Config(validate=False)\n assert config is not None\n else:\n config = cmd.config\n assert config is not None\n\n enabled = Analytics._is_enabled_config(config)\n logger.debug(\n \"Analytics is {}.\".format(\"enabled\" if enabled else \"disabled\")\n )\n return 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/dvc/analytics.py_Analytics.send_cmd_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/analytics.py_Analytics.send_cmd_", "embedding": null, "metadata": {"file_path": "dvc/analytics.py", "file_name": "analytics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 236, "end_line": 268, "span_ids": ["Analytics.send_cmd", "Analytics.send"], "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 Analytics(object):\n\n @staticmethod\n def send_cmd(cmd, args, ret):\n \"\"\"Collect and send analytics for CLI command.\n\n Args:\n args (list): parsed args for the CLI command.\n ret (int): return value of the CLI command.\n \"\"\"\n from dvc.daemon import daemon\n\n if not Analytics._is_enabled(cmd):\n return\n\n analytics = Analytics()\n analytics.collect_cmd(args, ret)\n daemon([\"analytics\", analytics.dump()])\n\n def send(self):\n \"\"\"Collect and send analytics.\"\"\"\n import requests\n\n if not self._is_enabled():\n return\n\n self.collect()\n\n logger.debug(\"Sending analytics: {}\".format(self.info))\n\n try:\n requests.post(self.URL, json=self.info, timeout=self.TIMEOUT_POST)\n except requests.exceptions.RequestException as exc:\n logger.debug(\"Failed to send analytics: {}\".format(str(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/cache.py__Manages_cache_of_a_dvc_": {"__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_", "embedding": null, "metadata": {"file_path": "dvc/cache.py", "file_name": "cache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 93, "span_ids": ["Cache.gs", "Cache", "Cache.azure", "Cache.s3", "Cache._get_remote", "Cache.ssh", "Cache.__init__", "Cache.hdfs", "docstring", "Cache.local"], "tokens": 579}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Manages cache of a dvc repo.\"\"\"\n\nfrom __future__ import unicode_literals\n\nimport os\n\nfrom dvc.config import Config\n\n\nclass Cache(object):\n \"\"\"Class that manages cache locations of a dvc repo.\n\n Args:\n repo (dvc.repo.Repo): repo instance that this cache belongs to.\n \"\"\"\n\n CACHE_DIR = \"cache\"\n\n def __init__(self, repo):\n from dvc.remote import Remote\n\n self.repo = repo\n\n config = repo.config.config[Config.SECTION_CACHE]\n local = config.get(Config.SECTION_CACHE_LOCAL)\n\n if local:\n name = Config.SECTION_REMOTE_FMT.format(local)\n sect = repo.config.config[name]\n else:\n default_cache_dir = os.path.join(repo.dvc_dir, self.CACHE_DIR)\n cache_dir = config.get(Config.SECTION_CACHE_DIR, default_cache_dir)\n cache_type = config.get(Config.SECTION_CACHE_TYPE)\n protected = config.get(Config.SECTION_CACHE_PROTECTED)\n\n sect = {\n Config.PRIVATE_CWD: config.get(\n Config.PRIVATE_CWD, repo.dvc_dir\n ),\n Config.SECTION_REMOTE_URL: cache_dir,\n Config.SECTION_CACHE_TYPE: cache_type,\n Config.SECTION_CACHE_PROTECTED: protected,\n }\n\n self._local = Remote(repo, sect)\n\n self._s3 = self._get_remote(config, Config.SECTION_CACHE_S3)\n self._gs = self._get_remote(config, Config.SECTION_CACHE_GS)\n self._ssh = self._get_remote(config, Config.SECTION_CACHE_SSH)\n self._hdfs = self._get_remote(config, Config.SECTION_CACHE_HDFS)\n self._azure = self._get_remote(config, Config.SECTION_CACHE_AZURE)\n\n @property\n def local(self):\n \"\"\"Remote instance for local cache.\"\"\"\n return self._local\n\n @property\n def s3(self):\n \"\"\"Remote instance for AWS S3 cache.\"\"\"\n return self._s3\n\n @property\n def gs(self):\n \"\"\"Remote instance for Google Cloud Storage cache.\"\"\"\n return self._gs\n\n @property\n def ssh(self):\n \"\"\"Remote instance for SSH cache.\"\"\"\n return self._ssh\n\n @property\n def hdfs(self):\n \"\"\"Remote instance for HDFS cache.\"\"\"\n return self._hdfs\n\n @property\n def azure(self):\n \"\"\"Remote instance for azure cache.\"\"\"\n return self._azure\n\n def _get_remote(self, config, name):\n from dvc.remote import Remote\n\n remote = config.get(name, None)\n if not remote:\n return None\n\n name = Config.SECTION_REMOTE_FMT.format(remote)\n sect = self.repo.config.config[name]\n return Remote(self.repo, sect)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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__Command_line_interface_VersionAction.__call__.sys_exit_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cli.py__Command_line_interface_VersionAction.__call__.sys_exit_0_", "embedding": null, "metadata": {"file_path": "dvc/cli.py", "file_name": "cli.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 90, "span_ids": ["VersionAction.__call__", "docstring", "DvcParser", "DvcParser.error", "VersionAction"], "tokens": 485}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Command line interface for dvc.\"\"\"\n\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport sys\nimport argparse\n\nimport dvc.logger as logger\nfrom dvc.command.base import fix_subparsers\nimport dvc.command.init as init\nimport dvc.command.pkg as pkg\nimport dvc.command.destroy as destroy\nimport dvc.command.remove as remove\nimport dvc.command.move as move\nimport dvc.command.unprotect as unprotect\nimport dvc.command.run as run\nimport dvc.command.repro as repro\nimport dvc.command.data_sync as data_sync\nimport dvc.command.gc as gc\nimport dvc.command.add as add\nimport dvc.command.imp as imp\nimport dvc.command.config as config\nimport dvc.command.checkout as checkout\nimport dvc.command.remote as remote\nimport dvc.command.cache as cache\nimport dvc.command.metrics as metrics\nimport dvc.command.install as install\nimport dvc.command.root as root\nimport dvc.command.lock as lock\nimport dvc.command.pipeline as pipeline\nimport dvc.command.daemon as daemon\nimport dvc.command.commit as commit\nimport dvc.command.tag as tag\nfrom dvc.exceptions import DvcParserError\nfrom dvc import VERSION\n\n\nCOMMANDS = [\n init,\n pkg,\n destroy,\n add,\n remove,\n move,\n unprotect,\n run,\n repro,\n data_sync,\n gc,\n add,\n imp,\n config,\n checkout,\n remote,\n cache,\n metrics,\n install,\n root,\n lock,\n pipeline,\n daemon,\n commit,\n tag,\n]\n\n\nclass DvcParser(argparse.ArgumentParser):\n \"\"\"Custom parser class for dvc CLI.\"\"\"\n\n def error(self, message):\n \"\"\"Custom error method.\n Args:\n message (str): error message.\n\n Raises:\n dvc.exceptions.DvcParser: dvc parser exception.\n \"\"\"\n logger.error(message)\n self.print_help()\n raise DvcParserError()\n\n\nclass VersionAction(argparse.Action): # pragma: no cover\n # pylint: disable=too-few-public-methods\n \"\"\"Shows dvc version and exits.\"\"\"\n\n def __call__(self, parser, namespace, values, option_string=None):\n print(VERSION)\n sys.exit(0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cli.py_get_parent_parser_get_parent_parser.return.parent_parser": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cli.py_get_parent_parser_get_parent_parser.return.parent_parser", "embedding": null, "metadata": {"file_path": "dvc/cli.py", "file_name": "cli.py", "file_type": "text/x-python", "category": "implementation", "start_line": 89, "end_line": 110, "span_ids": ["get_parent_parser"], "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 get_parent_parser():\n \"\"\"Create instances of a parser containing common arguments shared among\n all the commands.\n\n When overwritting `-q` or `-v`, you need to instantiate a new object\n in order to prevent some weird behavior.\n \"\"\"\n parent_parser = argparse.ArgumentParser(add_help=False)\n\n log_level_group = parent_parser.add_mutually_exclusive_group()\n log_level_group.add_argument(\n \"-q\", \"--quiet\", action=\"store_true\", default=False, help=\"Be quiet.\"\n )\n log_level_group.add_argument(\n \"-v\",\n \"--verbose\",\n action=\"store_true\",\n default=False,\n help=\"Be verbose.\",\n )\n\n return parent_parser", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cli.py_parse_args_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cli.py_parse_args_", "embedding": null, "metadata": {"file_path": "dvc/cli.py", "file_name": "cli.py", "file_type": "text/x-python", "category": "implementation", "start_line": 113, "end_line": 159, "span_ids": ["parse_args"], "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 parse_args(argv=None):\n \"\"\"Parses CLI arguments.\n\n Args:\n argv: optional list of arguments to parse. sys.argv is used by default.\n\n Raises:\n dvc.exceptions.DvcParserError: raised for argument parsing errors.\n \"\"\"\n parent_parser = get_parent_parser()\n\n # Main parser\n desc = \"Data Version Control\"\n parser = DvcParser(\n prog=\"dvc\",\n description=desc,\n parents=[parent_parser],\n formatter_class=argparse.RawTextHelpFormatter,\n )\n\n # NOTE: On some python versions action='version' prints to stderr\n # instead of stdout https://bugs.python.org/issue18920\n parser.add_argument(\n \"-V\",\n \"--version\",\n action=VersionAction,\n nargs=0,\n help=\"Show program's version.\",\n )\n\n # Sub commands\n subparsers = parser.add_subparsers(\n title=\"Available Commands\",\n metavar=\"COMMAND\",\n dest=\"cmd\",\n help=\"Use dvc COMMAND --help for command-specific help.\",\n )\n\n fix_subparsers(subparsers)\n\n for cmd in COMMANDS:\n cmd.add_parser(subparsers, parent_parser)\n\n args = parser.parse_args(argv)\n\n return args", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/base.py_CmdBase_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/base.py_CmdBase_", "embedding": null, "metadata": {"file_path": "dvc/command/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 21, "end_line": 61, "span_ids": ["CmdBase.run_cmd", "CmdBase.run", "CmdBase.default_targets", "CmdBase", "CmdBase.__init__", "CmdBase.set_loglevel"], "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 CmdBase(object):\n def __init__(self, args):\n from dvc.repo import Repo\n\n self.repo = Repo()\n self.config = self.repo.config\n self.args = args\n self.set_loglevel(args)\n\n @property\n def default_targets(self):\n \"\"\"Default targets for `dvc repro` and `dvc pipeline`.\"\"\"\n from dvc.stage import Stage\n\n msg = \"assuming default target '{}'.\".format(Stage.STAGE_FILE)\n logger.warning(msg)\n return [Stage.STAGE_FILE]\n\n @staticmethod\n def set_loglevel(args):\n \"\"\"Sets log level from CLI arguments.\"\"\"\n if args.quiet:\n logger.be_quiet()\n\n elif args.verbose:\n logger.be_verbose()\n\n def run_cmd(self):\n from dvc.lock import LockError\n\n try:\n with self.repo.lock:\n return self.run()\n except LockError:\n logger.error(\"failed to lock before running a command\")\n return 1\n\n # Abstract methods that have to be implemented by any inheritance class\n def run(self):\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/command/cache.py_from___future___import_un_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/cache.py_from___future___import_un_", "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": 66, "span_ids": ["imports", "CmdCacheDir.run", "CmdCacheDir", "add_parser"], "tokens": 408}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import unicode_literals\n\nimport argparse\n\nfrom dvc.command.base import fix_subparsers, append_doc_link\nfrom dvc.command.remote import CmdRemoteAdd\nfrom dvc.command.config import CmdConfig\n\n\nclass CmdCacheDir(CmdConfig):\n def run(self):\n self.args.name = \"cache.dir\"\n self.args.value = CmdRemoteAdd.resolve_path(\n self.args.value, self.configobj.filename\n )\n\n return super(CmdCacheDir, self).run()\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\", 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_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 default=None,\n help=\"Path to cache directory. Relative paths are resolved relative \"\n \"to the current directory and saved to config relative to the \"\n \"config file location.\",\n )\n cache_dir_parser.set_defaults(func=CmdCacheDir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/checkout.py_from___future___import_un_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/checkout.py_from___future___import_un_", "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": 56, "span_ids": ["imports", "CmdCheckout", "add_parser", "CmdCheckout.run"], "tokens": 318}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import unicode_literals\n\nimport argparse\n\nfrom dvc.command.base import CmdBase, append_doc_link\n\n\nclass CmdCheckout(CmdBase):\n def run(self):\n if not self.args.targets:\n self.repo.checkout(force=self.args.force)\n else:\n for target in self.args.targets:\n self.repo.checkout(\n target=target,\n with_deps=self.args.with_deps,\n force=self.args.force,\n recursive=self.args.recursive,\n )\n return 0\n\n\ndef 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 \"-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 \"-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 \"-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(\"targets\", nargs=\"*\", help=\"DVC files.\")\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_from___future___import_un_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_from___future___import_un_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": 30, "span_ids": ["imports", "CmdCommit", "CmdCommit.run"], "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": "from __future__ import unicode_literals\n\nimport argparse\n\nimport dvc.logger as logger\nfrom dvc.exceptions import DvcException\nfrom dvc.command.base import CmdBase, append_doc_link\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.error(\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/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": 33, "end_line": 68, "span_ids": ["add_parser"], "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 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 checksums 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\", nargs=\"*\", default=None, help=\"DVC files.\"\n )\n commit_parser.set_defaults(func=CmdCommit)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/config.py_from___future___import_un_CmdConfig.run.if_self_args_unset_.else_.return.self__set_section_opt_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/config.py_from___future___import_un_CmdConfig.run.if_self_args_unset_.else_.return.self__set_section_opt_s", "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": 81, "span_ids": ["CmdConfig._show", "imports", "CmdConfig.run_cmd", "CmdConfig.run", "CmdConfig._unset", "CmdConfig._set", "CmdConfig", "CmdConfig.__init__"], "tokens": 536}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 __future__ import unicode_literals\n\nimport os\nimport argparse\n\nimport dvc.logger as logger\nfrom dvc.command.base import CmdBase, append_doc_link\nfrom dvc.config import Config\nfrom dvc.exceptions import DvcException\n\n\nclass CmdConfig(CmdBase):\n def __init__(self, args):\n from dvc.repo import Repo, NotDvcRepoError\n\n self.args = args\n\n try:\n dvc_dir = os.path.join(Repo.find_root(), Repo.DVC_DIR)\n saved_exc = None\n except NotDvcRepoError as exc:\n dvc_dir = None\n saved_exc = exc\n\n self.config = Config(dvc_dir, validate=False)\n if self.args.system:\n self.configobj = self.config._system_config\n elif self.args.glob:\n self.configobj = self.config._global_config\n elif self.args.local:\n if dvc_dir is None:\n raise saved_exc\n self.configobj = self.config._local_config\n else:\n if dvc_dir is None:\n raise saved_exc\n self.configobj = self.config._repo_config\n\n def run_cmd(self):\n return self.run()\n\n def _unset(self, section, opt=None, configobj=None):\n if configobj is None:\n configobj = self.configobj\n\n try:\n self.config.unset(configobj, section, opt)\n self.config.save(configobj)\n except DvcException:\n logger.error(\"failed to unset '{}'\".format(self.args.name))\n return 1\n return 0\n\n def _show(self, section, opt):\n try:\n self.config.show(self.configobj, section, opt)\n except DvcException:\n logger.error(\"failed to show '{}'\".format(self.args.name))\n return 1\n return 0\n\n def _set(self, section, opt, value):\n try:\n self.config.set(self.configobj, section, opt, value)\n self.config.save(self.configobj)\n except DvcException:\n logger.error(\n \"failed to set '{}.{}' to '{}'\".format(section, opt, value)\n )\n return 1\n return 0\n\n def run(self):\n section, opt = self.args.name.lower().strip().split(\".\", 1)\n\n if self.args.unset:\n return self._unset(section, opt)\n elif self.args.value is None:\n return self._show(section, opt)\n else:\n return self._set(section, opt, self.args.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/dvc/command/config.py_parent_config_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/config.py_parent_config_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 84, "end_line": 122, "span_ids": ["add_parser", "impl"], "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": "parent_config_parser = argparse.ArgumentParser(add_help=False)\nparent_config_parser.add_argument(\n \"--global\",\n dest=\"glob\",\n action=\"store_true\",\n default=False,\n help=\"Use global config.\",\n)\nparent_config_parser.add_argument(\n \"--system\", action=\"store_true\", default=False, help=\"Use system config.\"\n)\nparent_config_parser.add_argument(\n \"--local\", action=\"store_true\", default=False, help=\"Use local config.\"\n)\n\n\ndef 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(\n \"value\", nargs=\"?\", default=None, help=\"Option value.\"\n )\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/command/daemon.py_from___future___import_un_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___future___import_un_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": 37, "span_ids": ["CmdDaemonAnalytics.run", "CmdDaemonBase", "CmdDaemonBase.run_cmd", "imports", "CmdDaemonUpdater.run", "CmdDaemonAnalytics", "CmdDaemonBase.__init__", "CmdDaemonUpdater"], "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": "from __future__ import unicode_literals\n\nfrom dvc.command.base import CmdBase, fix_subparsers\n\n\nclass CmdDaemonBase(CmdBase):\n def __init__(self, args):\n self.args = args\n self.config = None\n self.set_loglevel(args)\n\n def run_cmd(self):\n return self.run()\n\n\nclass CmdDaemonUpdater(CmdDaemonBase):\n def run(self):\n import os\n from dvc.repo import Repo\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 updater = Updater(dvc_dir)\n updater.fetch(detach=False)\n\n return 0\n\n\nclass CmdDaemonAnalytics(CmdDaemonBase):\n def run(self):\n from dvc.analytics import Analytics\n\n analytics = Analytics.load(self.args.target)\n analytics.send()\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/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": 40, "end_line": 73, "span_ids": ["add_parser"], "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": "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\", help=\"Use dvc daemon CMD --help for command-specific help.\"\n )\n\n fix_subparsers(daemon_subparsers)\n\n DAEMON_UPDATER_HELP = \"Fetch latest available version.\"\n daemon_updater_parser = daemon_subparsers.add_parser(\n \"updater\",\n parents=[parent_parser],\n description=DAEMON_UPDATER_HELP,\n help=DAEMON_UPDATER_HELP,\n )\n daemon_updater_parser.set_defaults(func=CmdDaemonUpdater)\n\n DAEMON_ANALYTICS_HELP = \"Send dvc usage analytics.\"\n daemon_analytics_parser = daemon_subparsers.add_parser(\n \"analytics\",\n parents=[parent_parser],\n description=DAEMON_ANALYTICS_HELP,\n help=DAEMON_ANALYTICS_HELP,\n )\n daemon_analytics_parser.add_argument(\"target\", help=\"Analytics file.\")\n daemon_analytics_parser.set_defaults(func=CmdDaemonAnalytics)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_from___future___import_un_CmdDataBase.check_up_to_date.if_processed_files_count_.logger_info_cls_UP_TO_DAT": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_from___future___import_un_CmdDataBase.check_up_to_date.if_processed_files_count_.logger_info_cls_UP_TO_DAT", "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": 28, "span_ids": ["CmdDataBase.check_up_to_date", "CmdDataBase.run", "imports", "CmdDataBase.do_run", "CmdDataBase"], "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": "from __future__ import unicode_literals\n\nimport argparse\n\nimport dvc.logger as logger\nfrom dvc.command.base import CmdBase, append_doc_link\n\n\nclass CmdDataBase(CmdBase):\n UP_TO_DATE_MSG = \"Everything is up to date.\"\n\n def do_run(self, target):\n pass\n\n def run(self):\n if not self.args.targets:\n return self.do_run()\n\n ret = 0\n for target in self.args.targets:\n if self.do_run(target):\n ret = 1\n return ret\n\n @classmethod\n def check_up_to_date(cls, processed_files_count):\n if processed_files_count == 0:\n logger.info(cls.UP_TO_DATE_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/command/data_sync.py_CmdDataPull_CmdDataPull.do_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_CmdDataPull_CmdDataPull.do_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": 31, "end_line": 49, "span_ids": ["CmdDataPull.do_run", "CmdDataPull"], "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 CmdDataPull(CmdDataBase):\n def do_run(self, target=None):\n try:\n processed_files_count = self.repo.pull(\n target=target,\n jobs=self.args.jobs,\n remote=self.args.remote,\n show_checksums=self.args.show_checksums,\n all_branches=self.args.all_branches,\n all_tags=self.args.all_tags,\n with_deps=self.args.with_deps,\n force=self.args.force,\n recursive=self.args.recursive,\n )\n except Exception:\n logger.error(\"failed to pull data from the cloud\")\n return 1\n self.check_up_to_date(processed_files_count)\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_CmdDataPush_CmdDataPush.do_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.do_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": 52, "end_line": 69, "span_ids": ["CmdDataPush.do_run", "CmdDataPush"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CmdDataPush(CmdDataBase):\n def do_run(self, target=None):\n try:\n processed_files_count = self.repo.push(\n target=target,\n jobs=self.args.jobs,\n remote=self.args.remote,\n show_checksums=self.args.show_checksums,\n all_branches=self.args.all_branches,\n all_tags=self.args.all_tags,\n with_deps=self.args.with_deps,\n recursive=self.args.recursive,\n )\n except Exception:\n logger.error(\"failed to push data to the cloud\")\n return 1\n self.check_up_to_date(processed_files_count)\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_CmdDataFetch_CmdDataFetch.do_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.do_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": 72, "end_line": 89, "span_ids": ["CmdDataFetch.do_run", "CmdDataFetch"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CmdDataFetch(CmdDataBase):\n def do_run(self, target=None):\n try:\n processed_files_count = self.repo.fetch(\n target=target,\n jobs=self.args.jobs,\n remote=self.args.remote,\n show_checksums=self.args.show_checksums,\n all_branches=self.args.all_branches,\n all_tags=self.args.all_tags,\n with_deps=self.args.with_deps,\n recursive=self.args.recursive,\n )\n except Exception:\n logger.error(\"failed to fetch data from the cloud\")\n return 1\n self.check_up_to_date(processed_files_count)\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_shared_parent_parser_shared_parent_parser.return.shared_parent_parser": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_shared_parent_parser_shared_parent_parser.return.shared_parent_parser", "embedding": null, "metadata": {"file_path": "dvc/command/data_sync.py", "file_name": "data_sync.py", "file_type": "text/x-python", "category": "implementation", "start_line": 92, "end_line": 116, "span_ids": ["shared_parent_parser"], "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 shared_parent_parser():\n from dvc.cli import get_parent_parser\n\n # Parent parser used in pull/push/status\n shared_parent_parser = argparse.ArgumentParser(\n add_help=False, parents=[get_parent_parser()]\n )\n shared_parent_parser.add_argument(\n \"-j\",\n \"--jobs\",\n type=int,\n default=None,\n help=\"Number of jobs to run simultaneously.\",\n )\n shared_parent_parser.add_argument(\n \"--show-checksums\",\n action=\"store_true\",\n default=False,\n help=\"Show checksums instead of file names.\",\n )\n shared_parent_parser.add_argument(\n \"targets\", nargs=\"*\", default=None, help=\"DVC files.\"\n )\n\n return shared_parent_parser", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/destroy.py_from___future___import_un_CmdDestroy.run_cmd.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/destroy.py_from___future___import_un_CmdDestroy.run_cmd.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_cmd", "CmdDestroy"], "tokens": 178}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import unicode_literals\n\nimport argparse\n\nimport dvc.prompt as prompt\nimport dvc.logger as logger\nfrom dvc.command.base import CmdBase, append_doc_link\nfrom dvc.exceptions import DvcException\n\n\nclass CmdDestroy(CmdBase):\n def run_cmd(self):\n try:\n statement = (\n \"This will destroy all information about your pipelines,\"\n \" all data files, as well as cache in .dvc/cache.\"\n \"\\n\"\n \"Are you sure you want to continue?\"\n )\n\n if not self.args.force and not prompt.confirm(statement):\n raise DvcException(\n \"cannot destroy without a confirmation from the user.\"\n \" Use '-f' to force.\"\n )\n\n self.repo.destroy()\n except Exception:\n logger.error(\"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/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": 34, "end_line": 52, "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_from___future___import_un_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_from___future___import_un_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": 46, "span_ids": ["imports", "CmdGC", "CmdGC.run"], "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": "from __future__ import unicode_literals\n\nimport argparse\nimport os\nimport dvc.prompt as prompt\nimport dvc.logger as logger\n\nfrom dvc.command.base import CmdBase, append_doc_link\n\n\nclass CmdGC(CmdBase):\n def run(self):\n msg = \"this will remove all cache except the cache that is used in \"\n if not self.args.all_branches and not self.args.all_tags:\n msg += \"the current git branch\"\n elif self.args.all_branches and not self.args.all_tags:\n msg += \"all git branches\"\n elif not self.args.all_branches and self.args.all_tags:\n msg += \"all git tags\"\n else:\n msg += \"all git branches and all git tags\"\n\n if self.args.repos is not None and len(self.args.repos) > 0:\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 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 )\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_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": 49, "end_line": 112, "span_ids": ["add_parser"], "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": "def add_parser(subparsers, parent_parser):\n GC_HELP = \"Collect unused data from DVC cache or a remote storage.\"\n GC_DESCRIPTION = (\n \"Deletes all files in the cache or a remote which are not in\\n\"\n \"use by the specified git references (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 \"-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 \"-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\", \"--remote\", help=\"Remote storage to collect garbage in.\"\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 default=None,\n help=\"Number of jobs to run simultaneously.\",\n )\n gc_parser.add_argument(\n \"-p\",\n \"--projects\",\n dest=\"repos\",\n type=str,\n nargs=\"*\",\n default=None,\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 )\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_from___future___import_un_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_from___future___import_un_CmdImport.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/imp.py", "file_name": "imp.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 28, "span_ids": ["CmdImport.run", "imports", "CmdImport"], "tokens": 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": "from __future__ import unicode_literals\n\nimport argparse\nimport os\n\nimport dvc.logger as logger\nfrom dvc.utils.compat import urlparse\nfrom dvc.exceptions import DvcException\nfrom dvc.command.base import CmdBase, append_doc_link\n\n\nclass CmdImport(CmdBase):\n def run(self):\n try:\n default_out = os.path.basename(urlparse(self.args.url).path)\n\n out = self.args.out or default_out\n\n self.repo.imp(self.args.url, out, self.args.resume)\n except DvcException:\n logger.error(\n \"failed to import {}. You could also try downloading \"\n \"it manually and adding it with `dvc add` command.\".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/imp.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/imp.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/imp.py", "file_name": "imp.py", "file_type": "text/x-python", "category": "implementation", "start_line": 31, "end_line": 63, "span_ids": ["add_parser"], "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": "def add_parser(subparsers, parent_parser):\n IMPORT_HELP = \"Download or copy files from URL and take under DVC control.\"\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\",\n help=\"Supported urls:\\n\"\n \"/path/to/file\\n\"\n \"C:\\\\\\\\path\\\\to\\\\file\\n\"\n \"https://example.com/path/to/file\\n\"\n \"s3://bucket/path/to/file\\n\"\n \"gs://bucket/path/to/file\\n\"\n \"hdfs://example.com/path/to/file\\n\"\n \"ssh://example.com:/path/to/file\\n\"\n \"remote://myremote/path/to/file (see `dvc remote`)\",\n )\n import_parser.add_argument(\n \"--resume\",\n action=\"store_true\",\n default=False,\n help=\"Resume previously started download.\",\n )\n import_parser.add_argument(\n \"out\", nargs=\"?\", help=\"Destination path to put files to.\"\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/install.py_from___future___import_un_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/install.py_from___future___import_un_", "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": 29, "span_ids": ["imports", "add_parser", "CmdInstall.run_cmd", "CmdInstall"], "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": "from __future__ import unicode_literals\n\nimport argparse\n\nimport dvc.logger as logger\nfrom dvc.command.base import CmdBase, append_doc_link\n\n\nclass CmdInstall(CmdBase):\n def run_cmd(self):\n try:\n self.repo.install()\n except Exception:\n logger.error(\"failed to install dvc 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.set_defaults(func=CmdInstall)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/lock.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/lock.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/lock.py", "file_name": "lock.py", "file_type": "text/x-python", "category": "implementation", "start_line": 36, "end_line": 58, "span_ids": ["add_parser"], "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 add_parser(subparsers, parent_parser):\n LOCK_HELP = \"Lock DVC file.\"\n lock_parser = subparsers.add_parser(\n \"lock\",\n parents=[parent_parser],\n description=append_doc_link(LOCK_HELP, \"lock\"),\n help=LOCK_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n lock_parser.add_argument(\"targets\", nargs=\"+\", help=\"DVC files.\")\n lock_parser.set_defaults(func=CmdLock)\n\n UNLOCK_HELP = \"Unlock DVC file.\"\n unlock_parser = subparsers.add_parser(\n \"unlock\",\n parents=[parent_parser],\n description=append_doc_link(UNLOCK_HELP, \"unlock\"),\n help=UNLOCK_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n unlock_parser.add_argument(\"targets\", nargs=\"+\", help=\"DVC files.\")\n unlock_parser.set_defaults(func=CmdUnlock)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_CmdMetricsModify_CmdMetricsRemove.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_CmdMetricsModify_CmdMetricsRemove.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": 38, "end_line": 74, "span_ids": ["CmdMetricsRemove.run", "CmdMetricsAdd", "CmdMetricsModify.run", "CmdMetricsAdd.run", "CmdMetricsRemove", "CmdMetricsModify"], "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 CmdMetricsModify(CmdBase):\n def run(self):\n try:\n self.repo.metrics.modify(\n self.args.path, typ=self.args.type, xpath=self.args.xpath\n )\n except DvcException:\n logger.error(\"failed to modify metric file settings\")\n return 1\n\n return 0\n\n\nclass CmdMetricsAdd(CmdBase):\n def run(self):\n try:\n self.repo.metrics.add(\n self.args.path, self.args.type, self.args.xpath\n )\n except DvcException:\n msg = \"failed to add metric file '{}'\".format(self.args.path)\n logger.error(msg)\n return 1\n\n return 0\n\n\nclass CmdMetricsRemove(CmdBase):\n def run(self):\n try:\n self.repo.metrics.remove(self.args.path)\n except DvcException:\n msg = \"failed to remove metric file '{}'\".format(self.args.path)\n logger.error(msg)\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/metrics.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/metrics.py", "file_name": "metrics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 94, "end_line": 199, "span_ids": ["add_parser"], "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": "def add_parser(subparsers, parent_parser):\n METRICS_HELP = \"Commands to add, manage, collect and display metrics.\"\n\n metrics_parser = subparsers.add_parser(\n \"metrics\",\n parents=[parent_parser],\n description=append_doc_link(METRICS_HELP, \"metrics\"),\n help=METRICS_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n\n metrics_subparsers = metrics_parser.add_subparsers(\n dest=\"cmd\",\n help=\"Use dvc metrics CMD --help to display command-specific help.\",\n )\n\n fix_subparsers(metrics_subparsers)\n\n METRICS_SHOW_HELP = \"Output metric values.\"\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 \"path\", nargs=\"?\", help=\"Path to a metric file or a directory.\"\n )\n metrics_show_parser.add_argument(\n \"-t\", \"--type\", help=\"Type of metrics (raw/json/tsv/htsv/csv/hcsv).\"\n )\n metrics_show_parser.add_argument(\n \"-x\", \"--xpath\", help=\"json/tsv/htsv/csv/hcsv path.\"\n )\n metrics_show_parser.add_argument(\n \"-a\",\n \"--all-branches\",\n action=\"store_true\",\n default=False,\n help=\"Show metrics for all branches.\",\n )\n metrics_show_parser.add_argument(\n \"-T\",\n \"--all-tags\",\n action=\"store_true\",\n default=False,\n help=\"Show metrics for all tags.\",\n )\n metrics_show_parser.add_argument(\n \"-R\",\n \"--recursive\",\n action=\"store_true\",\n default=False,\n help=(\n \"If path is a directory, recursively search and process metric \"\n \"files in path.\"\n ),\n )\n metrics_show_parser.set_defaults(func=CmdMetricsShow)\n\n METRICS_ADD_HELP = \"Tag file as a metric file.\"\n metrics_add_parser = metrics_subparsers.add_parser(\n \"add\",\n parents=[parent_parser],\n description=append_doc_link(METRICS_ADD_HELP, \"metrics-add\"),\n help=METRICS_ADD_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n metrics_add_parser.add_argument(\n \"-t\", \"--type\", help=\"Type of metrics (raw/json/tsv/htsv/csv/hcsv).\"\n )\n metrics_add_parser.add_argument(\n \"-x\", \"--xpath\", help=\"json/tsv/htsv/csv/hcsv path.\"\n )\n metrics_add_parser.add_argument(\"path\", help=\"Path to a metric file.\")\n metrics_add_parser.set_defaults(func=CmdMetricsAdd)\n\n METRICS_MODIFY_HELP = \"Modify metric file options.\"\n metrics_modify_parser = metrics_subparsers.add_parser(\n \"modify\",\n parents=[parent_parser],\n description=append_doc_link(METRICS_MODIFY_HELP, \"metrics-modify\"),\n help=METRICS_MODIFY_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n metrics_modify_parser.add_argument(\n \"-t\", \"--type\", help=\"Type of metrics (raw/json/tsv/htsv/csv/hcsv).\"\n )\n metrics_modify_parser.add_argument(\n \"-x\", \"--xpath\", help=\"json/tsv/htsv/csv/hcsv path.\"\n )\n metrics_modify_parser.add_argument(\"path\", help=\"Path to a metric file.\")\n metrics_modify_parser.set_defaults(func=CmdMetricsModify)\n\n METRICS_REMOVE_HELP = \"Remove files's metric tag.\"\n metrics_remove_parser = metrics_subparsers.add_parser(\n \"remove\",\n parents=[parent_parser],\n description=append_doc_link(METRICS_REMOVE_HELP, \"metrics-remove\"),\n help=METRICS_REMOVE_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n metrics_remove_parser.add_argument(\"path\", help=\"Path to a metric file.\")\n metrics_remove_parser.set_defaults(func=CmdMetricsRemove)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/move.py_from___future___import_un_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/move.py_from___future___import_un_", "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": 43, "span_ids": ["imports", "CmdMove.run", "add_parser", "CmdMove"], "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": "from __future__ import unicode_literals\n\nimport argparse\n\nimport dvc.logger as logger\nfrom dvc.exceptions import DvcException\nfrom dvc.command.base import CmdBase, append_doc_link\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.error(msg)\n return 1\n return 0\n\n\ndef add_parser(subparsers, parent_parser):\n MOVE_HELP = \"Rename or move a DVC controlled data file or a directory.\"\n MOVE_DESCRIPTION = (\n \"Rename or move a DVC controlled data file or a directory.\\n\"\n \"It renames and modifies the corresponding DVC file to reflect the\"\n \" changes.\"\n )\n\n move_parser = subparsers.add_parser(\n \"move\",\n parents=[parent_parser],\n description=append_doc_link(MOVE_DESCRIPTION, \"move\"),\n help=MOVE_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n move_parser.add_argument(\n \"src\", help=\"Source path to a data file or directory.\"\n )\n move_parser.add_argument(\"dst\", help=\"Destination path.\")\n move_parser.set_defaults(func=CmdMove)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pipeline.py_from___future___import_un_CmdPipelineShow._show.for_n_in_networkx_dfs_pos.if_commands_.else_.logger_info_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pipeline.py_from___future___import_un_CmdPipelineShow._show.for_n_in_networkx_dfs_pos.if_commands_.else_.logger_info_n_", "embedding": null, "metadata": {"file_path": "dvc/command/pipeline.py", "file_name": "pipeline.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 31, "span_ids": ["CmdPipelineShow", "imports", "CmdPipelineShow._show"], "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": "from __future__ import unicode_literals\n\nimport argparse\n\nfrom dvc.utils.compat import str\n\nimport os\n\nimport dvc.logger as logger\nfrom dvc.exceptions import DvcException\nfrom dvc.command.base import CmdBase, fix_subparsers, append_doc_link\n\n\nclass CmdPipelineShow(CmdBase):\n def _show(self, target, commands, outs):\n import networkx\n from dvc.stage import Stage\n\n stage = Stage.load(self.repo, target)\n G = self.repo.graph()[0]\n stages = networkx.get_node_attributes(G, \"stage\")\n node = os.path.relpath(stage.path, self.repo.root_dir)\n\n for n in networkx.dfs_postorder_nodes(G, node):\n if commands:\n logger.info(stages[n].cmd)\n elif outs:\n for out in stages[n].outs:\n logger.info(str(out))\n else:\n logger.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/command/pipeline.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pipeline.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/pipeline.py", "file_name": "pipeline.py", "file_type": "text/x-python", "category": "implementation", "start_line": 169, "end_line": 238, "span_ids": ["add_parser"], "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 add_parser(subparsers, parent_parser):\n PIPELINE_HELP = \"Manage pipelines.\"\n pipeline_parser = subparsers.add_parser(\n \"pipeline\",\n parents=[parent_parser],\n description=append_doc_link(PIPELINE_HELP, \"pipeline\"),\n help=PIPELINE_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n\n pipeline_subparsers = pipeline_parser.add_subparsers(\n dest=\"cmd\",\n help=\"Use dvc pipeline CMD --help for command-specific help.\",\n )\n\n fix_subparsers(pipeline_subparsers)\n\n PIPELINE_SHOW_HELP = \"Show pipeline.\"\n pipeline_show_parser = pipeline_subparsers.add_parser(\n \"show\",\n parents=[parent_parser],\n description=append_doc_link(PIPELINE_SHOW_HELP, \"pipeline-show\"),\n help=PIPELINE_SHOW_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n pipeline_show_group = pipeline_show_parser.add_mutually_exclusive_group()\n pipeline_show_group.add_argument(\n \"-c\",\n \"--commands\",\n action=\"store_true\",\n default=False,\n help=\"Print commands instead of paths to DVC files.\",\n )\n pipeline_show_group.add_argument(\n \"-o\",\n \"--outs\",\n action=\"store_true\",\n default=False,\n help=\"Print output files instead of paths to DVC files.\",\n )\n pipeline_show_parser.add_argument(\n \"--ascii\",\n action=\"store_true\",\n default=False,\n help=\"Output DAG as ASCII.\",\n )\n pipeline_show_parser.add_argument(\n \"--dot\", help=\"Write DAG in .dot format.\"\n )\n pipeline_show_parser.add_argument(\n \"--tree\",\n action=\"store_true\",\n default=False,\n help=\"Output DAG as Dependencies Tree.\",\n )\n pipeline_show_parser.add_argument(\n \"targets\", nargs=\"*\", help=\"DVC files. 'Dvcfile' by default.\"\n )\n pipeline_show_parser.set_defaults(func=CmdPipelineShow)\n\n PIPELINE_LIST_HELP = \"List pipelines.\"\n pipeline_list_parser = pipeline_subparsers.add_parser(\n \"list\",\n parents=[parent_parser],\n description=append_doc_link(PIPELINE_LIST_HELP, \"pipeline-list\"),\n help=PIPELINE_LIST_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n pipeline_list_parser.set_defaults(func=CmdPipelineList)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_from___future___import_un_CmdRemoteAdd.resolve_path.return.os_path_relpath_path_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_from___future___import_un_CmdRemoteAdd.resolve_path.return.os_path_relpath_path_os_", "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": 30, "span_ids": ["imports", "CmdRemoteAdd", "CmdRemoteAdd.resolve_path"], "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": "from __future__ import unicode_literals\n\nimport argparse\nimport os\nimport re\n\nimport dvc.logger as logger\nfrom dvc.command.base import fix_subparsers, append_doc_link\nfrom dvc.config import Config\nfrom dvc.command.config import CmdConfig\n\n\nclass CmdRemoteAdd(CmdConfig):\n @staticmethod\n def resolve_path(path, config_file):\n \"\"\"Resolve path relative to config file location.\n\n Args:\n path: Path to be resolved.\n config_file: Path to config file, which `path` is specified\n relative to.\n\n Returns:\n Path relative to the `config_file` location. If `path` is an\n absolute path then it will be returned without change.\n\n \"\"\"\n if os.path.isabs(path):\n return path\n return os.path.relpath(path, os.path.dirname(config_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/command/remote.py_CmdRemoteAdd.run_CmdRemoteAdd.run.return.ret": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_CmdRemoteAdd.run_CmdRemoteAdd.run.return.ret", "embedding": null, "metadata": {"file_path": "dvc/command/remote.py", "file_name": "remote.py", "file_type": "text/x-python", "category": "implementation", "start_line": 31, "end_line": 52, "span_ids": ["CmdRemoteAdd.run"], "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 CmdRemoteAdd(CmdConfig):\n\n def run(self):\n from dvc.remote import _get, RemoteLOCAL\n\n remote = _get({Config.SECTION_REMOTE_URL: self.args.url})\n if remote == RemoteLOCAL:\n self.args.url = self.resolve_path(\n self.args.url, self.configobj.filename\n )\n\n section = Config.SECTION_REMOTE_FMT.format(self.args.name)\n ret = self._set(section, Config.SECTION_REMOTE_URL, self.args.url)\n if ret != 0:\n return ret\n\n if self.args.default:\n msg = \"Setting '{}' as a default remote.\".format(self.args.name)\n logger.info(msg)\n ret = self._set(\n Config.SECTION_CORE, Config.SECTION_CORE_REMOTE, self.args.name\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/command/remote.py_CmdRemoteRemove_CmdRemoteRemove.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_CmdRemoteRemove_CmdRemoteRemove.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/remote.py", "file_name": "remote.py", "file_type": "text/x-python", "category": "implementation", "start_line": 55, "end_line": 89, "span_ids": ["CmdRemoteRemove", "CmdRemoteRemove._remove_default", "CmdRemoteRemove.run"], "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 CmdRemoteRemove(CmdConfig):\n def _remove_default(self, config):\n core = config.get(Config.SECTION_CORE, None)\n if core is None:\n return 0\n\n default = core.get(Config.SECTION_CORE_REMOTE, None)\n if default is None:\n return 0\n\n if default == self.args.name:\n return self._unset(\n Config.SECTION_CORE,\n opt=Config.SECTION_CORE_REMOTE,\n configobj=config,\n )\n\n def run(self):\n section = Config.SECTION_REMOTE_FMT.format(self.args.name)\n ret = self._unset(section)\n if ret != 0:\n return ret\n\n for configobj in [\n self.config._local_config,\n self.config._repo_config,\n self.config._global_config,\n self.config._system_config,\n ]:\n self._remove_default(configobj)\n self.config.save(configobj)\n if configobj == self.configobj:\n break\n\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_CmdRemoteModify_CmdRemoteList.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_CmdRemoteModify_CmdRemoteList.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/remote.py", "file_name": "remote.py", "file_type": "text/x-python", "category": "implementation", "start_line": 92, "end_line": 116, "span_ids": ["CmdRemoteList", "CmdRemoteDefault.run", "CmdRemoteList.run", "CmdRemoteModify", "CmdRemoteDefault", "CmdRemoteModify.run"], "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 CmdRemoteModify(CmdConfig):\n def run(self):\n section = Config.SECTION_REMOTE_FMT.format(self.args.name)\n self.args.name = \"{}.{}\".format(section, self.args.option)\n return super(CmdRemoteModify, self).run()\n\n\nclass CmdRemoteDefault(CmdConfig):\n def run(self):\n self.args.value = self.args.name\n self.args.name = \"core.remote\"\n return super(CmdRemoteDefault, self).run()\n\n\nclass CmdRemoteList(CmdConfig):\n def run(self):\n for section in self.configobj.keys():\n r = re.match(Config.SECTION_REMOTE_REGEX, section)\n if r:\n name = r.group(\"name\")\n url = self.configobj[section].get(\n Config.SECTION_REMOTE_URL, \"\"\n )\n logger.info(\"{}\\t{}\".format(name, url))\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/remote.py", "file_name": "remote.py", "file_type": "text/x-python", "category": "implementation", "start_line": 120, "end_line": 221, "span_ids": ["add_parser"], "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": "def add_parser(subparsers, parent_parser):\n from dvc.command.config import parent_config_parser\n\n REMOTE_HELP = \"Manage remote storage configuration.\"\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 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.\")\n remote_add_parser.add_argument(\n \"url\",\n help=\"URL. See full list of supported urls at \" \"man.dvc.org/remote\",\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.set_defaults(func=CmdRemoteAdd)\n\n REMOTE_DEFAULT_HELP = \"Set/unset default 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_REMOVE_HELP = \"Remove remote.\"\n remote_remove_parser = remote_subparsers.add_parser(\n \"remove\",\n parents=[parent_config_parser, parent_parser],\n description=append_doc_link(REMOTE_REMOVE_HELP, \"remote-remove\"),\n help=REMOTE_REMOVE_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n remote_remove_parser.add_argument(\"name\", help=\"Name\")\n remote_remove_parser.set_defaults(func=CmdRemoteRemove)\n\n REMOTE_MODIFY_HELP = \"Modify 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.\")\n remote_modify_parser.add_argument(\"option\", help=\"Option.\")\n remote_modify_parser.add_argument(\"value\", nargs=\"?\", help=\"Value.\")\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 available 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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_from___future___import_un_CmdRemove.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remove.py_from___future___import_un_CmdRemove.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/remove.py", "file_name": "remove.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 39, "span_ids": ["CmdRemove.run", "imports", "CmdRemove._is_outs_only", "CmdRemove"], "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": "from __future__ import unicode_literals\n\nimport argparse\n\nimport dvc.prompt as prompt\nimport dvc.logger as logger\nfrom dvc.exceptions import DvcException\nfrom dvc.command.base import CmdBase, append_doc_link\n\n\nclass CmdRemove(CmdBase):\n def _is_outs_only(self, target):\n if not self.args.purge:\n return True\n\n if self.args.force:\n return False\n\n msg = \"Are you sure you want to remove {} with its outputs?\".format(\n target\n )\n\n if prompt.confirm(msg):\n return False\n\n raise DvcException(\n \"Cannot purge without a confirmation from the user.\"\n \" Use '-f' to force.\"\n )\n\n def run(self):\n for target in self.args.targets:\n try:\n outs_only = self._is_outs_only(target)\n self.repo.remove(target, outs_only=outs_only)\n except DvcException:\n logger.error(\"failed to remove {}\".format(target))\n return 1\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remove.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remove.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/remove.py", "file_name": "remove.py", "file_type": "text/x-python", "category": "implementation", "start_line": 42, "end_line": 75, "span_ids": ["add_parser"], "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 add_parser(subparsers, parent_parser):\n REMOVE_HELP = \"Remove outputs of DVC file.\"\n remove_parser = subparsers.add_parser(\n \"remove\",\n parents=[parent_parser],\n description=append_doc_link(REMOVE_HELP, \"remove\"),\n help=REMOVE_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n remove_parser_group = remove_parser.add_mutually_exclusive_group()\n remove_parser_group.add_argument(\n \"-o\",\n \"--outs\",\n action=\"store_true\",\n default=True,\n help=\"Only remove DVC file outputs.(default)\",\n )\n remove_parser_group.add_argument(\n \"-p\",\n \"--purge\",\n action=\"store_true\",\n default=False,\n help=\"Remove DVC file and all its outputs.\",\n )\n remove_parser.add_argument(\n \"-f\",\n \"--force\",\n action=\"store_true\",\n default=False,\n help=\"Force purge.\",\n )\n remove_parser.add_argument(\"targets\", nargs=\"+\", help=\"DVC files.\")\n remove_parser.set_defaults(func=CmdRemove)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/repro.py_from___future___import_un_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_from___future___import_un_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": 53, "span_ids": ["CmdRepro.run", "imports", "CmdRepro"], "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": "from __future__ import unicode_literals\n\nimport argparse\nimport os\n\nimport dvc.logger as logger\nfrom dvc.command.base import CmdBase, append_doc_link\nfrom dvc.command.metrics import show_metrics\nfrom dvc.command.status import CmdDataStatus\nfrom dvc.exceptions import DvcException\n\n\nclass CmdRepro(CmdBase):\n def run(self):\n recursive = not self.args.single_item\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 recursive=recursive,\n force=self.args.force,\n dry=self.args.dry,\n interactive=self.args.interactive,\n pipeline=self.args.pipeline,\n all_pipelines=self.args.all_pipelines,\n ignore_build_cache=self.args.ignore_build_cache,\n no_commit=self.args.no_commit,\n )\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.error()\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/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": 56, "end_line": 141, "span_ids": ["add_parser"], "tokens": 520}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n REPRO_HELP = \"Check for changes and reproduce DVC file and dependencies.\"\n repro_parser = subparsers.add_parser(\n \"repro\",\n parents=[parent_parser],\n description=append_doc_link(REPRO_HELP, \"repro\"),\n help=REPRO_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n repro_parser.add_argument(\n \"targets\",\n nargs=\"*\",\n help=\"DVC file to reproduce (default - 'Dvcfile').\",\n )\n repro_parser.add_argument(\n \"-f\",\n \"--force\",\n action=\"store_true\",\n default=False,\n help=\"Reproduce even if dependencies were not changed.\",\n )\n repro_parser.add_argument(\n \"-s\",\n \"--single-item\",\n action=\"store_true\",\n default=False,\n help=\"Reproduce only single data item without recursive dependencies \"\n \"check.\",\n )\n repro_parser.add_argument(\n \"-c\",\n \"--cwd\",\n default=os.path.curdir,\n help=\"Directory within your repo to reproduce from.\",\n )\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 \"--ignore-build-cache\",\n action=\"store_true\",\n default=False,\n help=\"Reproduce all descendants of a changed stage even if their \"\n \"direct dependencies didn't change.\",\n )\n repro_parser.add_argument(\n \"--no-commit\",\n action=\"store_true\",\n default=False,\n help=\"Don't put files/directories into cache.\",\n )\n repro_parser.set_defaults(func=CmdRepro)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/root.py_from___future___import_un_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/root.py_from___future___import_un_", "embedding": null, "metadata": {"file_path": "dvc/command/root.py", "file_name": "root.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 29, "span_ids": ["CmdRoot.run_cmd", "imports", "CmdRoot", "CmdRoot.run", "add_parser"], "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": "from __future__ import unicode_literals\n\nimport argparse\nimport os\n\nimport dvc.logger as logger\nfrom dvc.command.base import CmdBase, append_doc_link\n\n\nclass CmdRoot(CmdBase):\n def run_cmd(self):\n return self.run()\n\n def run(self):\n logger.info(os.path.relpath(self.repo.root_dir))\n return 0\n\n\ndef add_parser(subparsers, parent_parser):\n ROOT_HELP = \"Relative path to the repository's directory.\"\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_from___future___import_un_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_from___future___import_un_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": 56, "span_ids": ["imports", "CmdRun", "CmdRun.run"], "tokens": 369}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 __future__ import unicode_literals\n\nimport argparse\n\nimport dvc.logger as logger\nfrom dvc.command.base import CmdBase, append_doc_link\nfrom dvc.exceptions import DvcException\n\n\nclass CmdRun(CmdBase):\n def run(self):\n overwrite = self.args.yes or self.args.overwrite_dvcfile\n\n if not any(\n [\n self.args.deps,\n self.args.outs,\n self.args.outs_no_cache,\n self.args.metrics,\n self.args.metrics_no_cache,\n self.args.outs_persist,\n self.args.outs_persist_no_cache,\n self.args.command,\n ]\n ): # pragma: no cover\n logger.error(\n \"too few arguments. Specify at least one: '-d', '-o', '-O',\"\n \" '-m', '-M', '--outs-persist', '--outs-persist-no-cache',\"\n \" 'command'.\"\n )\n return 1\n\n try:\n self.repo.run(\n cmd=self._parsed_cmd(),\n outs=self.args.outs,\n outs_no_cache=self.args.outs_no_cache,\n metrics=self.args.metrics,\n metrics_no_cache=self.args.metrics_no_cache,\n deps=self.args.deps,\n fname=self.args.file,\n cwd=self.args.cwd,\n wdir=self.args.wdir,\n no_exec=self.args.no_exec,\n overwrite=overwrite,\n ignore_build_cache=self.args.ignore_build_cache,\n remove_outs=self.args.remove_outs,\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 )\n except DvcException:\n logger.error(\"failed to run command\")\n return 1\n\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/run.py_CmdRun._parsed_cmd_CmdRun._quote_argument.return._format_argument_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/run.py_CmdRun._parsed_cmd_CmdRun._quote_argument.return._format_argument_", "embedding": null, "metadata": {"file_path": "dvc/command/run.py", "file_name": "run.py", "file_type": "text/x-python", "category": "implementation", "start_line": 53, "end_line": 72, "span_ids": ["CmdRun._parsed_cmd", "CmdRun._quote_argument"], "tokens": 158}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CmdRun(CmdBase):\n\n def _parsed_cmd(self):\n \"\"\"\n We need to take into account two cases:\n\n - ['python code.py foo bar']: Used mainly with dvc as a library\n - ['echo', 'foo bar']: List of arguments received from the CLI\n\n The second case would need quoting, as it was passed through:\n dvc run echo \"foo bar\"\n \"\"\"\n if len(self.args.command) < 2:\n return \" \".join(self.args.command)\n\n return \" \".join(self._quote_argument(arg) for arg in self.args.command)\n\n def _quote_argument(self, argument):\n if \" \" not in argument or '\"' in argument:\n return argument\n\n return '\"{}\"'.format(argument)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/run.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/run.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/run.py", "file_name": "run.py", "file_type": "text/x-python", "category": "implementation", "start_line": 80, "end_line": 201, "span_ids": ["add_parser"], "tokens": 807}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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 )\n run_parser.add_argument(\n \"-o\",\n \"--outs\",\n action=\"append\",\n default=[],\n help=\"Declare output file or directory.\",\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 )\n run_parser.add_argument(\n \"-m\",\n \"--metrics\",\n action=\"append\",\n default=[],\n help=\"Declare output metric file or directory.\",\n )\n run_parser.add_argument(\n \"-M\",\n \"--metrics-no-cache\",\n action=\"append\",\n default=[],\n help=\"Declare output metric file or directory \"\n \"(do not put into DVC cache).\",\n )\n run_parser.add_argument(\n \"-f\",\n \"--file\",\n help=\"Specify name of the stage file. It should be \"\n \"either 'Dvcfile' or have a '.dvc' suffix (e.g. \"\n \"'prepare.dvc', 'clean.dvc', etc) in order for \"\n \"dvc to be able to find it later. By default \"\n \"the first output basename + .dvc is used as \"\n \"a stage filename.\",\n )\n run_parser.add_argument(\n \"-c\", \"--cwd\", default=None, help=\"Deprecated, use -w and -f instead.\"\n )\n run_parser.add_argument(\n \"-w\",\n \"--wdir\",\n default=None,\n help=\"Directory within your repo to run your command in.\",\n )\n run_parser.add_argument(\n \"--no-exec\",\n action=\"store_true\",\n default=False,\n help=\"Only create stage file without actually running it.\",\n )\n run_parser.add_argument(\n \"-y\",\n \"--yes\",\n action=\"store_true\",\n default=False,\n help=\"Deprecated, use --overwrite-dvcfile instead\",\n )\n run_parser.add_argument(\n \"--overwrite-dvcfile\",\n action=\"store_true\",\n default=False,\n help=\"Overwrite existing dvc file without asking for confirmation.\",\n )\n run_parser.add_argument(\n \"--ignore-build-cache\",\n action=\"store_true\",\n default=False,\n help=\"Run this stage even if it has been already ran with the same \"\n \"command/dependencies/outputs/etc before.\",\n )\n run_parser.add_argument(\n \"--remove-outs\",\n action=\"store_true\",\n default=False,\n help=\"Remove outputs before running the command.\",\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 )\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 )\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/command/status.py_from___future___import_un_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_from___future___import_un_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": 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": "from __future__ import unicode_literals\n\nimport dvc.logger as logger\nfrom dvc.command.data_sync import CmdDataBase\nfrom dvc.utils.compat import str\n\n\nclass CmdDataStatus(CmdDataBase):\n STATUS_LEN = 20\n STATUS_INDENT = \"\\t\"\n UP_TO_DATE_MSG = \"Pipeline is up to date. Nothing to reproduce.\"\n\n def _normalize(self, s):\n s += \":\"\n assert len(s) < self.STATUS_LEN\n return s + (self.STATUS_LEN - len(s)) * \" \"\n\n def _show(self, status, indent=0):\n ind = indent * self.STATUS_INDENT\n\n if isinstance(status, str):\n logger.info(\"{}{}\".format(ind, status))\n return\n\n if isinstance(status, list):\n for entry in status:\n self._show(entry, indent)\n return\n\n assert isinstance(status, dict)\n\n for key, value in status.items():\n if isinstance(value, str):\n logger.info(\"{}{}{}\".format(ind, self._normalize(value), key))\n elif value:\n logger.info(\"{}{}:\".format(ind, key))\n self._show(value, indent + 1)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/status.py_CmdDataStatus.do_run_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/status.py_CmdDataStatus.do_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": 64, "span_ids": ["CmdDataStatus.do_run"], "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 CmdDataStatus(CmdDataBase):\n\n def do_run(self, target=None):\n indent = 1 if self.args.cloud else 0\n try:\n st = self.repo.status(\n target=target,\n jobs=self.args.jobs,\n cloud=self.args.cloud,\n show_checksums=self.args.show_checksums,\n remote=self.args.remote,\n all_branches=self.args.all_branches,\n all_tags=self.args.all_tags,\n with_deps=self.args.with_deps,\n )\n if st:\n if self.args.quiet:\n return 1\n else:\n self._show(st, indent)\n else:\n logger.info(self.UP_TO_DATE_MSG)\n\n except Exception:\n logger.error(\"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_from___future___import_un_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/unprotect.py_from___future___import_un_", "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": 35, "span_ids": ["imports", "add_parser", "CmdUnprotect", "CmdUnprotect.run"], "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": "from __future__ import unicode_literals\n\nimport argparse\n\nimport dvc.logger as logger\nfrom dvc.exceptions import DvcException\nfrom dvc.command.base import CmdBase, append_doc_link\n\n\nclass CmdUnprotect(CmdBase):\n def run(self):\n for target in self.args.targets:\n try:\n self.repo.unprotect(target)\n except DvcException:\n msg = \"failed to unprotect '{}'\".format(target)\n logger.error(msg)\n return 1\n return 0\n\n\ndef add_parser(subparsers, parent_parser):\n UNPROTECT_HELP = \"Unprotect a data file/directory.\"\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/directory.\"\n )\n unprotect_parser.set_defaults(func=CmdUnprotect)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py__DVC_config_objects__is_percent.return.int_val_0_and_int_val": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py__DVC_config_objects__is_percent.return.int_val_0_and_int_val", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 107, "span_ids": ["supported_cache_type", "ConfigError.__init__", "is_percent", "is_bool", "is_whole", "supported_loglevel", "to_bool", "docstring", "supported_cloud", "ConfigError"], "tokens": 568}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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.\"\"\"\n\nfrom __future__ import unicode_literals\n\nfrom dvc.utils.compat import str, open\n\nimport os\nimport errno\nimport configobj\nfrom schema import Schema, Optional, And, Use, Regex\n\nimport dvc.logger as logger\nfrom dvc.exceptions import DvcException\n\n\nclass ConfigError(DvcException):\n \"\"\"DVC config exception.\n\n Args:\n msg (str): error message.\n ex (Exception): optional exception that has caused this error.\n \"\"\"\n\n def __init__(self, msg, ex=None):\n super(ConfigError, self).__init__(\n \"config file error: {}\".format(msg), ex\n )\n\n\ndef supported_cache_type(types):\n \"\"\"Checks if link type config option has a valid value.\n\n Args:\n types (list/string): type(s) of links that dvc should try out.\n \"\"\"\n if isinstance(types, str):\n types = [typ.strip() for typ in types.split(\",\")]\n for typ in types:\n if typ not in [\"reflink\", \"hardlink\", \"symlink\", \"copy\"]:\n return False\n return True\n\n\ndef supported_loglevel(level):\n \"\"\"Checks if log level config option has a valid value.\n\n Args:\n level (str): log level name.\n \"\"\"\n return level in [\"info\", \"debug\", \"warning\", \"error\"]\n\n\ndef supported_cloud(cloud):\n \"\"\"Checks if obsoleted cloud option has a valid value.\n\n Args:\n cloud (str): cloud type name.\n \"\"\"\n return cloud in [\"aws\", \"gcp\", \"local\", \"\"]\n\n\ndef is_bool(val):\n \"\"\"Checks that value is a boolean.\n\n Args:\n val (str): string value verify.\n\n Returns:\n bool: True if value stands for boolean, False otherwise.\n \"\"\"\n return val.lower() in [\"true\", \"false\"]\n\n\ndef to_bool(val):\n \"\"\"Converts value to boolean.\n\n Args:\n val (str): string to convert to boolean.\n\n Returns:\n bool: True if value.lower() == 'true', False otherwise.\n \"\"\"\n return val.lower() == \"true\"\n\n\ndef is_whole(val):\n \"\"\"Checks that value is a whole integer.\n\n Args:\n val (str): number string to verify.\n\n Returns:\n bool: True if val is a whole number, False otherwise.\n \"\"\"\n return int(val) >= 0\n\n\ndef is_percent(val):\n \"\"\"Checks that value is a percent.\n\n Args:\n val (str): number string to verify.\n\n Returns:\n bool: True if 0<=value<=100, False otherwise.\n \"\"\"\n return int(val) >= 0 and int(val) <= 100", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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.SECTION_AWS_USE_SSL._use_ssl_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config_Config.SECTION_AWS_USE_SSL._use_ssl_", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 110, "end_line": 199, "span_ids": ["Config"], "tokens": 763}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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(object): # pylint: disable=too-many-instance-attributes\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\n Raises:\n ConfigError: thrown when config has an invalid format.\n \"\"\"\n\n APPNAME = \"dvc\"\n APPAUTHOR = \"iterative\"\n\n # NOTE: used internally in RemoteLOCAL to know config\n # location, that url should resolved relative to.\n PRIVATE_CWD = \"_cwd\"\n\n CONFIG = \"config\"\n CONFIG_LOCAL = \"config.local\"\n\n SECTION_CORE = \"core\"\n SECTION_CORE_LOGLEVEL = \"loglevel\"\n SECTION_CORE_LOGLEVEL_SCHEMA = And(Use(str.lower), supported_loglevel)\n SECTION_CORE_REMOTE = \"remote\"\n SECTION_CORE_INTERACTIVE_SCHEMA = And(str, is_bool, Use(to_bool))\n SECTION_CORE_INTERACTIVE = \"interactive\"\n SECTION_CORE_ANALYTICS = \"analytics\"\n SECTION_CORE_ANALYTICS_SCHEMA = And(str, is_bool, Use(to_bool))\n\n SECTION_CACHE = \"cache\"\n SECTION_CACHE_DIR = \"dir\"\n SECTION_CACHE_TYPE = \"type\"\n SECTION_CACHE_TYPE_SCHEMA = supported_cache_type\n SECTION_CACHE_PROTECTED = \"protected\"\n SECTION_CACHE_LOCAL = \"local\"\n SECTION_CACHE_S3 = \"s3\"\n SECTION_CACHE_GS = \"gs\"\n SECTION_CACHE_SSH = \"ssh\"\n SECTION_CACHE_HDFS = \"hdfs\"\n SECTION_CACHE_AZURE = \"azure\"\n SECTION_CACHE_SCHEMA = {\n Optional(SECTION_CACHE_LOCAL): str,\n Optional(SECTION_CACHE_S3): str,\n Optional(SECTION_CACHE_GS): str,\n Optional(SECTION_CACHE_HDFS): str,\n Optional(SECTION_CACHE_SSH): str,\n Optional(SECTION_CACHE_AZURE): str,\n Optional(SECTION_CACHE_DIR): str,\n Optional(SECTION_CACHE_TYPE, default=None): SECTION_CACHE_TYPE_SCHEMA,\n Optional(SECTION_CACHE_PROTECTED, default=False): And(\n str, is_bool, Use(to_bool)\n ),\n Optional(PRIVATE_CWD): str,\n }\n\n # backward compatibility\n SECTION_CORE_CLOUD = \"cloud\"\n SECTION_CORE_CLOUD_SCHEMA = And(Use(str.lower), supported_cloud)\n SECTION_CORE_STORAGEPATH = \"storagepath\"\n\n SECTION_CORE_SCHEMA = {\n Optional(SECTION_CORE_LOGLEVEL, default=\"info\"): And(\n str, Use(str.lower), SECTION_CORE_LOGLEVEL_SCHEMA\n ),\n Optional(SECTION_CORE_REMOTE, default=\"\"): And(str, Use(str.lower)),\n Optional(\n SECTION_CORE_INTERACTIVE, default=False\n ): SECTION_CORE_INTERACTIVE_SCHEMA,\n Optional(\n SECTION_CORE_ANALYTICS, default=True\n ): SECTION_CORE_ANALYTICS_SCHEMA,\n # backward compatibility\n Optional(SECTION_CORE_CLOUD, default=\"\"): SECTION_CORE_CLOUD_SCHEMA,\n Optional(SECTION_CORE_STORAGEPATH, default=\"\"): str,\n }\n\n # backward compatibility\n SECTION_AWS = \"aws\"\n SECTION_AWS_STORAGEPATH = \"storagepath\"\n SECTION_AWS_CREDENTIALPATH = \"credentialpath\"\n SECTION_AWS_ENDPOINT_URL = \"endpointurl\"\n SECTION_AWS_LIST_OBJECTS = \"listobjects\"\n SECTION_AWS_REGION = \"region\"\n SECTION_AWS_PROFILE = \"profile\"\n SECTION_AWS_USE_SSL = \"use_ssl\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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.SECTION_AWS_SCHEMA_Config.SCHEMA._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config.SECTION_AWS_SCHEMA_Config.SCHEMA._", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 200, "end_line": 284, "span_ids": ["Config"], "tokens": 772}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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(object):\n SECTION_AWS_SCHEMA = {\n SECTION_AWS_STORAGEPATH: str,\n Optional(SECTION_AWS_REGION): str,\n Optional(SECTION_AWS_PROFILE): str,\n Optional(SECTION_AWS_CREDENTIALPATH): str,\n Optional(SECTION_AWS_ENDPOINT_URL): str,\n Optional(SECTION_AWS_LIST_OBJECTS, default=False): And(\n str, is_bool, Use(to_bool)\n ),\n Optional(SECTION_AWS_USE_SSL, default=True): And(\n str, is_bool, Use(to_bool)\n ),\n }\n\n # backward compatibility\n SECTION_GCP = \"gcp\"\n SECTION_GCP_STORAGEPATH = SECTION_AWS_STORAGEPATH\n SECTION_GCP_CREDENTIALPATH = SECTION_AWS_CREDENTIALPATH\n SECTION_GCP_PROJECTNAME = \"projectname\"\n SECTION_GCP_SCHEMA = {\n SECTION_GCP_STORAGEPATH: str,\n Optional(SECTION_GCP_PROJECTNAME): str,\n }\n\n # backward compatibility\n SECTION_LOCAL = \"local\"\n SECTION_LOCAL_STORAGEPATH = SECTION_AWS_STORAGEPATH\n SECTION_LOCAL_SCHEMA = {SECTION_LOCAL_STORAGEPATH: str}\n\n SECTION_AZURE_CONNECTION_STRING = \"connection_string\"\n\n SECTION_REMOTE_REGEX = r'^\\s*remote\\s*\"(?P.*)\"\\s*$'\n SECTION_REMOTE_FMT = 'remote \"{}\"'\n SECTION_REMOTE_URL = \"url\"\n SECTION_REMOTE_USER = \"user\"\n SECTION_REMOTE_PORT = \"port\"\n SECTION_REMOTE_KEY_FILE = \"keyfile\"\n SECTION_REMOTE_TIMEOUT = \"timeout\"\n SECTION_REMOTE_PASSWORD = \"password\"\n SECTION_REMOTE_ASK_PASSWORD = \"ask_password\"\n SECTION_REMOTE_SCHEMA = {\n SECTION_REMOTE_URL: str,\n Optional(SECTION_AWS_REGION): str,\n Optional(SECTION_AWS_PROFILE): str,\n Optional(SECTION_AWS_CREDENTIALPATH): str,\n Optional(SECTION_AWS_ENDPOINT_URL): str,\n Optional(SECTION_AWS_LIST_OBJECTS, default=False): And(\n str, is_bool, Use(to_bool)\n ),\n Optional(SECTION_AWS_USE_SSL, default=True): And(\n str, is_bool, Use(to_bool)\n ),\n Optional(SECTION_GCP_PROJECTNAME): str,\n Optional(SECTION_CACHE_TYPE): SECTION_CACHE_TYPE_SCHEMA,\n Optional(SECTION_CACHE_PROTECTED, default=False): And(\n str, is_bool, Use(to_bool)\n ),\n Optional(SECTION_REMOTE_USER): str,\n Optional(SECTION_REMOTE_PORT): Use(int),\n Optional(SECTION_REMOTE_KEY_FILE): str,\n Optional(SECTION_REMOTE_TIMEOUT): Use(int),\n Optional(SECTION_REMOTE_PASSWORD): str,\n Optional(SECTION_REMOTE_ASK_PASSWORD): And(str, is_bool, Use(to_bool)),\n Optional(SECTION_AZURE_CONNECTION_STRING): str,\n Optional(PRIVATE_CWD): str,\n }\n\n SECTION_STATE = \"state\"\n SECTION_STATE_ROW_LIMIT = \"row_limit\"\n SECTION_STATE_ROW_CLEANUP_QUOTA = \"row_cleanup_quota\"\n SECTION_STATE_SCHEMA = {\n Optional(SECTION_STATE_ROW_LIMIT): And(Use(int), is_whole),\n Optional(SECTION_STATE_ROW_CLEANUP_QUOTA): And(Use(int), is_percent),\n }\n\n SCHEMA = {\n Optional(SECTION_CORE, default={}): SECTION_CORE_SCHEMA,\n Optional(Regex(SECTION_REMOTE_REGEX)): SECTION_REMOTE_SCHEMA,\n Optional(SECTION_CACHE, default={}): SECTION_CACHE_SCHEMA,\n Optional(SECTION_STATE, default={}): SECTION_STATE_SCHEMA,\n # backward compatibility\n Optional(SECTION_AWS, default={}): SECTION_AWS_SCHEMA,\n Optional(SECTION_GCP, default={}): SECTION_GCP_SCHEMA,\n Optional(SECTION_LOCAL, default={}): SECTION_LOCAL_SCHEMA,\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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.__init___Config.init.return.Config_dvc_dir_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config.__init___Config.init.return.Config_dvc_dir_", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 279, "end_line": 343, "span_ids": ["Config.get_global_config_dir", "Config.init", "Config.__init__", "Config.get_system_config_dir"], "tokens": 423}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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(object):\n\n def __init__(self, dvc_dir=None, validate=True):\n self.system_config_file = os.path.join(\n self.get_system_config_dir(), self.CONFIG\n )\n self.global_config_file = os.path.join(\n self.get_global_config_dir(), self.CONFIG\n )\n\n if dvc_dir is not None:\n self.dvc_dir = os.path.abspath(os.path.realpath(dvc_dir))\n self.config_file = os.path.join(dvc_dir, self.CONFIG)\n self.config_local_file = os.path.join(dvc_dir, self.CONFIG_LOCAL)\n else:\n self.dvc_dir = None\n self.config_file = None\n self.config_local_file = None\n\n self._system_config = None\n self._global_config = None\n self._repo_config = None\n self._local_config = None\n\n self.config = None\n\n self.load(validate=validate)\n\n @staticmethod\n def get_global_config_dir():\n \"\"\"Returns global config location. E.g. ~/.config/dvc/config.\n\n Returns:\n str: path to the global config directory.\n \"\"\"\n from appdirs import user_config_dir\n\n return user_config_dir(\n appname=Config.APPNAME, appauthor=Config.APPAUTHOR\n )\n\n @staticmethod\n def get_system_config_dir():\n \"\"\"Returns system config location. E.g. /etc/dvc.conf.\n\n Returns:\n str: path to the system config directory.\n \"\"\"\n from appdirs import site_config_dir\n\n return site_config_dir(\n appname=Config.APPNAME, appauthor=Config.APPAUTHOR\n )\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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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._load_Config._load.self.config.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config._load_Config._load.self.config.None", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 345, "end_line": 359, "span_ids": ["Config._load"], "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 Config(object):\n\n def _load(self):\n self._system_config = configobj.ConfigObj(self.system_config_file)\n self._global_config = configobj.ConfigObj(self.global_config_file)\n\n if self.config_file is not None:\n self._repo_config = configobj.ConfigObj(self.config_file)\n else:\n self._repo_config = configobj.ConfigObj()\n\n if self.config_local_file is not None:\n self._local_config = configobj.ConfigObj(self.config_local_file)\n else:\n self._local_config = configobj.ConfigObj()\n\n self.config = 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_Config._load_config_Config._resolve_paths.for_section_in_config_val.section_self_PRIVATE_CWD_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config._load_config_Config._resolve_paths.for_section_in_config_val.section_self_PRIVATE_CWD_", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 361, "end_line": 393, "span_ids": ["Config._resolve_paths", "Config._load_config", "Config._resolve_cache_path", "Config._resolve_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": "class Config(object):\n\n def _load_config(self, path):\n config = configobj.ConfigObj(path)\n config = self._lower(config)\n self._resolve_paths(config, path)\n return config\n\n @staticmethod\n def _resolve_path(path, config_file):\n assert os.path.isabs(config_file)\n config_dir = os.path.dirname(config_file)\n return os.path.abspath(os.path.join(config_dir, path))\n\n def _resolve_cache_path(self, config, fname):\n cache = config.get(self.SECTION_CACHE)\n if cache is None:\n return\n\n cache_dir = cache.get(self.SECTION_CACHE_DIR)\n if cache_dir is None:\n return\n\n cache[self.PRIVATE_CWD] = os.path.dirname(fname)\n\n def _resolve_paths(self, config, fname):\n if fname is None:\n return\n\n self._resolve_cache_path(config, fname)\n for section in config.values():\n if self.SECTION_REMOTE_URL not in section.keys():\n continue\n\n section[self.PRIVATE_CWD] = os.path.dirname(fname)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config.load_Config.load.try_.except_Exception_as_ex_.raise_ConfigError_ex_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config.load_Config.load.try_.except_Exception_as_ex_.raise_ConfigError_ex_", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 395, "end_line": 428, "span_ids": ["Config.load"], "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 Config(object):\n\n def load(self, validate=True):\n \"\"\"Loads config from all the config files.\n\n Args:\n validate (bool): optional flag to tell dvc if it should validate\n the config or just load it as is. 'True' by default.\n\n\n Raises:\n dvc.config.ConfigError: thrown if config has invalid format.\n \"\"\"\n self._load()\n try:\n self.config = self._load_config(self.system_config_file)\n user = self._load_config(self.global_config_file)\n config = self._load_config(self.config_file)\n local = self._load_config(self.config_local_file)\n\n # NOTE: schema doesn't support ConfigObj.Section validation, so we\n # need to convert our config to dict before passing it to\n for conf in [user, config, local]:\n self.config = self._merge(self.config, conf)\n\n if validate:\n self.config = Schema(self.SCHEMA).validate(self.config)\n\n # NOTE: now converting back to ConfigObj\n self.config = configobj.ConfigObj(\n self.config, write_empty_values=True\n )\n self.config.filename = self.config_file\n self._resolve_paths(self.config, self.config_file)\n except Exception as ex:\n raise ConfigError(ex)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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._get_key_Config.save.for_conf_in_clist_.try_.except_Exception_as_exc_.raise_ConfigError_msg_ex": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config._get_key_Config.save.for_conf_in_clist_.try_.except_Exception_as_exc_.raise_ConfigError_msg_ex", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 430, "end_line": 476, "span_ids": ["Config.save", "Config._get_key"], "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 Config(object):\n\n @staticmethod\n def _get_key(conf, name, add=False):\n for k in conf.keys():\n if k.lower() == name.lower():\n return k\n\n if add:\n conf[name] = {}\n return name\n\n return None\n\n def save(self, config=None):\n \"\"\"Saves config to config files.\n\n Args:\n config (configobj.ConfigObj): optional config object to save.\n\n Raises:\n dvc.config.ConfigError: thrown if failed to write config file.\n \"\"\"\n if config is not None:\n clist = [config]\n else:\n clist = [\n self._system_config,\n self._global_config,\n self._repo_config,\n self._local_config,\n ]\n\n for conf in clist:\n if conf.filename is None:\n continue\n\n try:\n logger.debug(\"Writing '{}'.\".format(conf.filename))\n dname = os.path.dirname(os.path.abspath(conf.filename))\n try:\n os.makedirs(dname)\n except OSError as exc:\n if exc.errno != errno.EEXIST:\n raise\n conf.write()\n except Exception as exc:\n msg = \"failed to write config '{}'\".format(conf.filename)\n raise ConfigError(msg, 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/config.py_Config.unset_Config.unset.if_not_config_section_.del_config_section_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config.unset_Config.unset.if_not_config_section_.del_config_section_", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 478, "end_line": 501, "span_ids": ["Config.unset"], "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 Config(object):\n\n @staticmethod\n def unset(config, section, opt=None):\n \"\"\"Unsets specified option and/or section in the config.\n\n Args:\n config (configobj.ConfigObj): config to work on.\n section (str): section name.\n opt (str): optional option name.\n \"\"\"\n if section not in config.keys():\n raise ConfigError(\"section '{}' doesn't exist\".format(section))\n\n if opt is None:\n del config[section]\n return\n\n if opt not in config[section].keys():\n raise ConfigError(\n \"option '{}.{}' doesn't exist\".format(section, opt)\n )\n del config[section][opt]\n\n if not config[section]:\n del config[section]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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.set_Config.show.logger_info_config_sectio": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config.set_Config.show.logger_info_config_sectio", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 503, "end_line": 535, "span_ids": ["Config.show", "Config.set"], "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 Config(object):\n\n @staticmethod\n def set(config, section, opt, value):\n \"\"\"Sets specified option in the config.\n\n Args:\n config (configobj.ConfigObj): config to work on.\n section (str): section name.\n opt (str): option name.\n value: value to set option to.\n \"\"\"\n if section not in config.keys():\n config[section] = {}\n\n config[section][opt] = value\n\n @staticmethod\n def show(config, section, opt):\n \"\"\"Prints option value from the config.\n\n Args:\n config (configobj.ConfigObj): config to work on.\n section (str): section name.\n opt (str): option name.\n \"\"\"\n if section not in config.keys():\n raise ConfigError(\"section '{}' doesn't exist\".format(section))\n\n if opt not in config[section].keys():\n raise ConfigError(\n \"option '{}.{}' doesn't exist\".format(section, opt)\n )\n\n logger.info(config[section][opt])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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._merge_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config._merge_", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 537, "end_line": 557, "span_ids": ["Config._merge", "Config._lower"], "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 Config(object):\n\n @staticmethod\n def _merge(first, second):\n res = {}\n sections = list(first.keys()) + list(second.keys())\n for section in sections:\n first_copy = first.get(section, {}).copy()\n second_copy = second.get(section, {}).copy()\n first_copy.update(second_copy)\n res[section] = first_copy\n return res\n\n @staticmethod\n def _lower(config):\n new_config = {}\n for s_key, s_value in config.items():\n new_s = {}\n for key, value in s_value.items():\n new_s[key.lower()] = str(value)\n new_config[s_key.lower()] = new_s\n return new_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/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": 34, "span_ids": ["_spawn_windows", "docstring"], "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": "\"\"\"Launch `dvc daemon` command in a separate detached process.\"\"\"\n\nfrom __future__ import unicode_literals\n\nimport os\nimport sys\nimport inspect\nfrom subprocess import Popen\n\nimport dvc.logger as logger\nfrom dvc.utils import is_binary, fix_env\nfrom dvc.utils.compat import cast_bytes_py2\n\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": 37, "end_line": 66, "span_ids": ["_spawn_posix"], "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 _spawn_posix(cmd, env):\n # NOTE: using os._exit instead of sys.exit, because dvc built\n # with PyInstaller has trouble with SystemExit exeption 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.error(\"failed at first fork\")\n os._exit(1) # pylint: disable=protected-access\n\n os.setsid()\n os.umask(0)\n\n try:\n pid = os.fork()\n if pid > 0:\n os._exit(0) # pylint: disable=protected-access\n except OSError:\n logger.error(\"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/daemon.py_daemon_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/daemon.py_daemon_", "embedding": null, "metadata": {"file_path": "dvc/daemon.py", "file_name": "daemon.py", "file_type": "text/x-python", "category": "implementation", "start_line": 69, "end_line": 96, "span_ids": ["daemon"], "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 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 cmd = [sys.executable]\n if not is_binary():\n cmd += [\"-m\", \"dvc\"]\n cmd += [\"daemon\", \"-q\"] + args\n\n env = fix_env()\n file_path = os.path.abspath(inspect.stack()[0][1])\n env[cast_bytes_py2(\"PYTHONPATH\")] = cast_bytes_py2(\n os.path.dirname(os.path.dirname(file_path))\n )\n\n logger.debug(\"Trying to spawn '{}'\".format(cmd))\n\n if os.name == \"nt\":\n _spawn_windows(cmd, env)\n elif os.name == \"posix\":\n _spawn_posix(cmd, env)\n else:\n raise NotImplementedError\n\n logger.debug(\"Spawned '{}'\".format(cmd))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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__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__Draws_DAG_in_ASCII__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": 1, "end_line": 37, "span_ids": ["VertexViewer", "VertexViewer.__init__", "docstring", "VertexViewer.h", "VertexViewer.w"], "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": "\"\"\"Draws DAG in ASCII.\"\"\"\n\nfrom __future__ import unicode_literals\nfrom __future__ import print_function\n\nimport sys\nimport math\n\nfrom grandalf.graphs import Vertex, Edge, Graph\nfrom grandalf.layouts import SugiyamaLayout\nfrom grandalf.routing import route_with_lines, EdgeViewer\n\n\nclass VertexViewer(object):\n \"\"\"Class to define vertex box boundaries that will be accounted for during\n graph building by grandalf.\n\n Args:\n name (str): name of the vertex.\n \"\"\"\n\n HEIGHT = 3 # top and bottom box edges + text\n\n def __init__(self, name):\n # pylint: disable=invalid-name\n self._h = self.HEIGHT # top and bottom box edges + text\n self._w = len(name) + 2 # right and left bottom edges + text\n\n @property\n def h(self): # pylint: disable=invalid-name\n \"\"\"Height of the box.\"\"\"\n return self._h\n\n @property\n def w(self): # pylint: disable=invalid-name\n \"\"\"Width of the box.\"\"\"\n return self._w", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_AsciiCanvas_AsciiCanvas.draw.if_sys_stdout_isatty_.else_.for_line_in_self_canvas_.print_join_line_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_AsciiCanvas_AsciiCanvas.draw.if_sys_stdout_isatty_.else_.for_line_in_self_canvas_.print_join_line_", "embedding": null, "metadata": {"file_path": "dvc/dagascii.py", "file_name": "dagascii.py", "file_type": "text/x-python", "category": "implementation", "start_line": 40, "end_line": 67, "span_ids": ["AsciiCanvas", "AsciiCanvas.__init__", "AsciiCanvas.draw"], "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 AsciiCanvas(object):\n \"\"\"Class for drawing in ASCII.\n\n Args:\n cols (int): number of columns in the canvas. Should be > 1.\n lines (int): number of lines in the canvas. Should be > 1.\n \"\"\"\n\n TIMEOUT = 10\n\n def __init__(self, cols, lines):\n assert cols > 1\n assert lines > 1\n\n self.cols = cols\n self.lines = lines\n\n self.canvas = [[\" \"] * cols for l in range(lines)]\n\n def draw(self):\n \"\"\"Draws ASCII canvas on the screen.\"\"\"\n if sys.stdout.isatty(): # pragma: no cover\n from asciimatics.screen import Screen\n\n Screen.wrapper(self._do_draw)\n else:\n for line in self.canvas:\n print(\"\".join(line))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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._do_draw_AsciiCanvas._do_draw.while_True_.if_offset_x_max_x_.elif_offset_x_0_.offset_x.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_AsciiCanvas._do_draw_AsciiCanvas._do_draw.while_True_.if_offset_x_max_x_.elif_offset_x_0_.offset_x.0", "embedding": null, "metadata": {"file_path": "dvc/dagascii.py", "file_name": "dagascii.py", "file_type": "text/x-python", "category": "implementation", "start_line": 69, "end_line": 153, "span_ids": ["AsciiCanvas._do_draw"], "tokens": 689}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class AsciiCanvas(object):\n\n def _do_draw(self, screen): # pragma: no cover\n # pylint: disable=too-many-locals\n # pylint: disable=too-many-branches, too-many-statements\n from dvc.system import System\n from asciimatics.event import KeyboardEvent\n\n offset_x = 0\n offset_y = 0\n smaxrow, smaxcol = screen.dimensions\n assert smaxrow > 1\n assert smaxcol > 1\n smaxrow -= 1\n smaxcol -= 1\n\n if self.lines + 1 > smaxrow:\n max_y = self.lines + 1 - smaxrow\n else:\n max_y = 0\n\n if self.cols + 1 > smaxcol:\n max_x = self.cols + 1 - smaxcol\n else:\n max_x = 0\n\n while True:\n for y in range(smaxrow + 1):\n y_index = offset_y + y\n line = []\n for x in range(smaxcol + 1):\n x_index = offset_x + x\n if (\n len(self.canvas) > y_index\n and len(self.canvas[y_index]) > x_index\n ):\n line.append(self.canvas[y_index][x_index])\n else:\n line.append(\" \")\n assert len(line) == (smaxcol + 1)\n screen.print_at(\"\".join(line), 0, y)\n\n screen.refresh()\n\n # NOTE: get_event() doesn't block by itself,\n # so we have to do the blocking ourselves.\n #\n # NOTE: using this workaround while waiting for PR [1]\n # to get merged and released. After that need to adjust\n # asciimatics version requirements.\n #\n # [1] https://github.com/peterbrittain/asciimatics/pull/188\n System.wait_for_input(self.TIMEOUT)\n\n event = screen.get_event()\n if not isinstance(event, KeyboardEvent):\n continue\n\n k = event.key_code\n if k == screen.KEY_DOWN or k == ord(\"s\"):\n offset_y += 1\n elif k == screen.KEY_PAGE_DOWN or k == ord(\"S\"):\n offset_y += smaxrow\n elif k == screen.KEY_UP or k == ord(\"w\"):\n offset_y -= 1\n elif k == screen.KEY_PAGE_UP or k == ord(\"W\"):\n offset_y -= smaxrow\n elif k == screen.KEY_RIGHT or k == ord(\"d\"):\n offset_x += 1\n elif k == ord(\"D\"):\n offset_x += smaxcol\n elif k == screen.KEY_LEFT or k == ord(\"a\"):\n offset_x -= 1\n elif k == ord(\"A\"):\n offset_x -= smaxcol\n elif k == ord(\"q\") or k == ord(\"Q\"):\n break\n\n if offset_y > max_y:\n offset_y = max_y\n elif offset_y < 0:\n offset_y = 0\n\n if offset_x > max_x:\n offset_x = max_x\n elif offset_x < 0:\n offset_x = 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/dagascii.py_AsciiCanvas.point_AsciiCanvas.point.self_canvas_y_x_char": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_AsciiCanvas.point_AsciiCanvas.point.self_canvas_y_x_char", "embedding": null, "metadata": {"file_path": "dvc/dagascii.py", "file_name": "dagascii.py", "file_type": "text/x-python", "category": "implementation", "start_line": 155, "end_line": 172, "span_ids": ["AsciiCanvas.point"], "tokens": 143}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class AsciiCanvas(object):\n\n def point(self, x, y, char):\n \"\"\"Create a point on ASCII canvas.\n\n Args:\n x (int): x coordinate. Should be >= 0 and < number of columns in\n the canvas.\n y (int): y coordinate. Should be >= 0 an < number of lines in the\n canvas.\n char (str): character to place in the specified point on the\n canvas.\n \"\"\"\n assert len(char) == 1\n assert x >= 0\n assert x < self.cols\n assert y >= 0\n assert y < self.lines\n\n self.canvas[y][x] = char", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_AsciiCanvas.line_AsciiCanvas.line.if_dx_0_and_dy_0_.else_.for_y_in_range_y1_y0_1.self_point_x_y_char_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_AsciiCanvas.line_AsciiCanvas.line.if_dx_0_and_dy_0_.else_.for_y_in_range_y1_y0_1.self_point_x_y_char_", "embedding": null, "metadata": {"file_path": "dvc/dagascii.py", "file_name": "dagascii.py", "file_type": "text/x-python", "category": "implementation", "start_line": 174, "end_line": 214, "span_ids": ["AsciiCanvas.line"], "tokens": 398}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class AsciiCanvas(object):\n\n def line(self, x0, y0, x1, y1, char):\n \"\"\"Create a line on ASCII canvas.\n\n Args:\n x0 (int): x coordinate where the line should start.\n y0 (int): y coordinate where the line should start.\n x1 (int): x coordinate where the line should end.\n y1 (int): y coordinate where the line should end.\n char (str): character to draw the line with.\n \"\"\"\n # pylint: disable=too-many-arguments, too-many-branches\n if x0 > x1:\n x1, x0 = x0, x1\n y1, y0 = y0, y1\n\n dx = x1 - x0\n dy = y1 - y0\n\n if dx == 0 and dy == 0:\n self.point(x0, y0, char)\n elif abs(dx) >= abs(dy):\n for x in range(x0, x1 + 1):\n if dx == 0:\n y = y0\n else:\n y = y0 + int(round((x - x0) * dy / float((dx))))\n self.point(x, y, char)\n elif y0 < y1:\n for y in range(y0, y1 + 1):\n if dy == 0:\n x = x0\n else:\n x = x0 + int(round((y - y0) * dx / float((dy))))\n self.point(x, y, char)\n else:\n for y in range(y1, y0 + 1):\n if dy == 0:\n x = x0\n else:\n x = x1 + int(round((y - y1) * dx / float((dy))))\n self.point(x, y, char)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_AsciiCanvas.text_AsciiCanvas.box.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_AsciiCanvas.text_AsciiCanvas.box.None_3", "embedding": null, "metadata": {"file_path": "dvc/dagascii.py", "file_name": "dagascii.py", "file_type": "text/x-python", "category": "implementation", "start_line": 216, "end_line": 253, "span_ids": ["AsciiCanvas.text", "AsciiCanvas.box"], "tokens": 307}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class AsciiCanvas(object):\n\n def text(self, x, y, text):\n \"\"\"Print a text on ASCII canvas.\n\n Args:\n x (int): x coordinate where the text should start.\n y (int): y coordinate where the text should start.\n text (str): string that should be printed.\n \"\"\"\n for i, char in enumerate(text):\n self.point(x + i, y, char)\n\n def box(self, x0, y0, width, height):\n \"\"\"Create a box on ASCII canvas.\n\n Args:\n x0 (int): x coordinate of the box corner.\n y0 (int): y coordinate of the box corner.\n width (int): box width.\n height (int): box height.\n \"\"\"\n assert width > 1\n assert height > 1\n\n width -= 1\n height -= 1\n\n for x in range(x0, x0 + width):\n self.point(x, y0, \"-\")\n self.point(x, y0 + height, \"-\")\n\n for y in range(y0, y0 + height):\n self.point(x0, y, \"|\")\n self.point(x0 + width, y, \"|\")\n\n self.point(x0, y0, \"+\")\n self.point(x0 + width, y0, \"+\")\n self.point(x0, y0 + height, \"+\")\n self.point(x0 + width, y0 + height, \"+\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py__build_sugiyama_layout__build_sugiyama_layout.return.sug": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py__build_sugiyama_layout__build_sugiyama_layout.return.sug", "embedding": null, "metadata": {"file_path": "dvc/dagascii.py", "file_name": "dagascii.py", "file_type": "text/x-python", "category": "implementation", "start_line": 256, "end_line": 294, "span_ids": ["_build_sugiyama_layout"], "tokens": 265}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _build_sugiyama_layout(vertexes, edges):\n #\n # Just a reminder about naming conventions:\n # +------------X\n # |\n # |\n # |\n # |\n # Y\n #\n\n vertexes = {v: Vertex(\" {} \".format(v)) for v in vertexes}\n # NOTE: reverting edges to correctly orientate the graph\n edges = [Edge(vertexes[e], vertexes[s]) for s, e in edges]\n vertexes = vertexes.values()\n graph = Graph(vertexes, edges)\n\n for vertex in vertexes:\n vertex.view = VertexViewer(vertex.data)\n\n # NOTE: determine min box length to create the best layout\n minw = min([v.view.w for v in vertexes])\n\n for edge in edges:\n edge.view = EdgeViewer()\n\n sug = SugiyamaLayout(graph.C[0])\n graph = graph.C[0]\n roots = list(filter(lambda x: len(x.e_in()) == 0, graph.sV))\n\n sug.init_all(roots=roots, optimize=True)\n\n sug.yspace = VertexViewer.HEIGHT\n sug.xspace = minw\n sug.route_edge = route_with_lines\n\n sug.draw()\n\n return sug", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_draw_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py_draw_", "embedding": null, "metadata": {"file_path": "dvc/dagascii.py", "file_name": "dagascii.py", "file_type": "text/x-python", "category": "implementation", "start_line": 297, "end_line": 371, "span_ids": ["draw"], "tokens": 635}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def draw(vertexes, edges):\n \"\"\"Build a DAG and draw it in ASCII.\n\n Args:\n vertexes (list): list of graph vertexes.\n edges (list): list of graph edges.\n \"\"\"\n # pylint: disable=too-many-locals\n # NOTE: coordinates might me negative, so we need to shift\n # everything to the positive plane before we actually draw it.\n Xs = [] # pylint: disable=invalid-name\n Ys = [] # pylint: disable=invalid-name\n\n sug = _build_sugiyama_layout(vertexes, edges)\n\n for vertex in sug.g.sV:\n # NOTE: moving boxes w/2 to the left\n Xs.append(vertex.view.xy[0] - vertex.view.w / 2.0)\n Xs.append(vertex.view.xy[0] + vertex.view.w / 2.0)\n Ys.append(vertex.view.xy[1])\n Ys.append(vertex.view.xy[1] + vertex.view.h)\n\n for edge in sug.g.sE:\n for x, y in edge.view._pts: # pylint: disable=protected-access\n Xs.append(x)\n Ys.append(y)\n\n minx = min(Xs)\n miny = min(Ys)\n maxx = max(Xs)\n maxy = max(Ys)\n\n canvas_cols = int(math.ceil(math.ceil(maxx) - math.floor(minx))) + 1\n canvas_lines = int(round(maxy - miny))\n\n canvas = AsciiCanvas(canvas_cols, canvas_lines)\n\n # NOTE: first draw edges so that node boxes could overwrite them\n for edge in sug.g.sE:\n # pylint: disable=protected-access\n assert len(edge.view._pts) > 1\n for index in range(1, len(edge.view._pts)):\n start = edge.view._pts[index - 1]\n end = edge.view._pts[index]\n\n start_x = int(round(start[0] - minx))\n start_y = int(round(start[1] - miny))\n end_x = int(round(end[0] - minx))\n end_y = int(round(end[1] - miny))\n\n assert start_x >= 0\n assert start_y >= 0\n assert end_x >= 0\n assert end_y >= 0\n\n canvas.line(start_x, start_y, end_x, end_y, \"*\")\n\n for vertex in sug.g.sV:\n # NOTE: moving boxes w/2 to the left\n x = vertex.view.xy[0] - vertex.view.w / 2.0\n y = vertex.view.xy[1]\n\n canvas.box(\n int(round(x - minx)),\n int(round(y - miny)),\n vertex.view.w,\n vertex.view.h,\n )\n\n canvas.text(\n int(round(x - minx)) + 1, int(round(y - miny)) + 1, vertex.data\n )\n\n canvas.draw()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py__Manages_dvc_remotes_th_from_dvc_remote_http_impo": {"__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_from_dvc_remote_http_impo", "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": 15, "span_ids": ["docstring"], "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": "\"\"\"Manages dvc remotes that user can use with push/pull/status comamnds.\"\"\"\n\nfrom __future__ import unicode_literals\n\nimport dvc.logger as logger\nfrom dvc.config import Config, ConfigError\n\nfrom dvc.remote import Remote\nfrom dvc.remote.s3 import RemoteS3\nfrom dvc.remote.gs import RemoteGS\nfrom dvc.remote.azure import RemoteAzure\nfrom dvc.remote.ssh import RemoteSSH\nfrom dvc.remote.hdfs import RemoteHDFS\nfrom dvc.remote.local import RemoteLOCAL\nfrom dvc.remote.http import RemoteHTTP", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud_DataCloud._init_remote.return.Remote_self_repo_cloud_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud_DataCloud._init_remote.return.Remote_self_repo_cloud_c", "embedding": null, "metadata": {"file_path": "dvc/data_cloud.py", "file_name": "data_cloud.py", "file_type": "text/x-python", "category": "implementation", "start_line": 18, "end_line": 67, "span_ids": ["DataCloud.__init__", "DataCloud", "DataCloud._cloud", "DataCloud._init_remote"], "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 DataCloud(object):\n \"\"\"Class that manages dvc remotes.\n\n Args:\n repo (dvc.repo.Repo): repo instance that belongs to the repo that\n we are working on.\n config (dict): config of the repo.\n\n Raises:\n config.ConfigError: thrown when config has invalid format.\n \"\"\"\n\n CLOUD_MAP = {\n \"aws\": RemoteS3,\n \"gcp\": RemoteGS,\n \"azure\": RemoteAzure,\n \"ssh\": RemoteSSH,\n \"hdfs\": RemoteHDFS,\n \"local\": RemoteLOCAL,\n \"http\": RemoteHTTP,\n \"https\": RemoteHTTP,\n }\n\n def __init__(self, repo, config=None):\n self.repo = repo\n self._config = config\n self._core = self._config[Config.SECTION_CORE]\n\n @property\n def _cloud(self):\n remote = self._core.get(Config.SECTION_CORE_REMOTE, \"\")\n if remote != \"\":\n return self._init_remote(remote)\n\n if self._core.get(Config.SECTION_CORE_CLOUD, None):\n # backward compatibility\n msg = \"using obsoleted config format. Consider updating.\"\n logger.warning(msg)\n return self._init_compat()\n\n return None\n\n def _init_remote(self, remote):\n section = Config.SECTION_REMOTE_FMT.format(remote).lower()\n cloud_config = self._config.get(section, None)\n if not cloud_config:\n msg = \"can't find remote section '{}' in config\"\n raise ConfigError(msg.format(section))\n\n return Remote(self.repo, 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/dvc/data_cloud.py_DataCloud._init_compat_DataCloud._init_compat.return.self__init_cloud_cloud_co": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud._init_compat_DataCloud._init_compat.return.self__init_cloud_cloud_co", "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": 90, "span_ids": ["DataCloud._init_compat"], "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 DataCloud(object):\n\n def _init_compat(self):\n name = self._core.get(Config.SECTION_CORE_CLOUD, \"\").strip().lower()\n if name == \"\":\n self._cloud = None\n return None\n\n cloud_type = self.CLOUD_MAP.get(name, None)\n if not cloud_type:\n msg = \"wrong cloud type '{}' specified\".format(name)\n raise ConfigError(msg)\n\n cloud_config = self._config.get(name, None)\n if not cloud_config:\n msg = \"can't find cloud section '{}' in config\".format(name)\n raise ConfigError(msg)\n\n # NOTE: check if the class itself has everything needed for operation.\n # E.g. all the imported packages.\n if not cloud_type.supported(cloud_type.compat_config(cloud_config)):\n raise ConfigError(\"unsupported cloud '{}'\".format(name))\n\n return self._init_cloud(cloud_config, cloud_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/data_cloud.py_DataCloud._init_cloud_DataCloud._get_cloud.raise_ConfigError_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud._init_cloud_DataCloud._get_cloud.raise_ConfigError_", "embedding": null, "metadata": {"file_path": "dvc/data_cloud.py", "file_name": "data_cloud.py", "file_type": "text/x-python", "category": "implementation", "start_line": 92, "end_line": 112, "span_ids": ["DataCloud._get_cloud", "DataCloud._init_cloud"], "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 DataCloud(object):\n\n def _init_cloud(self, cloud_config, cloud_type):\n global_storage_path = self._core.get(Config.SECTION_CORE_STORAGEPATH)\n if global_storage_path:\n logger.warning(\"using obsoleted config format. Consider updating.\")\n\n cloud = cloud_type(self.repo, cloud_config)\n return cloud\n\n def _get_cloud(self, remote, cmd):\n if remote:\n return self._init_remote(remote)\n\n if self._cloud:\n return self._cloud\n\n raise ConfigError(\n \"No remote repository specified. Setup default repository with\\n\"\n \" dvc config core.remote \\n\"\n \"or use:\\n\"\n \" dvc {} -r \\n\".format(cmd)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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.push_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.push_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": 114, "end_line": 130, "span_ids": ["DataCloud.push"], "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 DataCloud(object):\n\n def push(self, targets, jobs=None, remote=None, show_checksums=False):\n \"\"\"Push data items in a cloud-agnostic way.\n\n Args:\n targets (list): list of targets to push to the cloud.\n jobs (int): number of jobs that can be running simultaneously.\n remote (dvc.remote.base.RemoteBase): optional remote to push to.\n By default remote from core.remote config option is used.\n show_checksums (bool): show checksums instead of file names in\n information messages.\n \"\"\"\n return self.repo.cache.local.push(\n targets,\n jobs=jobs,\n remote=self._get_cloud(remote, \"push\"),\n show_checksums=show_checksums,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud.pull_DataCloud.pull.return.self_repo_cache_local_pul": {"__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.self_repo_cache_local_pul", "embedding": null, "metadata": {"file_path": "dvc/data_cloud.py", "file_name": "data_cloud.py", "file_type": "text/x-python", "category": "implementation", "start_line": 132, "end_line": 148, "span_ids": ["DataCloud.pull"], "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 DataCloud(object):\n\n def pull(self, targets, jobs=None, remote=None, show_checksums=False):\n \"\"\"Pull data items in a cloud-agnostic way.\n\n Args:\n targets (list): list of targets to pull from the cloud.\n jobs (int): number of jobs that can be running simultaneously.\n remote (dvc.remote.base.RemoteBase): optional remote to pull from.\n By default remote from core.remote config option is used.\n show_checksums (bool): show checksums instead of file names in\n information messages.\n \"\"\"\n return self.repo.cache.local.pull(\n targets,\n jobs=jobs,\n remote=self._get_cloud(remote, \"pull\"),\n show_checksums=show_checksums,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud.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": 150, "end_line": 166, "span_ids": ["DataCloud.status"], "tokens": 162}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DataCloud(object):\n\n def status(self, targets, jobs=None, remote=None, show_checksums=False):\n \"\"\"Check status of data items in a cloud-agnostic way.\n\n Args:\n targets (list): list of targets to check status for.\n jobs (int): number of jobs that can be running simultaneously.\n remote (dvc.remote.base.RemoteBase): optional remote to compare\n targets 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 cloud = self._get_cloud(remote, \"status\")\n return self.repo.cache.local.status(\n targets, jobs=jobs, remote=cloud, 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/dependency/__init__.py_from___future___import_un_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/__init__.py_from___future___import_un_", "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": 75, "span_ids": ["imports", "loadd_from", "loads_from", "_get"], "tokens": 508}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import unicode_literals\n\nimport schema\n\nfrom dvc.config import Config\nfrom dvc.utils.compat import urlparse\n\nimport dvc.output as output\nfrom dvc.output.base import OutputBase\nfrom dvc.dependency.s3 import DependencyS3\nfrom dvc.dependency.gs import DependencyGS\nfrom dvc.dependency.local import DependencyLOCAL\nfrom dvc.dependency.hdfs import DependencyHDFS\nfrom dvc.dependency.ssh import DependencySSH\nfrom dvc.dependency.http import DependencyHTTP\n\nfrom dvc.remote import Remote\n\nDEPS = [\n DependencyGS,\n DependencyHDFS,\n DependencyHTTP,\n DependencyS3,\n DependencySSH,\n # NOTE: DependencyLOCAL is the default choice\n]\n\nDEP_MAP = {\n \"local\": DependencyLOCAL,\n \"ssh\": DependencySSH,\n \"s3\": DependencyS3,\n \"gs\": DependencyGS,\n \"hdfs\": DependencyHDFS,\n \"http\": DependencyHTTP,\n \"https\": DependencyHTTP,\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[schema.Optional(OutputBase.PARAM_CACHE)]\ndel SCHEMA[schema.Optional(OutputBase.PARAM_METRIC)]\n\n\ndef _get(stage, p, info):\n parsed = urlparse(p)\n if parsed.scheme == \"remote\":\n name = Config.SECTION_REMOTE_FMT.format(parsed.netloc)\n sect = stage.repo.config.config[name]\n remote = Remote(stage.repo, sect)\n return DEP_MAP[remote.scheme](stage, p, info, remote=remote)\n\n for d in DEPS:\n if d.supported(p):\n return d(stage, p, info)\n return DependencyLOCAL(stage, p, info)\n\n\ndef loadd_from(stage, d_list):\n ret = []\n for d in d_list:\n p = d.pop(OutputBase.PARAM_PATH)\n ret.append(_get(stage, p, d))\n return ret\n\n\ndef loads_from(stage, s_list):\n ret = []\n for s in s_list:\n ret.append(_get(stage, s, {}))\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/dependency/base.py_from___future___import_un_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/base.py_from___future___import_un_", "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": 23, "span_ids": ["DependencyBase", "DependencyDoesNotExistError", "DependencyDoesNotExistError.__init__", "DependencyIsNotFileOrDirError", "imports", "DependencyIsNotFileOrDirError.__init__"], "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": "from __future__ import unicode_literals\n\nfrom dvc.exceptions import DvcException\n\n\nclass DependencyDoesNotExistError(DvcException):\n def __init__(self, path):\n msg = \"dependency '{}' does not exist\".format(path)\n super(DependencyDoesNotExistError, self).__init__(msg)\n\n\nclass DependencyIsNotFileOrDirError(DvcException):\n def __init__(self, path):\n msg = \"dependency '{}' is not a file or directory\".format(path)\n super(DependencyIsNotFileOrDirError, self).__init__(msg)\n\n\nclass DependencyBase(object):\n IS_DEPENDENCY = True\n\n DoesNotExistError = DependencyDoesNotExistError\n IsNotFileOrDirError = DependencyIsNotFileOrDirError", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": 9, "span_ids": ["imports", "DependencyGS"], "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 __future__ import unicode_literals\n\nfrom dvc.output.gs import OutputGS\nfrom dvc.dependency.base import DependencyBase\n\n\nclass DependencyGS(DependencyBase, OutputGS):\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/hdfs.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/hdfs.py__", "embedding": null, "metadata": {"file_path": "dvc/dependency/hdfs.py", "file_name": "hdfs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 9, "span_ids": ["imports", "DependencyHDFS"], "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 __future__ import unicode_literals\n\nfrom dvc.output.hdfs import OutputHDFS\nfrom dvc.dependency.base import DependencyBase\n\n\nclass DependencyHDFS(DependencyBase, OutputHDFS):\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/http.py_from___future___import_un_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/http.py_from___future___import_un_", "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": 20, "span_ids": ["DependencyHTTP", "imports", "DependencyHTTP.__init__"], "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": "from __future__ import unicode_literals\n\nfrom dvc.utils.compat import urlparse, urljoin\nfrom dvc.output.base import OutputBase\nfrom dvc.remote.http import RemoteHTTP\nfrom dvc.dependency.base import DependencyBase\n\n\nclass DependencyHTTP(DependencyBase, OutputBase):\n REMOTE = RemoteHTTP\n\n def __init__(self, stage, path, info=None, remote=None):\n super(DependencyHTTP, self).__init__(\n stage, path, info=info, remote=remote\n )\n if path.startswith(\"remote\"):\n path = urljoin(self.remote.cache_dir, urlparse(path).path)\n\n self.path_info = {\"scheme\": urlparse(path).scheme, \"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/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": 9, "span_ids": ["imports", "DependencyLOCAL"], "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 __future__ import unicode_literals\n\nfrom dvc.dependency.base import DependencyBase\nfrom dvc.output.local import OutputLOCAL\n\n\nclass DependencyLOCAL(DependencyBase, OutputLOCAL):\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/s3.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/s3.py__", "embedding": null, "metadata": {"file_path": "dvc/dependency/s3.py", "file_name": "s3.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 9, "span_ids": ["imports", "DependencyS3"], "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 __future__ import unicode_literals\n\nfrom dvc.output.s3 import OutputS3\nfrom dvc.dependency.base import DependencyBase\n\n\nclass DependencyS3(DependencyBase, OutputS3):\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/ssh.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/ssh.py__", "embedding": null, "metadata": {"file_path": "dvc/dependency/ssh.py", "file_name": "ssh.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 9, "span_ids": ["imports", "DependencySSH"], "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 __future__ import unicode_literals\n\nfrom dvc.output.ssh import OutputSSH\nfrom dvc.dependency.base import DependencyBase\n\n\nclass DependencySSH(DependencyBase, OutputSSH):\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py__Exceptions_raised_by_t_DvcException.__init__.super_DvcException_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py__Exceptions_raised_by_t_DvcException.__init__.super_DvcException_self_", "embedding": null, "metadata": {"file_path": "dvc/exceptions.py", "file_name": "exceptions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 29, "span_ids": ["DvcException.__init__", "DvcException", "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": "\"\"\"Exceptions raised by the dvc.\"\"\"\n\nfrom __future__ import unicode_literals\n\nfrom dvc.utils.compat import str, builtin_str\n\nimport os\nimport traceback\n\n\nclass DvcException(Exception):\n \"\"\"Base class for all dvc exceptions.\n\n Args:\n msg (unicode): message for this exception.\n cause (Exception): optional cause exception.\n \"\"\"\n\n def __init__(self, msg, cause=None):\n # NOTE: unlike python 3, python 2 doesn't have built-in support\n # for chained exceptions, so we are using our own implementation.\n self.cause = cause\n self.cause_tb = None\n if cause:\n try:\n self.cause_tb = traceback.format_exc()\n except AttributeError: # pragma: no cover\n pass\n super(DvcException, self).__init__(msg)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_OutputDuplicationError_OutputNotFoundError.__init__.super_OutputNotFoundError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_OutputDuplicationError_OutputNotFoundError.__init__.super_OutputNotFoundError", "embedding": null, "metadata": {"file_path": "dvc/exceptions.py", "file_name": "exceptions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 32, "end_line": 67, "span_ids": ["OutputNotFoundError.__init__", "OutputDuplicationError", "OutputNotFoundError", "OutputDuplicationError.__init__"], "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 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) or isinstance(output, builtin_str)\n assert isinstance(stages, list)\n assert all(\n isinstance(stage, str) or isinstance(stage, builtin_str)\n for stage in stages\n )\n msg = (\n \"file/directory '{}' is specified as an output in more than one\"\n \"stage: {}\"\n ).format(output, \"\\n \".join(stages))\n super(OutputDuplicationError, self).__init__(msg)\n\n\nclass 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):\n super(OutputNotFoundError, self).__init__(\n \"unable to find stage file with output '{path}'\".format(\n path=os.path.relpath(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_StagePathAsOutputError_StagePathAsOutputError.__init__.super_StagePathAsOutputEr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_StagePathAsOutputError_StagePathAsOutputError.__init__.super_StagePathAsOutputEr", "embedding": null, "metadata": {"file_path": "dvc/exceptions.py", "file_name": "exceptions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 70, "end_line": 89, "span_ids": ["StagePathAsOutputError.__init__", "StagePathAsOutputError"], "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 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 cwd (str): path to the directory.\n fname (str): path to the stage file that has cwd specified as an\n output.\n \"\"\"\n\n def __init__(self, wdir, fname):\n assert isinstance(wdir, str) or isinstance(wdir, builtin_str)\n assert isinstance(fname, str) or isinstance(fname, builtin_str)\n msg = (\n \"current working directory '{cwd}' is specified as an output in\"\n \" '{fname}'. Use another CWD to prevent any data removal.\".format(\n cwd=wdir, fname=fname\n )\n )\n super(StagePathAsOutputError, self).__init__(msg)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_CircularDependencyError_ArgumentDuplicationError.__init__.super_ArgumentDuplication": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_CircularDependencyError_ArgumentDuplicationError.__init__.super_ArgumentDuplication", "embedding": null, "metadata": {"file_path": "dvc/exceptions.py", "file_name": "exceptions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 92, "end_line": 123, "span_ids": ["ArgumentDuplicationError", "ArgumentDuplicationError.__init__", "CircularDependencyError", "CircularDependencyError.__init__"], "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 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) or isinstance(\n dependency, builtin_str\n )\n\n msg = (\n \"file/directory '{}' is specified as an output and as a \"\n \"dependency.\"\n )\n super(CircularDependencyError, self).__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) or isinstance(path, builtin_str)\n msg = \"file '{}' is specified more than once.\"\n super(ArgumentDuplicationError, self).__init__(msg.format(path))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_MoveNotDataSourceError_MoveNotDataSourceError.__init__.super_MoveNotDataSourceEr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_MoveNotDataSourceError_MoveNotDataSourceError.__init__.super_MoveNotDataSourceEr", "embedding": null, "metadata": {"file_path": "dvc/exceptions.py", "file_name": "exceptions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 126, "end_line": 141, "span_ids": ["MoveNotDataSourceError", "MoveNotDataSourceError.__init__"], "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 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(MoveNotDataSourceError, self).__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/istextfile.py__Use_heuristics_to_gues_TEXT_CHARS.b_join__int2byte_i_for": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/istextfile.py__Use_heuristics_to_gues_TEXT_CHARS.b_join__int2byte_i_for", "embedding": null, "metadata": {"file_path": "dvc/istextfile.py", "file_name": "istextfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 21, "span_ids": ["_int2byte", "impl", "docstring"], "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": "\"\"\"Use heuristics to guess if it is a text file or a binary file.\"\"\"\n\nfrom __future__ import unicode_literals\n\nfrom dvc.utils.compat import is_py3, open\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\n# A function that takes an integer in the 8-bit range and returns\n# a single-character byte object in py3 / a single-character string\n# in py2.\n#\ndef _int2byte(i):\n if is_py3:\n return bytes((i,))\n return chr(i)\n\n\nTEXT_CHARS = b\"\".join(_int2byte(i) for i in range(32, 127)) + b\"\\n\\r\\t\\f\\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/dvc/istextfile.py_istextfile_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/istextfile.py_istextfile_", "embedding": null, "metadata": {"file_path": "dvc/istextfile.py", "file_name": "istextfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 24, "end_line": 45, "span_ids": ["istextfile"], "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 istextfile(fname, blocksize=512):\n \"\"\" Uses heuristics to guess whether the given file is text or binary,\n by reading a single block of bytes from the file.\n If more than 30% of the chars in the block are non-text, or there\n are NUL ('\\x00') bytes in the block, assume this is a binary file.\n \"\"\"\n with open(fname, \"rb\") as fobj:\n block = fobj.read(blocksize)\n\n if not block:\n # An empty file is considered a valid text file\n return True\n\n if b\"\\x00\" in block:\n # Files with null bytes are binary\n return False\n\n # Use translate's 'deletechars' argument to efficiently remove all\n # occurrences of TEXT_CHARS from the block\n nontext = block.translate(None, TEXT_CHARS)\n return float(len(nontext)) / len(block) <= 0.30", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/lock.py__Manages_dvc_lock_file__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/lock.py__Manages_dvc_lock_file__", "embedding": null, "metadata": {"file_path": "dvc/lock.py", "file_name": "lock.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 61, "span_ids": ["Lock.lock", "Lock.unlock", "Lock._do_lock", "Lock", "Lock.__enter__", "Lock.__exit__", "LockError", "docstring", "Lock.__init__"], "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": "\"\"\"Manages dvc lock file.\"\"\"\n\nfrom __future__ import unicode_literals\n\nimport os\nimport time\nimport zc.lockfile\n\nfrom dvc.exceptions import DvcException\n\n\nclass LockError(DvcException):\n \"\"\"Thrown when unable to acquire the lock for dvc repo.\"\"\"\n\n\nclass Lock(object):\n \"\"\"Class for dvc repo lock.\n\n Args:\n dvc_dir (str): path to the directory that the lock should be created\n in.\n name (str): name of the lock file.\n \"\"\"\n\n LOCK_FILE = \"lock\"\n TIMEOUT = 5\n\n def __init__(self, dvc_dir, name=LOCK_FILE):\n self.lock_file = os.path.join(dvc_dir, name)\n self._lock = None\n\n def _do_lock(self):\n try:\n self._lock = zc.lockfile.LockFile(self.lock_file)\n except zc.lockfile.LockError:\n raise LockError(\n \"cannot perform the cmd since DVC is busy and \"\n \"locked. Please retry the cmd later.\"\n )\n\n def lock(self):\n \"\"\"Acquire lock for dvc repo.\"\"\"\n try:\n self._do_lock()\n return\n except LockError:\n time.sleep(self.TIMEOUT)\n\n self._do_lock()\n\n def unlock(self):\n \"\"\"Release lock for dvc repo.\"\"\"\n self._lock.close()\n self._lock = None\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/logger.py__Manages_logger_for_dvc_error.logger_error_out_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py__Manages_logger_for_dvc_error.logger_error_out_", "embedding": null, "metadata": {"file_path": "dvc/logger.py", "file_name": "logger.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 77, "span_ids": ["warning", "error", "docstring", "debug", "info"], "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": "\"\"\"Manages logger for dvc repo.\"\"\"\n\nfrom __future__ import unicode_literals\n\nfrom dvc.exceptions import DvcException\nfrom dvc.utils.compat import str\nfrom dvc.progress import progress_aware\n\nimport re\nimport sys\nimport logging\nimport traceback\n\nfrom contextlib import contextmanager\n\nimport colorama\n\n\n@progress_aware\ndef info(message):\n \"\"\"Prints an info message.\"\"\"\n logger.info(message)\n\n\n# Do not annotate debug with progress_aware. Why? Debug messages are called\n# in analytics.py. Trigger introduced by @progress_aware may run even\n# if log_level != DEBUG (look at Progress.print) Which might result in\n# messy terminal after any command (because analytics run in separate thread)\ndef debug(message):\n \"\"\"Prints a debug message.\"\"\"\n prefix = colorize(\"Debug\", color=\"blue\")\n\n out = \"{prefix}: {message}\".format(prefix=prefix, message=message)\n\n logger.debug(out)\n\n\n@progress_aware\ndef warning(message, parse_exception=False):\n \"\"\"Prints a warning message.\"\"\"\n prefix = colorize(\"Warning\", color=\"yellow\")\n\n exception, stack_trace = None, \"\"\n if parse_exception:\n exception, stack_trace = _parse_exc()\n\n out = \"{prefix}: {description}\".format(\n prefix=prefix, description=_description(message, exception)\n )\n\n if stack_trace:\n out += \"\\n{stack_trace}\".format(stack_trace=stack_trace)\n\n logger.warning(out)\n\n\n@progress_aware\ndef error(message=None):\n \"\"\"Prints an error message.\"\"\"\n prefix = colorize(\"Error\", color=\"red\")\n\n exception, stack_trace = _parse_exc()\n\n out = (\n \"{prefix}: {description}\"\n \"\\n\"\n \"{stack_trace}\"\n \"\\n\"\n \"{footer}\".format(\n prefix=prefix,\n description=_description(message, exception),\n stack_trace=stack_trace,\n footer=_footer(),\n )\n )\n\n logger.error(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/logger.py_box_box.logger_info_box_str_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py_box_box.logger_info_box_str_", "embedding": null, "metadata": {"file_path": "dvc/logger.py", "file_name": "logger.py", "file_type": "text/x-python", "category": "implementation", "start_line": 72, "end_line": 116, "span_ids": ["box"], "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 box(message, border_color=None):\n \"\"\"Prints a message in a box.\n\n Args:\n message (unicode): message to print.\n border_color (unicode): name of a 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 logger.info(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/logger.py_level_set_default_level.logger_setLevel_logging_I": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py_level_set_default_level.logger_setLevel_logging_I", "embedding": null, "metadata": {"file_path": "dvc/logger.py", "file_name": "logger.py", "file_type": "text/x-python", "category": "implementation", "start_line": 127, "end_line": 212, "span_ids": ["quiet", "is_quiet", "colorize", "be_verbose", "set_default_level", "be_quiet", "set_level", "verbose", "level", "is_verbose"], "tokens": 401}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def level():\n \"\"\"Returns current log level.\"\"\"\n return logger.getEffectiveLevel()\n\n\ndef set_level(level_name):\n \"\"\"Sets log level.\n\n Args:\n level_name (str): log level name. E.g. info, debug, warning, error,\n critical.\n \"\"\"\n if not level_name:\n return\n\n levels = {\n \"info\": logging.INFO,\n \"debug\": logging.DEBUG,\n \"warning\": logging.WARNING,\n \"error\": logging.ERROR,\n \"critical\": logging.CRITICAL,\n }\n\n logger.setLevel(levels.get(level_name))\n\n\ndef be_quiet():\n \"\"\"Disables all messages except critical ones.\"\"\"\n logger.setLevel(logging.CRITICAL)\n\n\ndef be_verbose():\n \"\"\"Enables all messages.\"\"\"\n logger.setLevel(logging.DEBUG)\n\n\n@contextmanager\ndef verbose():\n \"\"\"Enables verbose mode for the context.\"\"\"\n previous_level = level()\n be_verbose()\n yield\n logger.setLevel(previous_level)\n\n\n@contextmanager\ndef quiet():\n \"\"\"Enables quiet mode for the context.\"\"\"\n previous_level = level()\n be_quiet()\n yield\n logger.setLevel(previous_level)\n\n\ndef is_quiet():\n \"\"\"Returns whether or not all messages except critical ones are\n disabled.\n \"\"\"\n return level() == logging.CRITICAL\n\n\ndef is_verbose():\n \"\"\"Returns whether or not all messages are enabled.\"\"\"\n return level() == logging.DEBUG\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 )\n\n\ndef set_default_level():\n \"\"\"Sets default log level.\"\"\"\n logger.setLevel(logging.INFO)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py__add_handlers__add_handlers.logger_addHandler_sh_err_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py__add_handlers__add_handlers.logger_addHandler_sh_err_", "embedding": null, "metadata": {"file_path": "dvc/logger.py", "file_name": "logger.py", "file_type": "text/x-python", "category": "implementation", "start_line": 215, "end_line": 237, "span_ids": ["_add_handlers"], "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 _add_handlers():\n # NOTE: We need to initialize colorama before setting the stream handlers\n # so it can wrap stdout/stderr and convert color codes to Windows.\n colorama.init()\n\n formatter = \"%(message)s\"\n\n class _LogLevelFilter(logging.Filter):\n # pylint: disable=too-few-public-methods\n def filter(self, record):\n return record.levelno <= logging.WARNING\n\n sh_out = logging.StreamHandler(sys.stdout)\n sh_out.setFormatter(logging.Formatter(formatter))\n sh_out.setLevel(logging.DEBUG)\n sh_out.addFilter(_LogLevelFilter())\n\n sh_err = logging.StreamHandler(sys.stderr)\n sh_err.setFormatter(logging.Formatter(formatter))\n sh_err.setLevel(logging.ERROR)\n\n logger.addHandler(sh_out)\n logger.addHandler(sh_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/logger.py__walk_exc__walk_exc.return.exc_list_tb_list": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py__walk_exc__walk_exc.return.exc_list_tb_list", "embedding": null, "metadata": {"file_path": "dvc/logger.py", "file_name": "logger.py", "file_type": "text/x-python", "category": "implementation", "start_line": 232, "end_line": 243, "span_ids": ["_walk_exc"], "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 _walk_exc(exc):\n exc_list = [str(exc)]\n tb_list = [traceback.format_exc()]\n\n # NOTE: parsing chained exceptions. See dvc/exceptions.py for more info.\n while hasattr(exc, \"cause\") and exc.cause is not None:\n exc_list.append(str(exc.cause))\n if hasattr(exc, \"cause_tb\") and exc.cause_tb is not None:\n tb_list.insert(0, str(exc.cause_tb))\n exc = exc.cause\n\n return exc_list, tb_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/logger.py__parse_exc_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py__parse_exc_", "embedding": null, "metadata": {"file_path": "dvc/logger.py", "file_name": "logger.py", "file_type": "text/x-python", "category": "implementation", "start_line": 254, "end_line": 316, "span_ids": ["_description", "_visual_width", "impl", "_parse_exc", "_footer", "_visual_center"], "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 _parse_exc():\n exc = sys.exc_info()[1]\n if not exc:\n return (None, \"\")\n\n exc_list, tb_list = _walk_exc(exc)\n\n exception = \": \".join(exc_list)\n\n if is_verbose():\n stack_trace = \"{line}\\n{stack_trace}{line}\\n\".format(\n line=colorize(\"-\" * 60, color=\"red\"),\n stack_trace=\"\\n\".join(tb_list),\n )\n else:\n stack_trace = \"\"\n\n return (exception, stack_trace)\n\n\ndef _description(message, exception):\n if exception and message:\n description = \"{message} - {exception}\"\n elif exception:\n description = \"{exception}\"\n elif message:\n description = \"{message}\"\n else:\n raise DvcException(\n \"Unexpected error - either exception or message must be provided\"\n )\n\n return description.format(message=message, exception=exception)\n\n\ndef _footer():\n return \"{phrase} Hit us up at {url}, we are always happy to help!\".format(\n phrase=colorize(\"Having any troubles?\", \"yellow\"),\n url=colorize(\"https://dvc.org/support\", \"blue\"),\n )\n\n\ndef _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\nlogger = logging.getLogger(\"dvc\") # pylint: disable=invalid-name\n\nset_default_level()\n_add_handlers()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_": {"__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_", "embedding": null, "metadata": {"file_path": "dvc/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 48, "span_ids": ["main", "docstring"], "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": "\"\"\"Main entry point for dvc CLI.\"\"\"\n\nfrom __future__ import unicode_literals\n\nimport dvc.logger as logger\nfrom dvc.cli import parse_args\nfrom dvc.command.base import CmdBase\nfrom dvc.analytics import Analytics\nfrom dvc.exceptions import NotDvcRepoError, DvcParserError\n\n\ndef 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 cmd = None\n try:\n args = parse_args(argv)\n\n # Init loglevel early in case we'll run\n # into errors before setting it properly\n CmdBase.set_loglevel(args)\n\n cmd = args.func(args)\n\n ret = cmd.run_cmd()\n except KeyboardInterrupt:\n logger.error(\"interrupted by the user\")\n ret = 252\n except NotDvcRepoError:\n logger.error()\n ret = 253\n except DvcParserError:\n ret = 254\n except Exception: # pylint: disable=broad-except\n logger.error(\"unexpected error\")\n ret = 255\n\n Analytics().send_cmd(cmd, args, ret)\n\n return ret", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/__init__.py_loadd_from_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/__init__.py_loadd_from_", "embedding": null, "metadata": {"file_path": "dvc/output/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 101, "end_line": 137, "span_ids": ["loadd_from", "loads_from"], "tokens": 196}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def loadd_from(stage, d_list):\n ret = []\n for d in d_list:\n p = d.pop(OutputBase.PARAM_PATH)\n cache = d.pop(OutputBase.PARAM_CACHE, True)\n metric = d.pop(OutputBase.PARAM_METRIC, False)\n persist = d.pop(OutputBase.PARAM_PERSIST, False)\n tags = d.pop(OutputBase.PARAM_TAGS, None)\n ret.append(\n _get(\n stage,\n p,\n info=d,\n cache=cache,\n metric=metric,\n persist=persist,\n tags=tags,\n )\n )\n return ret\n\n\ndef loads_from(stage, s_list, use_cache=True, metric=False, persist=False):\n ret = []\n for s in s_list:\n ret.append(\n _get(\n stage,\n s,\n info={},\n cache=use_cache,\n metric=metric,\n persist=persist,\n )\n )\n return ret", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_from___future___import_un_OutputAlreadyTrackedError.__init__.super_OutputAlreadyTracke": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_from___future___import_un_OutputAlreadyTrackedError.__init__.super_OutputAlreadyTracke", "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": 26, "span_ids": ["OutputIsNotFileOrDirError.__init__", "imports", "OutputDoesNotExistError.__init__", "OutputIsNotFileOrDirError", "OutputDoesNotExistError", "OutputAlreadyTrackedError.__init__", "OutputAlreadyTrackedError"], "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": "from __future__ import unicode_literals\n\nimport re\nfrom schema import Or, Optional\n\nfrom dvc.exceptions import DvcException\nfrom dvc.utils.compat import str\nfrom dvc.remote.base import RemoteBase\n\n\nclass OutputDoesNotExistError(DvcException):\n def __init__(self, path):\n msg = \"output '{}' does not exist\".format(path)\n super(OutputDoesNotExistError, self).__init__(msg)\n\n\nclass OutputIsNotFileOrDirError(DvcException):\n def __init__(self, path):\n msg = \"output '{}' is not a file or directory\".format(path)\n super(OutputIsNotFileOrDirError, self).__init__(msg)\n\n\nclass OutputAlreadyTrackedError(DvcException):\n def __init__(self, path):\n msg = \"output '{}' is already tracked by scm (e.g. git)\".format(path)\n super(OutputAlreadyTrackedError, self).__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/output/base.py_OutputBase.verify_metric_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.verify_metric_", "embedding": null, "metadata": {"file_path": "dvc/output/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 209, "end_line": 263, "span_ids": ["OutputBase.download", "OutputBase.checkout", "OutputBase.remove", "OutputBase.unprotect", "OutputBase.get_files_number", "OutputBase.verify_metric", "OutputBase.move"], "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 OutputBase(object):\n\n def verify_metric(self):\n raise DvcException(\n \"verify metric is not supported for {}\".format(self.scheme)\n )\n\n def download(self, to_info, resume=False):\n self.remote.download([self.path_info], [to_info], resume=resume)\n\n def checkout(self, force=False, progress_callback=None, tag=None):\n if not self.use_cache:\n return\n\n if tag:\n info = self.tags[tag]\n else:\n info = self.info\n\n getattr(self.repo.cache, self.scheme).checkout(\n self.path_info,\n info,\n force=force,\n progress_callback=progress_callback,\n )\n\n def remove(self, ignore_remove=False):\n self.remote.remove(self.path_info)\n if self.scheme != \"local\":\n return\n\n if ignore_remove and self.use_cache and self.is_local:\n self.repo.scm.ignore_remove(self.path)\n\n def move(self, out):\n if self.scheme == \"local\" and self.use_cache and self.is_local:\n self.repo.scm.ignore_remove(self.path)\n\n self.remote.move(self.path_info, out.path_info)\n self.url = out.url\n self.path_info = out.path_info\n self.save()\n self.commit()\n\n if self.scheme == \"local\" and self.use_cache and self.is_local:\n self.repo.scm.ignore(self.path)\n\n def get_files_number(self):\n if self.use_cache and self.checksum:\n return 1\n\n return 0\n\n def unprotect(self):\n if self.exists:\n self.remote.unprotect(self.path_info)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/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": 9, "span_ids": ["imports", "OutputGS"], "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 __future__ import unicode_literals\n\nfrom dvc.remote.gs import RemoteGS\nfrom dvc.output.s3 import OutputS3\n\n\nclass OutputGS(OutputS3):\n REMOTE = RemoteGS", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/hdfs.py_from___future___import_un_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/hdfs.py_from___future___import_un_", "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": 38, "span_ids": ["imports", "OutputHDFS", "OutputHDFS.__init__"], "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": "from __future__ import unicode_literals\n\nimport posixpath\n\nfrom dvc.utils.compat import urlparse\nfrom dvc.output.base import OutputBase\nfrom dvc.remote.hdfs import RemoteHDFS\n\n\nclass OutputHDFS(OutputBase):\n REMOTE = RemoteHDFS\n\n def __init__(\n self,\n stage,\n path,\n info=None,\n remote=None,\n cache=True,\n metric=False,\n persist=False,\n tags=None,\n ):\n super(OutputHDFS, self).__init__(\n stage,\n path,\n info=info,\n remote=remote,\n cache=cache,\n metric=metric,\n persist=persist,\n tags=tags,\n )\n if remote:\n path = posixpath.join(remote.url, urlparse(path).path.lstrip(\"/\"))\n user = remote.user if remote else self.group(\"user\")\n self.path_info = {\"scheme\": \"hdfs\", \"user\": user, \"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/output/local.py_from___future___import_un_OutputLOCAL.verify_metric.if_not_istextfile_self_pa.raise_DvcException_msg_fo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/local.py_from___future___import_un_OutputLOCAL.verify_metric.if_not_istextfile_self_pa.raise_DvcException_msg_fo", "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": 119, "span_ids": ["OutputLOCAL.__str__", "OutputLOCAL.__init__", "OutputLOCAL.assign_to_stage_file", "OutputLOCAL.stage_path", "OutputLOCAL.dumpd", "OutputLOCAL.is_dir_cache", "imports", "OutputLOCAL.rel_path", "OutputLOCAL.cache", "OutputLOCAL.verify_metric", "OutputLOCAL.is_local", "OutputLOCAL.sep", "OutputLOCAL"], "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": "from __future__ import unicode_literals\n\nimport os\n\nimport dvc.logger as logger\nfrom dvc.utils.compat import urlparse\nfrom dvc.istextfile import istextfile\nfrom dvc.exceptions import DvcException\nfrom dvc.remote.local import RemoteLOCAL\nfrom dvc.output.base import OutputBase, OutputAlreadyTrackedError\n\n\nclass OutputLOCAL(OutputBase):\n REMOTE = RemoteLOCAL\n\n def __init__(\n self,\n stage,\n path,\n info=None,\n remote=None,\n cache=True,\n metric=False,\n persist=False,\n tags=None,\n ):\n super(OutputLOCAL, self).__init__(\n stage,\n path,\n info,\n remote=remote,\n cache=cache,\n metric=metric,\n persist=persist,\n tags=tags,\n )\n if remote:\n p = os.path.join(\n remote.prefix, urlparse(self.url).path.lstrip(\"/\")\n )\n else:\n p = path\n\n if not os.path.isabs(p):\n p = self.remote.to_ospath(p)\n p = os.path.join(stage.wdir, p)\n p = os.path.abspath(os.path.normpath(p))\n\n self.path_info = {\"scheme\": \"local\", \"path\": p}\n\n self._dir_cache = {}\n\n def __str__(self):\n return self.rel_path\n\n @property\n def is_local(self):\n return urlparse(self.url).scheme != \"remote\" and not os.path.isabs(\n self.url\n )\n\n def assign_to_stage_file(self, stage):\n from dvc.repo import Repo\n\n fullpath = os.path.abspath(stage.wdir)\n self.path_info[\"path\"] = os.path.join(fullpath, self.stage_path)\n\n self.repo = Repo(self.path)\n\n self.stage = stage\n return self\n\n @property\n def sep(self):\n return os.sep\n\n @property\n def rel_path(self):\n return os.path.relpath(self.path)\n\n @property\n def stage_path(self):\n return os.path.relpath(self.path, self.stage.wdir)\n\n @property\n def cache(self):\n return self.repo.cache.local.get(self.checksum)\n\n @property\n def is_dir_cache(self):\n return self.repo.cache.local.is_dir_cache(self.checksum)\n\n def dumpd(self):\n ret = super(OutputLOCAL, self).dumpd()\n if self.is_local:\n path = self.remote.unixpath(\n os.path.relpath(self.path, self.stage.wdir)\n )\n else:\n path = self.url\n\n ret[self.PARAM_PATH] = path\n\n return ret\n\n def verify_metric(self):\n if not self.metric:\n return\n\n if not os.path.exists(self.path):\n return\n\n if os.path.isdir(self.path):\n msg = \"directory '{}' cannot be used as metrics.\"\n raise DvcException(msg.format(self.rel_path))\n\n if not istextfile(self.path):\n msg = \"binary file '{}' cannot be used as metrics.\"\n raise DvcException(msg.format(self.rel_path))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/local.py_OutputLOCAL.save_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/local.py_OutputLOCAL.save_", "embedding": null, "metadata": {"file_path": "dvc/output/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 121, "end_line": 169, "span_ids": ["OutputLOCAL.dir_cache", "OutputLOCAL.save", "OutputLOCAL.get_files_number"], "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 OutputLOCAL(OutputBase):\n\n def save(self):\n if not os.path.exists(self.path):\n raise self.DoesNotExistError(self.rel_path)\n\n if not os.path.isfile(self.path) and not os.path.isdir(self.path):\n raise self.IsNotFileOrDirError(self.rel_path)\n\n if (os.path.isfile(self.path) and os.path.getsize(self.path) == 0) or (\n os.path.isdir(self.path) and len(os.listdir(self.path)) == 0\n ):\n msg = \"file/directory '{}' is empty.\".format(self.rel_path)\n logger.warning(msg)\n\n if not self.use_cache:\n self.info = self.remote.save_info(self.path_info)\n self.verify_metric()\n if not self.IS_DEPENDENCY:\n msg = \"Output '{}' doesn't use cache. Skipping saving.\"\n logger.info(msg.format(self.rel_path))\n return\n\n assert not self.IS_DEPENDENCY\n\n if not self.changed():\n msg = \"Output '{}' didn't change. Skipping saving.\"\n logger.info(msg.format(self.rel_path))\n return\n\n if self.is_local:\n if self.repo.scm.is_tracked(self.path):\n raise OutputAlreadyTrackedError(self.rel_path)\n\n if self.use_cache:\n self.repo.scm.ignore(self.path)\n\n self.info = self.remote.save_info(self.path_info)\n\n @property\n def dir_cache(self):\n return self.repo.cache.local.load_dir_cache(self.checksum)\n\n def get_files_number(self):\n if self.cache is None:\n return 0\n\n if self.is_dir_cache:\n return len(self.dir_cache)\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/output/s3.py_from___future___import_un_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/s3.py_from___future___import_un_", "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": 43, "span_ids": ["imports", "OutputS3.__init__", "OutputS3"], "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": "from __future__ import unicode_literals\n\nimport posixpath\n\nfrom dvc.remote.s3 import RemoteS3\nfrom dvc.utils.compat import urlparse\nfrom dvc.output.base import OutputBase\n\n\nclass OutputS3(OutputBase):\n REMOTE = RemoteS3\n\n def __init__(\n self,\n stage,\n path,\n info=None,\n remote=None,\n cache=True,\n metric=False,\n persist=False,\n tags=None,\n ):\n super(OutputS3, self).__init__(\n stage,\n path,\n info=info,\n remote=remote,\n cache=cache,\n metric=metric,\n persist=persist,\n tags=tags,\n )\n bucket = remote.bucket if remote else urlparse(path).netloc\n path = urlparse(path).path.lstrip(\"/\")\n if remote:\n path = posixpath.join(remote.prefix, path)\n self.path_info = {\n \"scheme\": self.scheme,\n \"bucket\": bucket,\n \"path\": 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/output/ssh.py_from___future___import_un_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/ssh.py_from___future___import_un_", "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": 58, "span_ids": ["imports", "OutputSSH.__init__", "OutputSSH"], "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": "from __future__ import unicode_literals\n\nimport getpass\nimport posixpath\n\nfrom dvc.utils.compat import urlparse\nfrom dvc.output.base import OutputBase\nfrom dvc.remote.ssh import RemoteSSH\n\n\nclass OutputSSH(OutputBase):\n REMOTE = RemoteSSH\n\n def __init__(\n self,\n stage,\n path,\n info=None,\n remote=None,\n cache=True,\n metric=False,\n persist=False,\n tags=None,\n ):\n super(OutputSSH, self).__init__(\n stage,\n path,\n info=info,\n remote=remote,\n cache=cache,\n metric=metric,\n persist=persist,\n tags=tags,\n )\n parsed = urlparse(path)\n host = remote.host if remote else parsed.hostname\n port = (\n remote.port if remote else (parsed.port or RemoteSSH.DEFAULT_PORT)\n )\n user = (\n remote.user if remote else (parsed.username or getpass.getuser())\n )\n\n if remote:\n path = posixpath.join(\n remote.prefix, urlparse(path).path.lstrip(\"/\")\n )\n else:\n path = parsed.path\n\n self.path_info = {\n \"scheme\": \"ssh\",\n \"host\": host,\n \"port\": port,\n \"user\": user,\n \"path\": 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/progress.py__Manages_progress_bars__Progress.finish_target.with_self__lock_.self._line.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/progress.py__Manages_progress_bars__Progress.finish_target.with_self__lock_.self._line.None", "embedding": null, "metadata": {"file_path": "dvc/progress.py", "file_name": "progress.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 80, "span_ids": ["Progress.refresh", "Progress.finish_target", "Progress", "Progress.update_target", "Progress.set_n_total", "Progress.is_finished", "Progress.__init__", "Progress.clearln", "docstring", "Progress.reset", "Progress._writeln"], "tokens": 455}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom dvc.utils.compat import str\n\nimport sys\nimport threading\n\nCLEARLINE_PATTERN = \"\\r\\x1b[K\"\n\n\nclass Progress(object):\n \"\"\"\n Simple multi-target progress bar.\n \"\"\"\n\n def __init__(self):\n self._n_total = 0\n self._n_finished = 0\n self._lock = threading.Lock()\n self._line = None\n\n def set_n_total(self, total):\n \"\"\"Sets total number of targets.\"\"\"\n self._n_total = total\n self._n_finished = 0\n\n @property\n def is_finished(self):\n \"\"\"Returns if all targets have finished.\"\"\"\n return self._n_total == self._n_finished\n\n def clearln(self):\n self.print(CLEARLINE_PATTERN, end=\"\")\n\n def _writeln(self, line):\n self.clearln()\n self.print(line, end=\"\")\n sys.stdout.flush()\n\n def reset(self):\n with self._lock:\n self._n_total = 0\n self._n_finished = 0\n self._line = None\n\n def refresh(self, line=None):\n \"\"\"Refreshes progress bar.\"\"\"\n # Just go away if it is locked. Will update next time\n if not self._lock.acquire(False):\n return\n\n if line is None:\n line = self._line\n\n if sys.stdout.isatty() and line is not None:\n self._writeln(line)\n self._line = line\n\n self._lock.release()\n\n def update_target(self, name, current, total):\n \"\"\"Updates progress bar for a specified target.\"\"\"\n self.refresh(self._bar(name, current, total))\n\n def finish_target(self, name):\n \"\"\"Finishes progress bar for a specified target.\"\"\"\n # We have to write a msg about finished target\n with self._lock:\n pbar = self._bar(name, 100, 100)\n\n if sys.stdout.isatty():\n self.clearln()\n\n self.print(pbar)\n\n self._n_finished += 1\n self._line = 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/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": 62, "span_ids": ["password", "confirm", "_ask", "docstring"], "tokens": 311}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Manages user prompts.\"\"\"\n\nfrom __future__ import unicode_literals\nfrom __future__ import print_function\n\nimport sys\nfrom getpass import getpass\n\nfrom dvc.progress import progress_aware\nfrom dvc.utils.compat import input\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 print(\n \"Your response must be one of: {options}. \"\n \"Please try again.\".format(options=limited_to)\n )\n\n\n@progress_aware\ndef confirm(statement):\n \"\"\"Ask the user for confirmation about the specified statement.\n\n Args:\n statement (unicode): statement to ask the user confirmation about.\n\n Returns:\n bool: whether or not specified statement was confirmed.\n \"\"\"\n prompt = \"{statement} [y/n]\".format(statement=statement)\n answer = _ask(prompt, limited_to=[\"yes\", \"no\", \"y\", \"n\"])\n return answer and answer.startswith(\"y\")\n\n\n@progress_aware\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 prompt = \"{statement}: \".format(statement=statement)\n return getpass(prompt)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_from___future___import_un_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/__init__.py_from___future___import_un_", "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": 32, "span_ids": ["imports", "Remote", "_get"], "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": "from __future__ import unicode_literals\n\nfrom dvc.remote.azure import RemoteAzure\nfrom dvc.remote.gs import RemoteGS\nfrom dvc.remote.hdfs import RemoteHDFS\nfrom dvc.remote.local import RemoteLOCAL\nfrom dvc.remote.s3 import RemoteS3\nfrom dvc.remote.ssh import RemoteSSH\nfrom dvc.remote.http import RemoteHTTP\n\n\nREMOTES = [\n RemoteAzure,\n RemoteGS,\n RemoteHDFS,\n RemoteHTTP,\n RemoteS3,\n RemoteSSH,\n # NOTE: RemoteLOCAL is the default\n]\n\n\ndef _get(config):\n for remote in REMOTES:\n if remote.supported(config):\n return remote\n return RemoteLOCAL\n\n\ndef Remote(repo, config):\n return _get(config)(repo, 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/dvc/remote/azure.py_from___future___import_ab_Callback.__call__.progress_update_target_se": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_from___future___import_ab_Callback.__call__.progress_update_target_se", "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": 25, "span_ids": ["Callback.__init__", "imports", "Callback", "Callback.__call__"], "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": "from __future__ import absolute_import\nfrom __future__ import unicode_literals\n\nimport os\nimport re\n\ntry:\n from azure.storage.blob import BlockBlobService\nexcept ImportError:\n BlockBlobService = None\n\nimport dvc.logger as logger\nfrom dvc.utils import tmp_fname, move\nfrom dvc.utils.compat import urlparse, makedirs\nfrom dvc.progress import progress\nfrom dvc.config import Config\nfrom dvc.remote.base import RemoteBase\n\n\nclass Callback(object):\n def __init__(self, name):\n self.name = name\n\n def __call__(self, current, total):\n progress.update_target(self.name, current, total)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_RemoteAzure_RemoteAzure.list_cache_paths.return.self__list_paths_self_buc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_RemoteAzure_RemoteAzure.list_cache_paths.return.self__list_paths_self_buc", "embedding": null, "metadata": {"file_path": "dvc/remote/azure.py", "file_name": "azure.py", "file_type": "text/x-python", "category": "implementation", "start_line": 28, "end_line": 112, "span_ids": ["RemoteAzure._list_paths", "RemoteAzure.list_cache_paths", "RemoteAzure.__init__", "RemoteAzure", "RemoteAzure.blob_service", "RemoteAzure.remove"], "tokens": 587}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteAzure(RemoteBase):\n scheme = \"azure\"\n REGEX = (\n r\"azure://((?P[^=;]*)?|(\"\n # backward compatibility\n r\"(ContainerName=(?P[^;]+);?)?\"\n r\"(?P.+)?)?)$\"\n )\n REQUIRES = {\"azure-storage-blob\": BlockBlobService}\n PARAM_CHECKSUM = \"etag\"\n COPY_POLL_SECONDS = 5\n\n def __init__(self, repo, config):\n super(RemoteAzure, self).__init__(repo, config)\n\n self.url = config.get(Config.SECTION_REMOTE_URL, \"azure://\")\n match = re.match(self.REGEX, self.url) # backward compatibility\n\n path = match.group(\"path\")\n self.bucket = (\n urlparse(self.url if path else \"\").netloc\n or match.group(\"container_name\") # backward compatibility\n or os.getenv(\"AZURE_STORAGE_CONTAINER_NAME\")\n )\n\n self.prefix = urlparse(self.url).path.lstrip(\"/\") if path else \"\"\n\n self.connection_string = (\n config.get(Config.SECTION_AZURE_CONNECTION_STRING)\n or match.group(\"connection_string\") # backward compatibility\n or os.getenv(\"AZURE_STORAGE_CONNECTION_STRING\")\n )\n\n if not self.bucket:\n raise ValueError(\"azure storage container name missing\")\n\n if not self.connection_string:\n raise ValueError(\"azure storage connection string missing\")\n\n self.__blob_service = None\n\n self.path_info = {\"scheme\": self.scheme, \"bucket\": self.bucket}\n\n @property\n def blob_service(self):\n if self.__blob_service is None:\n logger.debug(\"URL {}\".format(self.url))\n logger.debug(\"Connection string {}\".format(self.connection_string))\n self.__blob_service = BlockBlobService(\n connection_string=self.connection_string\n )\n logger.debug(\"Container name {}\".format(self.bucket))\n self.__blob_service.create_container(self.bucket)\n return self.__blob_service\n\n def remove(self, path_info):\n if path_info[\"scheme\"] != self.scheme:\n raise NotImplementedError\n\n logger.debug(\n \"Removing azure://{}/{}\".format(\n path_info[\"bucket\"], path_info[\"path\"]\n )\n )\n\n self.blob_service.delete_blob(path_info[\"bucket\"], path_info[\"path\"])\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 list_cache_paths(self):\n return self._list_paths(self.bucket, self.prefix)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_RemoteAzure.upload_RemoteAzure.upload.for_from_info_to_info_n.try_.else_.progress_finish_target_na": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_RemoteAzure.upload_RemoteAzure.upload.for_from_info_to_info_n.try_.else_.progress_finish_target_na", "embedding": null, "metadata": {"file_path": "dvc/remote/azure.py", "file_name": "azure.py", "file_type": "text/x-python", "category": "implementation", "start_line": 114, "end_line": 146, "span_ids": ["RemoteAzure.upload"], "tokens": 218}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteAzure(RemoteBase):\n\n def upload(self, from_infos, to_infos, names=None):\n names = self._verify_path_args(to_infos, from_infos, names)\n\n for from_info, to_info, name in zip(from_infos, to_infos, names):\n if to_info[\"scheme\"] != self.scheme:\n raise NotImplementedError\n\n if from_info[\"scheme\"] != \"local\":\n raise NotImplementedError\n\n bucket = to_info[\"bucket\"]\n path = to_info[\"path\"]\n\n logger.debug(\n \"Uploading '{}' to '{}/{}'\".format(\n from_info[\"path\"], bucket, path\n )\n )\n\n if not name:\n name = os.path.basename(from_info[\"path\"])\n\n cb = Callback(name)\n\n try:\n self.blob_service.create_blob_from_path(\n bucket, path, from_info[\"path\"], progress_callback=cb\n )\n except Exception:\n msg = \"failed to upload '{}'\".format(from_info[\"path\"])\n logger.warning(msg)\n else:\n progress.finish_target(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/azure.py_RemoteAzure.download_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_RemoteAzure.download_", "embedding": null, "metadata": {"file_path": "dvc/remote/azure.py", "file_name": "azure.py", "file_type": "text/x-python", "category": "implementation", "start_line": 148, "end_line": 194, "span_ids": ["RemoteAzure.download"], "tokens": 283}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteAzure(RemoteBase):\n\n def download(\n self,\n from_infos,\n to_infos,\n no_progress_bar=False,\n names=None,\n resume=False,\n ):\n names = self._verify_path_args(from_infos, to_infos, names)\n\n for to_info, from_info, name in zip(to_infos, from_infos, names):\n if from_info[\"scheme\"] != self.scheme:\n raise NotImplementedError\n\n if to_info[\"scheme\"] != \"local\":\n raise NotImplementedError\n\n bucket = from_info[\"bucket\"]\n path = from_info[\"path\"]\n\n logger.debug(\n \"Downloading '{}/{}' to '{}'\".format(\n bucket, path, to_info[\"path\"]\n )\n )\n\n tmp_file = tmp_fname(to_info[\"path\"])\n if not name:\n name = os.path.basename(to_info[\"path\"])\n\n cb = None if no_progress_bar else Callback(name)\n\n makedirs(os.path.dirname(to_info[\"path\"]), exist_ok=True)\n\n try:\n self.blob_service.get_blob_to_path(\n bucket, path, tmp_file, progress_callback=cb\n )\n except Exception:\n msg = \"failed to download '{}/{}'\".format(bucket, path)\n logger.warning(msg)\n else:\n move(tmp_file, to_info[\"path\"])\n\n if not no_progress_bar:\n progress.finish_target(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/base.py_from___future___import_un_RemoteMissingDepsError.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_from___future___import_un_RemoteMissingDepsError.pass", "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": 52, "span_ids": ["DataCloudError", "RemoteMissingDepsError", "imports", "RemoteCmdError", "RemoteActionNotImplemented", "DataCloudError.__init__", "RemoteCmdError.__init__", "RemoteActionNotImplemented.__init__"], "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": "from __future__ import unicode_literals\n\nfrom dvc.utils.compat import str\n\nimport re\nimport posixpath\nfrom multiprocessing import cpu_count\n\nimport dvc.prompt as prompt\nimport dvc.logger as logger\nfrom dvc.config import Config\nfrom dvc.exceptions import DvcException, ConfirmRemoveError\n\n\nSTATUS_OK = 1\nSTATUS_MISSING = 2\nSTATUS_NEW = 3\nSTATUS_DELETED = 4\n\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 DataCloudError(DvcException):\n \"\"\" Data Cloud exception \"\"\"\n\n def __init__(self, msg):\n super(DataCloudError, self).__init__(\"Data sync error: {}\".format(msg))\n\n\nclass RemoteCmdError(DvcException):\n def __init__(self, remote, cmd, ret, err):\n super(RemoteCmdError, self).__init__(\n \"{remote} command '{cmd}' finished with non-zero return code\"\n \" {ret}': {err}\".format(remote=remote, cmd=cmd, ret=ret, err=err)\n )\n\n\nclass RemoteActionNotImplemented(DvcException):\n def __init__(self, action, scheme):\n m = \"{} is not supported by {} remote\".format(action, scheme)\n super(RemoteActionNotImplemented, self).__init__(m)\n\n\nclass RemoteMissingDepsError(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/remote/base.py_RemoteBase_RemoteBase.save_info.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBase_RemoteBase.save_info.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 54, "end_line": 112, "span_ids": ["RemoteBase.__repr__", "RemoteBase.group", "RemoteBase.__init__", "RemoteBase.compat_config", "RemoteBase.supported", "RemoteBase.save_info", "RemoteBase.match", "RemoteBase"], "tokens": 462}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBase(object):\n scheme = None\n REGEX = None\n REQUIRES = {}\n JOBS = 4 * cpu_count()\n\n def __init__(self, repo, config):\n self.repo = repo\n deps_ok = all(self.REQUIRES.values())\n if not deps_ok:\n missing = [k for k, v in self.REQUIRES.items() if v is None]\n url = config.get(\n Config.SECTION_REMOTE_URL, \"{}://\".format(self.scheme)\n )\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)\n\n def __repr__(self):\n return \"{class_name}: '{url}'\".format(\n class_name=type(self).__name__, url=(self.url or \"No url\")\n )\n\n def compat_config(config):\n return config.copy()\n\n @classmethod\n def supported(cls, config):\n url = config[Config.SECTION_REMOTE_URL]\n return cls.match(url) is not None\n\n @classmethod\n def match(cls, url):\n return re.match(cls.REGEX, url)\n\n def group(self, name):\n m = self.match(self.url)\n if not m:\n return None\n return m.group(name)\n\n def save_info(self, path_info):\n raise NotImplementedError", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBase.changed_RemoteBase.changed.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBase.changed_RemoteBase.changed.return.False", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 114, "end_line": 162, "span_ids": ["RemoteBase.changed"], "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": "class RemoteBase(object):\n\n def changed(self, path_info, checksum_info):\n \"\"\"Checks if data has changed.\n\n A file is considered changed if:\n - It doesn't exist on the working directory (was unlinked)\n - Checksum is not computed (saving a new file)\n - The checkusm stored in the State is different from the given one\n - There's no file in the cache\n\n Args:\n path_info: dict with path information.\n checksum: expected checksum for this data.\n\n Returns:\n bool: True if data has changed, False otherwise.\n \"\"\"\n\n logger.debug(\n \"checking if '{}'('{}') has changed.\".format(\n path_info, checksum_info\n )\n )\n\n if not self.exists(path_info):\n logger.debug(\"'{}' doesn't exist.\".format(path_info))\n return True\n\n checksum = checksum_info.get(self.PARAM_CHECKSUM)\n if checksum is None:\n logger.debug(\"checksum for '{}' is missing.\".format(path_info))\n return True\n\n if self.changed_cache(checksum):\n logger.debug(\n \"cache for '{}'('{}') has changed.\".format(path_info, checksum)\n )\n return True\n\n actual = self.save_info(path_info)[self.PARAM_CHECKSUM]\n if checksum != actual:\n logger.debug(\n \"checksum '{}'(actual '{}') for '{}' has changed.\".format(\n checksum, actual, path_info\n )\n )\n return True\n\n logger.debug(\"'{}' hasn't changed.\".format(path_info))\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBase.save_RemoteBase.changed_cache.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBase.save_RemoteBase.changed_cache.return.False", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 164, "end_line": 288, "span_ids": ["RemoteBase.ospath", "RemoteBase.path_to_checksum", "RemoteBase.md5s_to_path_infos", "RemoteBase.checksum_to_path_info", "RemoteBase.download", "RemoteBase.gc", "RemoteBase.checksum_to_path", "RemoteBase.list_cache_paths", "RemoteBase.changed_cache", "RemoteBase.upload", "RemoteBase.copy", "RemoteBase.exists", "RemoteBase.remove", "RemoteBase.move", "RemoteBase._verify_path_args", "RemoteBase.all", "RemoteBase.save"], "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 RemoteBase(object):\n\n def save(self, path_info, checksum_info):\n if path_info[\"scheme\"] != self.scheme:\n raise RemoteActionNotImplemented(\n \"save {} -> {}\".format(path_info[\"scheme\"], self.scheme),\n self.scheme,\n )\n\n checksum = checksum_info[self.PARAM_CHECKSUM]\n if not self.changed_cache(checksum):\n return\n\n to_info = self.checksum_to_path_info(checksum)\n\n logger.info(\"Saving '{}' to '{}'.\".format(path_info, to_info))\n\n self.copy(path_info, to_info)\n\n def download(\n self,\n from_infos,\n to_infos,\n no_progress_bar=False,\n name=None,\n resume=False,\n ):\n raise RemoteActionNotImplemented(\"download\", self.scheme)\n\n def upload(self, from_infos, to_infos, names=None):\n raise RemoteActionNotImplemented(\"upload\", self.scheme)\n\n def remove(self, path_info):\n raise RemoteActionNotImplemented(\"remove\", self.scheme)\n\n def move(self, path_info):\n raise RemoteActionNotImplemented(\"move\", self.scheme)\n\n def copy(self, from_info, to_info):\n raise RemoteActionNotImplemented(\"copy\", self.scheme)\n\n def exists(self, path_infos):\n raise NotImplementedError\n\n @classmethod\n def _verify_path_args(cls, from_infos, to_infos, names=None):\n assert isinstance(from_infos, list)\n assert isinstance(to_infos, list)\n assert len(from_infos) == len(to_infos)\n\n if not names:\n names = len(to_infos) * [None]\n else:\n assert isinstance(names, list)\n assert len(names) == len(to_infos)\n\n return names\n\n @property\n def ospath(self):\n return posixpath\n\n def checksum_to_path(self, checksum):\n return self.ospath.join(self.prefix, checksum[0:2], checksum[2:])\n\n def path_to_checksum(self, path):\n relpath = self.ospath.relpath(path, self.prefix)\n return self.ospath.dirname(relpath) + self.ospath.basename(relpath)\n\n def checksum_to_path_info(self, checksum):\n path_info = self.path_info.copy()\n path_info[\"path\"] = self.checksum_to_path(checksum)\n return path_info\n\n def md5s_to_path_infos(self, md5s):\n return [self.checksum_to_path_info(md5) for md5 in md5s]\n\n def list_cache_paths(self):\n raise NotImplementedError\n\n def all(self):\n # NOTE: The list might be way too big(e.g. 100M entries, md5 for each\n # is 32 bytes, so ~3200Mb list) and we don't really need all of it at\n # the same time, so it makes sense to use a generator to gradually\n # iterate over it, without keeping all of it in memory.\n return (\n self.path_to_checksum(path) for path in self.list_cache_paths()\n )\n\n def gc(self, cinfos):\n from dvc.remote.local import RemoteLOCAL\n\n used = [info[RemoteLOCAL.PARAM_CHECKSUM] for info in cinfos[\"local\"]]\n\n if self.scheme != \"\":\n used += [info[self.PARAM_CHECKSUM] for info in cinfos[self.scheme]]\n\n removed = False\n for checksum in self.all():\n if checksum in used:\n continue\n path_info = self.checksum_to_path_info(checksum)\n self.remove(path_info)\n removed = True\n return removed\n\n def changed_cache(self, checksum):\n cache = self.checksum_to_path_info(checksum)\n expected = {self.PARAM_CHECKSUM: checksum}\n\n if not self.exists(cache):\n return True\n\n actual = self.save_info(cache)\n\n logger.debug(\n \"Cache '{}' actual '{}'.\".format(str(expected), str(actual))\n )\n\n if expected != actual:\n if self.exists(cache):\n msg = \"corrupted cache file {}\"\n logger.warning(msg.format(str(cache)))\n self.remove(cache)\n return True\n\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBase.cache_exists_RemoteBase.cache_exists.return.list_filter_lambda_checks": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBase.cache_exists_RemoteBase.cache_exists.return.list_filter_lambda_checks", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 290, "end_line": 299, "span_ids": ["RemoteBase.cache_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": "class RemoteBase(object):\n\n def cache_exists(self, checksums):\n # NOTE: The reason for such an odd logic is that most of the remotes\n # take much shorter time to just retrieve everything they have under\n # a certain prefix(e.g. s3, gs, ssh, hdfs). Other remotes that can\n # check if particular file exists much quicker, use their own\n # implementation of cache_exists(see http, local).\n #\n # Result of all() might be way too big, so we should walk through\n # it in one pass.\n return list(filter(lambda checksum: checksum in checksums, self.all()))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBase.already_cached_RemoteBase.do_checkout.self_copy_from_info_path": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBase.already_cached_RemoteBase.do_checkout.self_copy_from_info_path", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 302, "end_line": 334, "span_ids": ["RemoteBase.do_checkout", "RemoteBase.safe_remove", "RemoteBase.already_cached"], "tokens": 218}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBase(object):\n\n def already_cached(self, path_info):\n current = self.save_info(path_info)[self.PARAM_CHECKSUM]\n\n if not current:\n return False\n\n return not self.changed_cache(current)\n\n def safe_remove(self, path_info, force=False):\n if not self.exists(path_info):\n return\n\n if not force and not self.already_cached(path_info):\n msg = (\n \"file '{}' is going to be removed.\"\n \" Are you sure you want to proceed?\".format(str(path_info))\n )\n\n if not prompt.confirm(msg):\n raise ConfirmRemoveError(str(path_info))\n\n self.remove(path_info)\n\n def do_checkout(\n self, path_info, checksum, force=False, progress_callback=None\n ):\n if self.exists(path_info):\n msg = \"data '{}' exists. Removing before checkout.\"\n logger.warning(msg.format(str(path_info)))\n self.safe_remove(path_info, force=force)\n\n from_info = self.checksum_to_path_info(checksum)\n self.copy(from_info, path_info)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBase.checkout_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBase.checkout_", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 336, "end_line": 373, "span_ids": ["RemoteBase.unprotect", "RemoteBase.checkout"], "tokens": 239}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBase(object):\n\n def checkout(\n self, path_info, checksum_info, force=False, progress_callback=None\n ):\n scheme = path_info[\"scheme\"]\n if scheme not in [\"\", \"local\"] and scheme != self.scheme:\n raise NotImplementedError\n\n checksum = checksum_info.get(self.PARAM_CHECKSUM)\n if not checksum:\n msg = \"No checksum info for '{}'.\"\n logger.debug(msg.format(str(path_info)))\n return\n\n if not self.changed(path_info, checksum_info):\n msg = \"Data '{}' didn't change.\"\n logger.debug(msg.format(str(path_info)))\n return\n\n if self.changed_cache(checksum):\n msg = \"Cache '{}' not found. File '{}' won't be created.\"\n logger.warning(msg.format(checksum, str(path_info)))\n self.safe_remove(path_info, force=force)\n return\n\n msg = \"Checking out '{}' with cache '{}'.\"\n logger.debug(msg.format(str(path_info), checksum))\n\n self.do_checkout(\n path_info,\n checksum,\n force=force,\n progress_callback=progress_callback,\n )\n\n @staticmethod\n def unprotect(path_info):\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/gs.py_from___future___import_un_RemoteGS.exists.return.any_path_info_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gs.py_from___future___import_un_RemoteGS.exists.return.any_path_info_path_", "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": 118, "span_ids": ["RemoteGS.list_cache_paths", "RemoteGS.get_md5", "imports", "RemoteGS.compat_config", "RemoteGS._list_paths", "RemoteGS.copy", "RemoteGS.remove", "RemoteGS.save_info", "RemoteGS.__init__", "RemoteGS.gs", "RemoteGS", "RemoteGS.exists"], "tokens": 817}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 __future__ import unicode_literals\n\nimport os\n\ntry:\n from google.cloud import storage\nexcept ImportError:\n storage = None\n\nimport dvc.logger as logger\nfrom dvc.utils import tmp_fname, move\nfrom dvc.utils.compat import urlparse, makedirs\nfrom dvc.remote.base import RemoteBase\nfrom dvc.config import Config\nfrom dvc.progress import progress\nfrom dvc.exceptions import DvcException\n\n\nclass RemoteGS(RemoteBase):\n scheme = \"gs\"\n REGEX = r\"^gs://(?P.*)$\"\n REQUIRES = {\"google.cloud.storage\": storage}\n PARAM_CHECKSUM = \"md5\"\n\n def __init__(self, repo, config):\n super(RemoteGS, self).__init__(repo, config)\n storagepath = \"gs://\"\n storagepath += config.get(Config.SECTION_AWS_STORAGEPATH, \"/\")\n storagepath.lstrip(\"/\")\n self.url = config.get(Config.SECTION_REMOTE_URL, storagepath)\n self.projectname = config.get(Config.SECTION_GCP_PROJECTNAME, None)\n self.credentialpath = config.get(Config.SECTION_GCP_CREDENTIALPATH)\n\n parsed = urlparse(self.url)\n self.bucket = parsed.netloc\n self.prefix = parsed.path.lstrip(\"/\")\n\n self.path_info = {\"scheme\": \"gs\", \"bucket\": self.bucket}\n\n @staticmethod\n def compat_config(config):\n ret = config.copy()\n url = \"gs://\" + ret.pop(Config.SECTION_AWS_STORAGEPATH, \"\").lstrip(\"/\")\n ret[Config.SECTION_REMOTE_URL] = url\n return ret\n\n @property\n def gs(self):\n return (\n storage.Client.from_service_account_json(self.credentialpath)\n if self.credentialpath\n else storage.Client(self.projectname)\n )\n\n def get_md5(self, bucket, path):\n import base64\n import codecs\n\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 save_info(self, path_info):\n if path_info[\"scheme\"] != \"gs\":\n raise NotImplementedError\n\n return {\n self.PARAM_CHECKSUM: self.get_md5(\n path_info[\"bucket\"], path_info[\"path\"]\n )\n }\n\n def copy(self, from_info, to_info, gs=None):\n gs = gs if gs else self.gs\n\n blob = gs.bucket(from_info[\"bucket\"]).get_blob(from_info[\"path\"])\n if not blob:\n msg = \"'{}' doesn't exist in the cloud\".format(from_info[\"path\"])\n raise DvcException(msg)\n\n bucket = self.gs.bucket(to_info[\"bucket\"])\n bucket.copy_blob(\n blob, self.gs.bucket(to_info[\"bucket\"]), new_name=to_info[\"path\"]\n )\n\n def remove(self, path_info):\n if path_info[\"scheme\"] != \"gs\":\n raise NotImplementedError\n\n logger.debug(\n \"Removing gs://{}/{}\".format(\n path_info[\"bucket\"], path_info[\"path\"]\n )\n )\n\n blob = self.gs.bucket(path_info[\"bucket\"]).get_blob(path_info[\"path\"])\n if not blob:\n return\n\n blob.delete()\n\n def _list_paths(self, bucket, prefix):\n for blob in self.gs.bucket(bucket).list_blobs(prefix=prefix):\n yield blob.name\n\n def list_cache_paths(self):\n return self._list_paths(self.bucket, self.prefix)\n\n def exists(self, path_info):\n assert not isinstance(path_info, list)\n assert path_info[\"scheme\"] == \"gs\"\n\n paths = self._list_paths(path_info[\"bucket\"], path_info[\"path\"])\n return any(path_info[\"path\"] == path for path in paths)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gs.py_RemoteGS.upload_RemoteGS.upload.for_from_info_to_info_n.progress_finish_target_na": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gs.py_RemoteGS.upload_RemoteGS.upload.for_from_info_to_info_n.progress_finish_target_na", "embedding": null, "metadata": {"file_path": "dvc/remote/gs.py", "file_name": "gs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 120, "end_line": 156, "span_ids": ["RemoteGS.upload"], "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 RemoteGS(RemoteBase):\n\n def upload(self, from_infos, to_infos, names=None):\n names = self._verify_path_args(to_infos, from_infos, names)\n\n gs = self.gs\n\n for from_info, to_info, name in zip(from_infos, to_infos, names):\n if to_info[\"scheme\"] != \"gs\":\n raise NotImplementedError\n\n if from_info[\"scheme\"] != \"local\":\n raise NotImplementedError\n\n logger.debug(\n \"Uploading '{}' to '{}/{}'\".format(\n from_info[\"path\"], to_info[\"bucket\"], to_info[\"path\"]\n )\n )\n\n if not name:\n name = os.path.basename(from_info[\"path\"])\n\n progress.update_target(name, 0, None)\n\n try:\n bucket = gs.bucket(to_info[\"bucket\"])\n blob = bucket.blob(to_info[\"path\"])\n blob.upload_from_filename(from_info[\"path\"])\n except Exception:\n msg = \"failed to upload '{}' to '{}/{}'\"\n logger.error(\n msg.format(\n from_info[\"path\"], to_info[\"bucket\"], to_info[\"path\"]\n )\n )\n continue\n\n progress.finish_target(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/gs.py_RemoteGS.download_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gs.py_RemoteGS.download_", "embedding": null, "metadata": {"file_path": "dvc/remote/gs.py", "file_name": "gs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 158, "end_line": 214, "span_ids": ["RemoteGS.download"], "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": "class RemoteGS(RemoteBase):\n\n def download(\n self,\n from_infos,\n to_infos,\n no_progress_bar=False,\n names=None,\n resume=False,\n ):\n names = self._verify_path_args(from_infos, to_infos, names)\n\n gs = self.gs\n\n for to_info, from_info, name in zip(to_infos, from_infos, names):\n if from_info[\"scheme\"] != \"gs\":\n raise NotImplementedError\n\n if to_info[\"scheme\"] == \"gs\":\n self.copy(from_info, to_info, gs=gs)\n continue\n\n if to_info[\"scheme\"] != \"local\":\n raise NotImplementedError\n\n msg = \"Downloading '{}/{}' to '{}'\".format(\n from_info[\"bucket\"], from_info[\"path\"], to_info[\"path\"]\n )\n logger.debug(msg)\n\n tmp_file = tmp_fname(to_info[\"path\"])\n if not name:\n name = os.path.basename(to_info[\"path\"])\n\n if not no_progress_bar:\n # percent_cb is not available for download_to_filename, so\n # lets at least update progress at pathpoints(start, finish)\n progress.update_target(name, 0, None)\n\n makedirs(os.path.dirname(to_info[\"path\"]), exist_ok=True)\n\n try:\n bucket = gs.bucket(from_info[\"bucket\"])\n blob = bucket.get_blob(from_info[\"path\"])\n blob.download_to_filename(tmp_file)\n except Exception:\n msg = \"failed to download '{}/{}' to '{}'\"\n logger.error(\n msg.format(\n from_info[\"bucket\"], from_info[\"path\"], to_info[\"path\"]\n )\n )\n continue\n\n move(tmp_file, to_info[\"path\"])\n\n if not no_progress_bar:\n progress.finish_target(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/hdfs.py_from___future___import_un_RemoteHDFS.__init__.self.path_info._scheme_hdfs_user_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_from___future___import_un_RemoteHDFS.__init__.self.path_info._scheme_hdfs_user_", "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": 30, "span_ids": ["RemoteHDFS.__init__", "imports", "RemoteHDFS"], "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": "from __future__ import unicode_literals\n\nimport os\nimport re\nimport getpass\nimport posixpath\nfrom subprocess import Popen, PIPE\n\nimport dvc.logger as logger\nfrom dvc.config import Config\nfrom dvc.remote.base import RemoteBase, RemoteCmdError\nfrom dvc.utils import fix_env, tmp_fname\n\n\nclass RemoteHDFS(RemoteBase):\n scheme = \"hdfs\"\n REGEX = r\"^hdfs://((?P.*)@)?.*$\"\n PARAM_CHECKSUM = \"checksum\"\n\n def __init__(self, repo, config):\n super(RemoteHDFS, self).__init__(repo, config)\n self.url = config.get(Config.SECTION_REMOTE_URL, \"/\")\n self.prefix = self.url\n self.user = self.group(\"user\")\n if not self.user:\n self.user = config.get(\n Config.SECTION_REMOTE_USER, getpass.getuser()\n )\n\n self.path_info = {\"scheme\": \"hdfs\", \"user\": self.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/dvc/remote/hdfs.py_RemoteHDFS.hadoop_fs_RemoteHDFS.hadoop_fs.return.out_decode_utf_8_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_RemoteHDFS.hadoop_fs_RemoteHDFS.hadoop_fs.return.out_decode_utf_8_", "embedding": null, "metadata": {"file_path": "dvc/remote/hdfs.py", "file_name": "hdfs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 32, "end_line": 55, "span_ids": ["RemoteHDFS.hadoop_fs"], "tokens": 210}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteHDFS(RemoteBase):\n\n def hadoop_fs(self, cmd, user=None):\n cmd = \"hadoop fs -\" + cmd\n if user:\n cmd = \"HADOOP_USER_NAME={} \".format(user) + cmd\n\n # NOTE: close_fds doesn't work with redirected stdin/stdout/stderr.\n # See https://github.com/iterative/dvc/issues/1197.\n close_fds = os.name != \"nt\"\n\n executable = os.getenv(\"SHELL\") if os.name != \"nt\" else None\n p = Popen(\n cmd,\n shell=True,\n close_fds=close_fds,\n executable=executable,\n env=fix_env(os.environ),\n stdin=PIPE,\n stdout=PIPE,\n stderr=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_RemoteHDFS._group_RemoteHDFS.exists.try_.except_RemoteCmdError_.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_RemoteHDFS._group_RemoteHDFS.exists.try_.except_RemoteCmdError_.return.False", "embedding": null, "metadata": {"file_path": "dvc/remote/hdfs.py", "file_name": "hdfs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 57, "end_line": 109, "span_ids": ["RemoteHDFS.save_info", "RemoteHDFS.rm", "RemoteHDFS.remove", "RemoteHDFS.exists", "RemoteHDFS._group", "RemoteHDFS.copy", "RemoteHDFS.checksum"], "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 RemoteHDFS(RemoteBase):\n\n @staticmethod\n def _group(regex, s, gname):\n match = re.match(regex, s)\n assert match is not None\n return match.group(gname)\n\n def checksum(self, path_info):\n regex = r\".*\\t.*\\t(?P.*)\"\n stdout = self.hadoop_fs(\n \"checksum {}\".format(path_info[\"path\"]), user=path_info[\"user\"]\n )\n return self._group(regex, stdout, \"checksum\")\n\n def copy(self, from_info, to_info):\n dname = posixpath.dirname(to_info[\"path\"])\n self.hadoop_fs(\"mkdir -p {}\".format(dname), user=to_info[\"user\"])\n self.hadoop_fs(\n \"cp -f {} {}\".format(from_info[\"path\"], to_info[\"path\"]),\n user=to_info[\"user\"],\n )\n\n def rm(self, path_info):\n self.hadoop_fs(\n \"rm -f {}\".format(path_info[\"path\"]), user=path_info[\"user\"]\n )\n\n def save_info(self, path_info):\n if path_info[\"scheme\"] != \"hdfs\":\n raise NotImplementedError\n\n assert path_info.get(\"path\")\n\n return {self.PARAM_CHECKSUM: self.checksum(path_info)}\n\n def remove(self, path_info):\n if path_info[\"scheme\"] != \"hdfs\":\n raise NotImplementedError\n\n assert path_info.get(\"path\")\n\n logger.debug(\"Removing {}\".format(path_info[\"path\"]))\n\n self.rm(path_info)\n\n def exists(self, path_info):\n assert not isinstance(path_info, list)\n assert path_info[\"scheme\"] == \"hdfs\"\n\n try:\n self.hadoop_fs(\"test -e {}\".format(path_info[\"path\"]))\n return True\n except RemoteCmdError:\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/hdfs.py_RemoteHDFS.download_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_RemoteHDFS.download_", "embedding": null, "metadata": {"file_path": "dvc/remote/hdfs.py", "file_name": "hdfs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 138, "end_line": 186, "span_ids": ["RemoteHDFS.download", "RemoteHDFS.list_cache_paths"], "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": "class RemoteHDFS(RemoteBase):\n\n def download(\n self,\n from_infos,\n to_infos,\n no_progress_bar=False,\n names=None,\n resume=False,\n ):\n names = self._verify_path_args(from_infos, to_infos, names)\n\n for to_info, from_info, name in zip(to_infos, from_infos, names):\n if from_info[\"scheme\"] != \"hdfs\":\n raise NotImplementedError\n\n if to_info[\"scheme\"] == \"hdfs\":\n self.copy(from_info, to_info)\n continue\n\n if to_info[\"scheme\"] != \"local\":\n raise NotImplementedError\n\n dname = os.path.dirname(to_info[\"path\"])\n if not os.path.exists(dname):\n os.makedirs(dname)\n\n tmp_file = tmp_fname(to_info[\"path\"])\n\n self.hadoop_fs(\n \"copyToLocal {} {}\".format(from_info[\"path\"], tmp_file),\n user=from_info[\"user\"],\n )\n\n os.rename(tmp_file, to_info[\"path\"])\n\n def list_cache_paths(self):\n try:\n self.hadoop_fs(\"test -e {}\".format(self.prefix))\n except RemoteCmdError:\n return []\n\n stdout = self.hadoop_fs(\"ls -R {}\".format(self.prefix))\n lines = stdout.split(\"\\n\")\n flist = []\n for line in lines:\n if not line.startswith(\"-\"):\n continue\n flist.append(line.split()[-1])\n return flist", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_from___future___import_un_ProgressBarCallback.__call__.with_self_lock_.progress_update_target_se": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_from___future___import_un_ProgressBarCallback.__call__.with_self_lock_.progress_update_target_se", "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": 26, "span_ids": ["imports", "ProgressBarCallback.__call__", "ProgressBarCallback.__init__", "ProgressBarCallback"], "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": "from __future__ import unicode_literals\nfrom dvc.utils.compat import open, makedirs\n\nimport os\nimport threading\nimport requests\n\nimport dvc.logger as logger\nfrom dvc.progress import progress\nfrom dvc.exceptions import DvcException\nfrom dvc.config import Config\nfrom dvc.remote.base import RemoteBase\nfrom dvc.utils import move\n\n\nclass ProgressBarCallback(object):\n def __init__(self, name, total):\n self.name = name\n self.total = total\n self.current = 0\n self.lock = threading.Lock()\n\n def __call__(self, byts):\n with self.lock:\n self.current += byts\n progress.update_target(self.name, self.current, self.total)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP_RemoteHTTP.download.for_to_info_from_info_n.if_not_no_progress_bar_.progress_finish_target_na": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP_RemoteHTTP.download.for_to_info_from_info_n.if_not_no_progress_bar_.progress_finish_target_na", "embedding": null, "metadata": {"file_path": "dvc/remote/http.py", "file_name": "http.py", "file_type": "text/x-python", "category": "implementation", "start_line": 28, "end_line": 93, "span_ids": ["RemoteHTTP.download", "RemoteHTTP.prefix", "RemoteHTTP.__init__", "RemoteHTTP"], "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 RemoteHTTP(RemoteBase):\n scheme = \"http\"\n REGEX = r\"^https?://.*$\"\n REQUEST_TIMEOUT = 10\n CHUNK_SIZE = 2 ** 16\n PARAM_CHECKSUM = \"etag\"\n\n def __init__(self, repo, config):\n super(RemoteHTTP, self).__init__(repo, config)\n self.cache_dir = config.get(Config.SECTION_REMOTE_URL)\n self.url = self.cache_dir\n self.path_info = {\"scheme\": \"http\"}\n\n @property\n def prefix(self):\n return self.cache_dir\n\n def download(\n self,\n from_infos,\n to_infos,\n no_progress_bar=False,\n names=None,\n resume=False,\n ):\n names = self._verify_path_args(to_infos, from_infos, names)\n\n for to_info, from_info, name in zip(to_infos, from_infos, names):\n if from_info[\"scheme\"] not in [\"http\", \"https\"]:\n raise NotImplementedError\n\n if to_info[\"scheme\"] != \"local\":\n raise NotImplementedError\n\n msg = \"Downloading '{}' to '{}'\".format(\n from_info[\"path\"], to_info[\"path\"]\n )\n logger.debug(msg)\n\n if not name:\n name = os.path.basename(to_info[\"path\"])\n\n makedirs(os.path.dirname(to_info[\"path\"]), exist_ok=True)\n\n total = self._content_length(from_info[\"path\"])\n\n if no_progress_bar or not total:\n cb = None\n else:\n cb = ProgressBarCallback(name, total)\n\n try:\n self._download_to(\n from_info[\"path\"],\n to_info[\"path\"],\n callback=cb,\n resume=resume,\n )\n\n except Exception:\n msg = \"failed to download '{}'\".format(from_info[\"path\"])\n logger.error(msg)\n continue\n\n if not no_progress_bar:\n progress.finish_target(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/http.py_RemoteHTTP.exists_RemoteHTTP._content_length.return.self__request_HEAD_url": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP.exists_RemoteHTTP._content_length.return.self__request_HEAD_url", "embedding": null, "metadata": {"file_path": "dvc/remote/http.py", "file_name": "http.py", "file_type": "text/x-python", "category": "implementation", "start_line": 95, "end_line": 115, "span_ids": ["RemoteHTTP.save_info", "RemoteHTTP.cache_exists", "RemoteHTTP.exists", "RemoteHTTP._content_length"], "tokens": 177}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteHTTP(RemoteBase):\n\n def exists(self, path_info):\n assert not isinstance(path_info, list)\n assert path_info[\"scheme\"] in [\"http\", \"https\"]\n return bool(self._request(\"HEAD\", path_info.get(\"path\")))\n\n def cache_exists(self, md5s):\n assert isinstance(md5s, list)\n\n def func(md5):\n return bool(self._request(\"HEAD\", self.checksum_to_path(md5)))\n\n return list(filter(func, md5s))\n\n def save_info(self, path_info):\n if path_info[\"scheme\"] not in [\"http\", \"https\"]:\n raise NotImplementedError\n\n return {self.PARAM_CHECKSUM: self._etag(path_info[\"path\"])}\n\n def _content_length(self, url):\n return self._request(\"HEAD\", url).headers.get(\"Content-Length\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP._etag_RemoteHTTP._etag.return.etag": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP._etag_RemoteHTTP._etag.return.etag", "embedding": null, "metadata": {"file_path": "dvc/remote/http.py", "file_name": "http.py", "file_type": "text/x-python", "category": "implementation", "start_line": 117, "end_line": 134, "span_ids": ["RemoteHTTP._etag"], "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 RemoteHTTP(RemoteBase):\n\n def _etag(self, url):\n etag = self._request(\"HEAD\", url).headers.get(\"ETag\") or self._request(\n \"HEAD\", url\n ).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_RemoteHTTP._write_request_content_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP._write_request_content_", "embedding": null, "metadata": {"file_path": "dvc/remote/http.py", "file_name": "http.py", "file_type": "text/x-python", "category": "implementation", "start_line": 152, "end_line": 196, "span_ids": ["RemoteHTTP._write_request_content", "RemoteHTTP._validate_existing_file_size", "RemoteHTTP.gc", "RemoteHTTP._request", "RemoteHTTP._determine_mode_get_transferred_bytes"], "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 RemoteHTTP(RemoteBase):\n\n def _write_request_content(\n self, mode, partial_file, request, transferred_bytes, callback=None\n ):\n with open(partial_file, mode) as fd:\n\n for index, chunk in enumerate(\n request.iter_content(chunk_size=self.CHUNK_SIZE)\n ):\n chunk_number = index + 1\n if chunk_number * self.CHUNK_SIZE > transferred_bytes:\n fd.write(chunk)\n fd.flush()\n transferred_bytes += len(chunk)\n\n if callback:\n callback(transferred_bytes)\n\n def _validate_existing_file_size(self, bytes_transferred, partial_file):\n if bytes_transferred % self.CHUNK_SIZE != 0:\n raise DvcException(\n \"File {}, might be corrupted, please remove \"\n \"it and retry importing\".format(partial_file)\n )\n\n def _determine_mode_get_transferred_bytes(self, partial_file, resume):\n if os.path.exists(partial_file) and resume:\n mode = \"ab\"\n bytes_transfered = os.path.getsize(partial_file)\n else:\n mode = \"wb\"\n bytes_transfered = 0\n return mode, bytes_transfered\n\n def _request(self, method, url, **kwargs):\n kwargs.setdefault(\"allow_redirects\", True)\n kwargs.setdefault(\"timeout\", self.REQUEST_TIMEOUT)\n\n try:\n return requests.request(method, url, **kwargs)\n except requests.exceptions.RequestException:\n raise DvcException(\"could not perform a {} request\".format(method))\n\n def gc(self):\n raise NotImplementedError", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_from___future___import_un_from_dvc_utils_fs_import_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_from___future___import_un_from_dvc_utils_fs_import_", "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": 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": "from __future__ import unicode_literals\n\nfrom dvc.utils.compat import str, makedirs\n\nimport os\nimport stat\nimport uuid\nimport json\nimport ntpath\nimport shutil\nimport posixpath\nfrom operator import itemgetter\n\nimport dvc.logger as logger\nfrom dvc.system import System\nfrom dvc.remote.base import (\n RemoteBase,\n STATUS_MAP,\n STATUS_NEW,\n STATUS_DELETED,\n STATUS_MISSING,\n)\nfrom dvc.utils import (\n remove,\n move,\n copyfile,\n dict_md5,\n to_chunks,\n tmp_fname,\n walk_files,\n)\nfrom dvc.utils import LARGE_DIR_SIZE\nfrom dvc.config import Config\nfrom dvc.exceptions import DvcException\nfrom dvc.progress import progress\nfrom concurrent.futures import ThreadPoolExecutor\n\nfrom dvc.utils.fs import get_mtime_and_size, get_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/remote/local.py_RemoteLOCAL_RemoteLOCAL.exists.return.os_path_exists_path_info_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL_RemoteLOCAL.exists.return.os_path_exists_path_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": 129, "span_ids": ["RemoteLOCAL.compat_config", "RemoteLOCAL.get", "RemoteLOCAL.__init__", "RemoteLOCAL.url", "RemoteLOCAL", "RemoteLOCAL.prefix", "RemoteLOCAL.changed_cache_file", "RemoteLOCAL.list_cache_paths", "RemoteLOCAL.exists"], "tokens": 657}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteLOCAL(RemoteBase):\n scheme = \"local\"\n REGEX = r\"^(?P.*)$\"\n PARAM_CHECKSUM = \"md5\"\n PARAM_PATH = \"path\"\n PARAM_RELPATH = \"relpath\"\n MD5_DIR_SUFFIX = \".dir\"\n\n CACHE_TYPES = [\"reflink\", \"hardlink\", \"symlink\", \"copy\"]\n CACHE_TYPE_MAP = {\n \"copy\": shutil.copyfile,\n \"symlink\": System.symlink,\n \"hardlink\": System.hardlink,\n \"reflink\": System.reflink,\n }\n\n def __init__(self, repo, config):\n super(RemoteLOCAL, self).__init__(repo, config)\n self.state = self.repo.state if self.repo else None\n self.protected = config.get(Config.SECTION_CACHE_PROTECTED, False)\n storagepath = config.get(Config.SECTION_AWS_STORAGEPATH, None)\n self.cache_dir = config.get(Config.SECTION_REMOTE_URL, storagepath)\n\n if self.cache_dir is not None and not os.path.isabs(self.cache_dir):\n cwd = config[Config.PRIVATE_CWD]\n self.cache_dir = os.path.abspath(os.path.join(cwd, self.cache_dir))\n\n types = config.get(Config.SECTION_CACHE_TYPE, None)\n if types:\n if isinstance(types, str):\n types = [t.strip() for t in types.split(\",\")]\n self.cache_types = types\n else:\n self.cache_types = self.CACHE_TYPES\n\n if self.cache_dir is not None and not os.path.exists(self.cache_dir):\n os.mkdir(self.cache_dir)\n\n self.path_info = {\"scheme\": \"local\"}\n\n self._dir_info = {}\n\n @staticmethod\n def compat_config(config):\n ret = config.copy()\n url = ret.pop(Config.SECTION_AWS_STORAGEPATH, \"\")\n ret[Config.SECTION_REMOTE_URL] = url\n return ret\n\n @property\n def url(self):\n return self.cache_dir\n\n @property\n def prefix(self):\n return self.cache_dir\n\n def list_cache_paths(self):\n clist = []\n for entry in os.listdir(self.cache_dir):\n subdir = os.path.join(self.cache_dir, entry)\n if not os.path.isdir(subdir):\n continue\n\n for cache in os.listdir(subdir):\n clist.append(os.path.join(subdir, cache))\n\n return clist\n\n def get(self, md5):\n if not md5:\n return None\n\n return os.path.join(self.cache_dir, md5[0:2], md5[2:])\n\n def changed_cache_file(self, md5):\n cache = self.get(md5)\n if self.state.changed(cache, md5=md5):\n if os.path.exists(cache):\n msg = \"Corrupted cache file {}.\"\n logger.warning(msg.format(os.path.relpath(cache)))\n remove(cache)\n return True\n return False\n\n def exists(self, path_info):\n assert not isinstance(path_info, list)\n assert path_info[\"scheme\"] == \"local\"\n return os.path.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/local.py_RemoteLOCAL.changed_cache_RemoteLOCAL.changed_cache.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.changed_cache_RemoteLOCAL.changed_cache.return.False", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 115, "end_line": 133, "span_ids": ["RemoteLOCAL.changed_cache"], "tokens": 132}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteLOCAL(RemoteBase):\n\n def changed_cache(self, md5):\n cache = self.get(md5)\n clist = [(cache, md5)]\n\n while True:\n if len(clist) == 0:\n break\n\n cache, md5 = clist.pop()\n if self.changed_cache_file(md5):\n return True\n\n if self.is_dir_cache(cache) and self._cache_metadata_changed():\n for entry in self.load_dir_cache(md5):\n md5 = entry[self.PARAM_CHECKSUM]\n cache = self.get(md5)\n clist.append((cache, md5))\n\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.link_RemoteLOCAL.link.raise_DvcException_no_po": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.link_RemoteLOCAL.link.raise_DvcException_no_po", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 135, "end_line": 174, "span_ids": ["RemoteLOCAL.link"], "tokens": 283}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteLOCAL(RemoteBase):\n\n def link(self, cache, path):\n assert os.path.isfile(cache)\n\n dname = os.path.dirname(path)\n if not os.path.exists(dname):\n os.makedirs(dname)\n\n # NOTE: just create an empty file for an empty cache\n if os.path.getsize(cache) == 0:\n open(path, \"w+\").close()\n\n msg = \"Created empty file: {} -> {}\".format(cache, path)\n logger.debug(msg)\n return\n\n i = len(self.cache_types)\n while i > 0:\n try:\n self.CACHE_TYPE_MAP[self.cache_types[0]](cache, path)\n\n if self.protected:\n os.chmod(path, stat.S_IREAD | stat.S_IRGRP | stat.S_IROTH)\n\n msg = \"Created {}'{}': {} -> {}\".format(\n \"protected \" if self.protected else \"\",\n self.cache_types[0],\n cache,\n path,\n )\n\n logger.debug(msg)\n return\n\n except DvcException as exc:\n msg = \"Cache type '{}' is not supported: {}\"\n logger.debug(msg.format(self.cache_types[0], str(exc)))\n del self.cache_types[0]\n i -= 1\n\n raise DvcException(\"no possible cache types left to try 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/remote/local.py_RemoteLOCAL.ospath_RemoteLOCAL.ntpath.return.path_replace_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.ospath_RemoteLOCAL.ntpath.return.path_replace_", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 176, "end_line": 198, "span_ids": ["RemoteLOCAL.ospath", "RemoteLOCAL.unixpath", "RemoteLOCAL.to_ospath", "RemoteLOCAL.ntpath"], "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 RemoteLOCAL(RemoteBase):\n\n @property\n def ospath(self):\n if os.name == \"nt\":\n return ntpath\n return posixpath\n\n @classmethod\n def to_ospath(cls, path):\n if os.name == \"nt\":\n return cls.ntpath(path)\n return cls.unixpath(path)\n\n @staticmethod\n def unixpath(path):\n assert not ntpath.isabs(path)\n assert not posixpath.isabs(path)\n return path.replace(\"\\\\\", \"/\")\n\n @staticmethod\n def ntpath(path):\n assert not ntpath.isabs(path)\n assert not posixpath.isabs(path)\n return path.replace(\"/\", \"\\\\\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.collect_dir_cache_RemoteLOCAL.collect_dir_cache.return._md5_dir_info_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.collect_dir_cache_RemoteLOCAL.collect_dir_cache.return._md5_dir_info_", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 200, "end_line": 241, "span_ids": ["RemoteLOCAL.collect_dir_cache"], "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": "class RemoteLOCAL(RemoteBase):\n\n def collect_dir_cache(self, dname):\n dir_info = []\n\n for root, dirs, files in os.walk(str(dname)):\n bar = False\n\n if len(files) > LARGE_DIR_SIZE:\n msg = (\n \"Computing md5 for a large directory {}. \"\n \"This is only done once.\"\n )\n logger.info(msg.format(os.path.relpath(root)))\n bar = True\n title = os.path.relpath(root)\n processed = 0\n total = len(files)\n progress.update_target(title, 0, total)\n\n for fname in files:\n path = os.path.join(root, fname)\n relpath = self.unixpath(os.path.relpath(path, dname))\n\n if bar:\n progress.update_target(title, processed, total)\n processed += 1\n\n md5 = self.state.update(path)\n dir_info.append(\n {self.PARAM_RELPATH: relpath, self.PARAM_CHECKSUM: md5}\n )\n\n if bar:\n progress.finish_target(title)\n\n # NOTE: sorting the list by path to ensure reproducibility\n dir_info = sorted(dir_info, key=itemgetter(self.PARAM_RELPATH))\n\n md5 = dict_md5(dir_info) + self.MD5_DIR_SUFFIX\n if self.changed_cache_file(md5):\n self.dump_dir_cache(md5, dir_info)\n\n return (md5, 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/local.py_RemoteLOCAL.load_dir_cache_RemoteLOCAL.load_dir_cache.return.d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.load_dir_cache_RemoteLOCAL.load_dir_cache.return.d", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 259, "end_line": 285, "span_ids": ["RemoteLOCAL.load_dir_cache"], "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 RemoteLOCAL(RemoteBase):\n\n def load_dir_cache(self, md5):\n path = self.get(md5)\n assert self.is_dir_cache(path)\n\n dir_info = self._dir_info.get(md5)\n if dir_info:\n return dir_info\n\n try:\n with open(path, \"r\") as fd:\n d = json.load(fd)\n except Exception:\n msg = \"Failed to load dir cache '{}'\"\n logger.error(msg.format(os.path.relpath(path)))\n return []\n\n if not isinstance(d, list):\n msg = \"dir cache file format error '{}' [skipping the file]\"\n logger.error(msg.format(os.path.relpath(path)))\n return []\n\n for info in d:\n info[\"relpath\"] = self.to_ospath(info[\"relpath\"])\n\n self._dir_info[md5] = d\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/local.py_RemoteLOCAL.dump_dir_cache_RemoteLOCAL.is_dir_cache.return.cache_endswith_cls_MD5_DI": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.dump_dir_cache_RemoteLOCAL.is_dir_cache.return.cache_endswith_cls_MD5_DI", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 266, "end_line": 286, "span_ids": ["RemoteLOCAL.is_dir_cache", "RemoteLOCAL.dump_dir_cache"], "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 RemoteLOCAL(RemoteBase):\n\n def dump_dir_cache(self, md5, dir_info):\n path = self.get(md5)\n dname = os.path.dirname(path)\n\n assert self.is_dir_cache(path)\n assert isinstance(dir_info, list)\n\n if not os.path.isdir(dname):\n os.makedirs(dname)\n\n # NOTE: Writing first and renaming after that\n # to make sure that the operation is atomic.\n tmp = \"{}.{}\".format(path, str(uuid.uuid4()))\n\n with open(tmp, \"w+\") as fd:\n json.dump(dir_info, fd, sort_keys=True)\n move(tmp, path)\n\n @classmethod\n def is_dir_cache(cls, cache):\n return cache.endswith(cls.MD5_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/local.py_RemoteLOCAL._save_dir_RemoteLOCAL._save_dir.if_bar_.progress_finish_target_di": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._save_dir_RemoteLOCAL._save_dir.if_bar_.progress_finish_target_di", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 394, "end_line": 428, "span_ids": ["RemoteLOCAL._save_dir"], "tokens": 226}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteLOCAL(RemoteBase):\n\n def _save_dir(self, path, md5):\n dir_info = self.load_dir_cache(md5)\n dir_relpath = os.path.relpath(path)\n dir_size = len(dir_info)\n bar = dir_size > LARGE_DIR_SIZE\n\n logger.info(\"Linking directory '{}'.\".format(dir_relpath))\n\n for processed, entry in enumerate(dir_info):\n relpath = entry[self.PARAM_RELPATH]\n m = entry[self.PARAM_CHECKSUM]\n p = os.path.join(path, relpath)\n c = self.get(m)\n\n if self.changed_cache(m):\n self._move(p, c)\n else:\n remove(p)\n\n self.link(c, p)\n\n self.state.update(p, m)\n self.state.update(c, m)\n\n if bar:\n progress.update_target(dir_relpath, processed, dir_size)\n\n self.state.update_link(path)\n\n cache = self.get(md5)\n self.state.update(cache)\n self.state.update(path, md5)\n\n if bar:\n progress.finish_target(dir_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/local.py_RemoteLOCAL.save_RemoteLOCAL.cache_exists.return.list_filter_lambda_md5_n": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.save_RemoteLOCAL.cache_exists.return.list_filter_lambda_md5_n", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 429, "end_line": 466, "span_ids": ["RemoteLOCAL.cache_exists", "RemoteLOCAL.save", "RemoteLOCAL.move", "RemoteLOCAL.save_info", "RemoteLOCAL.remove"], "tokens": 275}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteLOCAL(RemoteBase):\n\n def save(self, path_info, checksum_info):\n if path_info[\"scheme\"] != \"local\":\n raise NotImplementedError\n\n path = path_info[\"path\"]\n\n msg = \"Saving '{}' to cache '{}'.\"\n logger.info(\n msg.format(os.path.relpath(path), os.path.relpath(self.cache_dir))\n )\n\n md5 = checksum_info[self.PARAM_CHECKSUM]\n if os.path.isdir(path):\n self._save_dir(path, md5)\n else:\n self._save_file(path, md5)\n\n def save_info(self, path_info):\n if path_info[\"scheme\"] != \"local\":\n raise NotImplementedError\n\n return {self.PARAM_CHECKSUM: self.state.update(path_info[\"path\"])}\n\n def remove(self, path_info):\n if path_info[\"scheme\"] != \"local\":\n raise NotImplementedError\n\n remove(path_info[\"path\"])\n\n def move(self, from_info, to_info):\n if from_info[\"scheme\"] != \"local\" or to_info[\"scheme\"] != \"local\":\n raise NotImplementedError\n\n move(from_info[\"path\"], to_info[\"path\"])\n\n def cache_exists(self, md5s):\n assert isinstance(md5s, list)\n return list(filter(lambda md5: not self.changed_cache_file(md5), md5s))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.upload_RemoteLOCAL.upload.for_from_info_to_info_n.try_.except_Exception_.logger_error_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.upload_RemoteLOCAL.upload.for_from_info_to_info_n.try_.except_Exception_.logger_error_", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 469, "end_line": 499, "span_ids": ["RemoteLOCAL.upload"], "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": "class RemoteLOCAL(RemoteBase):\n\n def upload(self, from_infos, to_infos, names=None):\n names = self._verify_path_args(to_infos, from_infos, names)\n\n for from_info, to_info, name in zip(from_infos, to_infos, names):\n if to_info[\"scheme\"] != \"local\":\n raise NotImplementedError\n\n if from_info[\"scheme\"] != \"local\":\n raise NotImplementedError\n\n logger.debug(\n \"Uploading '{}' to '{}'\".format(\n from_info[\"path\"], to_info[\"path\"]\n )\n )\n\n if not name:\n name = os.path.basename(from_info[\"path\"])\n\n makedirs(os.path.dirname(to_info[\"path\"]), exist_ok=True)\n tmp_file = tmp_fname(to_info[\"path\"])\n\n try:\n copyfile(from_info[\"path\"], tmp_file, name=name)\n os.rename(tmp_file, to_info[\"path\"])\n except Exception:\n logger.error(\n \"failed to upload '{}' to '{}'\".format(\n from_info[\"path\"], to_info[\"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/remote/local.py_RemoteLOCAL._group_RemoteLOCAL._group.return.by_md5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._group_RemoteLOCAL._group.return.by_md5", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 544, "end_line": 564, "span_ids": ["RemoteLOCAL._group"], "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 RemoteLOCAL(RemoteBase):\n\n def _group(self, checksum_infos, show_checksums=False):\n by_md5 = {}\n\n for info in checksum_infos:\n md5 = info[self.PARAM_CHECKSUM]\n\n if show_checksums:\n by_md5[md5] = {\"name\": md5}\n continue\n\n name = info[self.PARAM_PATH]\n branch = info.get(\"branch\")\n if branch:\n name += \"({})\".format(branch)\n\n if md5 not in by_md5.keys():\n by_md5[md5] = {\"name\": name}\n else:\n by_md5[md5][\"name\"] += \" \" + name\n\n return by_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/local.py_RemoteLOCAL._get_chunks_RemoteLOCAL._get_chunks.return.list_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._get_chunks_RemoteLOCAL._get_chunks.return.list_", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 597, "end_line": 632, "span_ids": ["RemoteLOCAL._get_chunks"], "tokens": 218}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteLOCAL(RemoteBase):\n\n def _get_chunks(self, download, remote, status_info, status, jobs):\n title = \"Analysing status.\"\n\n progress.set_n_total(1)\n total = len(status_info)\n current = 0\n\n cache = []\n path_infos = []\n names = []\n for md5, info in status_info.items():\n if info[\"status\"] == status:\n cache.append(self.checksum_to_path_info(md5))\n path_infos.append(remote.checksum_to_path_info(md5))\n names.append(info[\"name\"])\n current += 1\n progress.update_target(title, current, total)\n\n progress.finish_target(title)\n\n progress.set_n_total(len(names))\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 list(\n zip(\n to_chunks(from_infos, jobs),\n to_chunks(to_infos, jobs),\n to_chunks(names, jobs),\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/local.py_RemoteLOCAL._process_RemoteLOCAL._process.return.len_chunks_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._process_RemoteLOCAL._process.return.len_chunks_", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 634, "end_line": 679, "span_ids": ["RemoteLOCAL._process"], "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 RemoteLOCAL(RemoteBase):\n\n def _process(\n self,\n checksum_infos,\n remote,\n jobs=None,\n show_checksums=False,\n download=False,\n ):\n msg = \"Preparing to {} data {} '{}'\"\n logger.info(\n msg.format(\n \"download\" if download else \"upload\",\n \"from\" if download else \"to\",\n remote.url,\n )\n )\n\n if download:\n func = remote.download\n status = STATUS_DELETED\n else:\n func = remote.upload\n status = STATUS_NEW\n\n if jobs is None:\n jobs = remote.JOBS\n\n status_info = self.status(\n checksum_infos, remote, jobs=jobs, show_checksums=show_checksums\n )\n\n chunks = self._get_chunks(download, remote, status_info, status, jobs)\n\n if len(chunks) == 0:\n return 0\n\n futures = []\n with ThreadPoolExecutor(max_workers=jobs) as executor:\n for from_infos, to_infos, names in chunks:\n res = executor.submit(func, from_infos, to_infos, names=names)\n futures.append(res)\n\n for f in futures:\n f.result()\n\n return len(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/dvc/remote/s3.py_from___future___import_un_Callback.__call__.with_self_lock_.progress_update_target_se": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_from___future___import_un_Callback.__call__.with_self_lock_.progress_update_target_se", "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": 30, "span_ids": ["Callback.__init__", "imports", "Callback", "Callback.__call__"], "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": "from __future__ import unicode_literals\n\nimport os\nimport threading\n\ntry:\n import boto3\nexcept ImportError:\n boto3 = None\n\nimport dvc.logger as logger\nfrom dvc.utils import tmp_fname, move\nfrom dvc.utils.compat import urlparse, makedirs\nfrom dvc.progress import progress\nfrom dvc.config import Config\nfrom dvc.remote.base import RemoteBase\nfrom dvc.exceptions import DvcException\n\n\nclass Callback(object):\n def __init__(self, name, total):\n self.name = name\n self.total = total\n self.current = 0\n self.lock = threading.Lock()\n\n def __call__(self, byts):\n with self.lock:\n self.current += byts\n progress.update_target(self.name, self.current, self.total)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3.download_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3.download_", "embedding": null, "metadata": {"file_path": "dvc/remote/s3.py", "file_name": "s3.py", "file_type": "text/x-python", "category": "implementation", "start_line": 190, "end_line": 250, "span_ids": ["RemoteS3.download"], "tokens": 367}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteS3(RemoteBase):\n\n def download(\n self,\n from_infos,\n to_infos,\n no_progress_bar=False,\n names=None,\n resume=False,\n ):\n names = self._verify_path_args(from_infos, to_infos, names)\n\n s3 = self.s3\n\n for to_info, from_info, name in zip(to_infos, from_infos, names):\n if from_info[\"scheme\"] != \"s3\":\n raise NotImplementedError\n\n if to_info[\"scheme\"] == \"s3\":\n self.copy(from_info, to_info, s3=s3)\n continue\n\n if to_info[\"scheme\"] != \"local\":\n raise NotImplementedError\n\n msg = \"Downloading '{}/{}' to '{}'\".format(\n from_info[\"bucket\"], from_info[\"path\"], to_info[\"path\"]\n )\n logger.debug(msg)\n\n tmp_file = tmp_fname(to_info[\"path\"])\n if not name:\n name = os.path.basename(to_info[\"path\"])\n\n makedirs(os.path.dirname(to_info[\"path\"]), exist_ok=True)\n\n try:\n if no_progress_bar:\n cb = None\n else:\n total = s3.head_object(\n Bucket=from_info[\"bucket\"], Key=from_info[\"path\"]\n )[\"ContentLength\"]\n cb = Callback(name, total)\n\n s3.download_file(\n from_info[\"bucket\"],\n from_info[\"path\"],\n tmp_file,\n Callback=cb,\n )\n except Exception:\n msg = \"failed to download '{}/{}'\".format(\n from_info[\"bucket\"], from_info[\"path\"]\n )\n logger.error(msg)\n continue\n\n move(tmp_file, to_info[\"path\"])\n\n if not no_progress_bar:\n progress.finish_target(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/ssh/__init__.py_from___future___import_un_RemoteSSH.__init__.self.path_info._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_from___future___import_un_RemoteSSH.__init__.self.path_info._", "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": 61, "span_ids": ["RemoteSSH.__init__", "imports", "RemoteSSH"], "tokens": 411}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 __future__ import unicode_literals\n\nimport getpass\n\ntry:\n import paramiko\nexcept ImportError:\n paramiko = None\n\nimport dvc.prompt as prompt\nimport dvc.logger as logger\nfrom dvc.remote.ssh.connection import SSHConnection\nfrom dvc.config import Config\nfrom dvc.utils.compat import urlparse\nfrom dvc.remote.base import RemoteBase\n\n\nclass RemoteSSH(RemoteBase):\n scheme = \"ssh\"\n\n # NOTE: we support both URL-like (ssh://[user@]host.xz[:port]/path) and\n # SCP-like (ssh://[user@]host.xz:/absolute/path) urls.\n REGEX = r\"^ssh://.*$\"\n\n REQUIRES = {\"paramiko\": paramiko}\n\n JOBS = 4\n PARAM_CHECKSUM = \"md5\"\n DEFAULT_PORT = 22\n TIMEOUT = 1800\n\n def __init__(self, repo, config):\n super(RemoteSSH, self).__init__(repo, config)\n self.url = config.get(Config.SECTION_REMOTE_URL, \"ssh://\")\n\n parsed = urlparse(self.url)\n self.host = parsed.hostname\n self.user = (\n config.get(Config.SECTION_REMOTE_USER)\n or parsed.username\n or getpass.getuser()\n )\n self.prefix = parsed.path or \"/\"\n self.port = (\n config.get(Config.SECTION_REMOTE_PORT)\n or parsed.port\n or self.DEFAULT_PORT\n )\n self.keyfile = config.get(Config.SECTION_REMOTE_KEY_FILE, None)\n self.timeout = config.get(Config.SECTION_REMOTE_TIMEOUT, self.TIMEOUT)\n self.password = config.get(Config.SECTION_REMOTE_PASSWORD, None)\n self.ask_password = config.get(\n Config.SECTION_REMOTE_ASK_PASSWORD, False\n )\n\n self.path_info = {\n \"scheme\": \"ssh\",\n \"host\": self.host,\n \"user\": self.user,\n \"port\": self.port,\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.ssh_RemoteSSH.ssh.return.SSHConnection_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.ssh_RemoteSSH.ssh.return.SSHConnection_", "embedding": null, "metadata": {"file_path": "dvc/remote/ssh/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 63, "end_line": 86, "span_ids": ["RemoteSSH.ssh"], "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 RemoteSSH(RemoteBase):\n\n def ssh(self, host=None, user=None, port=None, **kwargs):\n logger.debug(\n \"Establishing ssh connection with '{host}' \"\n \"through port '{port}' as user '{user}'\".format(\n host=host, user=user, port=port\n )\n )\n\n if self.ask_password and not self.password:\n self.password = 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 )\n\n return SSHConnection(\n host,\n username=user,\n port=port,\n key_filename=self.keyfile,\n timeout=self.timeout,\n password=self.password,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.exists_RemoteSSH.remove.with_self_ssh_path_info.ssh_remove_path_info_pat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.exists_RemoteSSH.remove.with_self_ssh_path_info.ssh_remove_path_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": 88, "end_line": 123, "span_ids": ["RemoteSSH.copy", "RemoteSSH.save_info", "RemoteSSH.remove", "RemoteSSH.md5", "RemoteSSH.exists"], "tokens": 251}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteSSH(RemoteBase):\n\n def exists(self, path_info):\n assert not isinstance(path_info, list)\n assert path_info[\"scheme\"] == self.scheme\n\n with self.ssh(**path_info) as ssh:\n return ssh.file_exists(path_info[\"path\"])\n\n def md5(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 copy(self, from_info, to_info):\n if (\n from_info[\"scheme\"] != self.scheme\n or to_info[\"scheme\"] != self.scheme\n ):\n raise NotImplementedError\n\n with self.ssh(**from_info) as ssh:\n ssh.cp(from_info[\"path\"], to_info[\"path\"])\n\n def save_info(self, path_info):\n if path_info[\"scheme\"] != self.scheme:\n raise NotImplementedError\n\n return {self.PARAM_CHECKSUM: self.md5(path_info)}\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\"])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.download_RemoteSSH.download.ssh_close_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.download_RemoteSSH.download.ssh_close_", "embedding": null, "metadata": {"file_path": "dvc/remote/ssh/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 125, "end_line": 169, "span_ids": ["RemoteSSH.download"], "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 RemoteSSH(RemoteBase):\n\n def download(\n self,\n from_infos,\n to_infos,\n no_progress_bar=False,\n names=None,\n resume=False,\n ):\n names = self._verify_path_args(from_infos, to_infos, names)\n ssh = self.ssh(**from_infos[0])\n\n for to_info, from_info, name in zip(to_infos, from_infos, names):\n if from_info[\"scheme\"] != self.scheme:\n raise NotImplementedError\n\n if to_info[\"scheme\"] == self.scheme:\n ssh.cp(from_info[\"path\"], to_info[\"path\"])\n continue\n\n if to_info[\"scheme\"] != \"local\":\n raise NotImplementedError\n\n logger.debug(\n \"Downloading '{host}/{path}' to '{dest}'\".format(\n host=from_info[\"host\"],\n path=from_info[\"path\"],\n dest=to_info[\"path\"],\n )\n )\n\n try:\n ssh.download(\n from_info[\"path\"], to_info[\"path\"], progress_title=name\n )\n except Exception:\n logger.error(\n \"failed to download '{host}/{path}' to '{dest}'\".format(\n host=from_info[\"host\"],\n path=from_info[\"path\"],\n dest=to_info[\"path\"],\n )\n )\n continue\n\n ssh.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/remote/ssh/__init__.py_RemoteSSH.upload_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.upload_", "embedding": null, "metadata": {"file_path": "dvc/remote/ssh/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 171, "end_line": 199, "span_ids": ["RemoteSSH.list_cache_paths", "RemoteSSH.upload"], "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 RemoteSSH(RemoteBase):\n\n def upload(self, from_infos, to_infos, names=None):\n names = self._verify_path_args(to_infos, from_infos, names)\n\n with self.ssh(**to_infos[0]) as ssh:\n for from_info, to_info, name in zip(from_infos, to_infos, names):\n if to_info[\"scheme\"] != self.scheme:\n raise NotImplementedError\n\n if from_info[\"scheme\"] != \"local\":\n raise NotImplementedError\n\n try:\n ssh.upload(\n from_info[\"path\"], to_info[\"path\"], progress_title=name\n )\n except Exception:\n logger.error(\n \"failed to upload '{host}/{path}' to '{dest}'\".format(\n host=from_info[\"host\"],\n path=from_info[\"path\"],\n dest=to_info[\"path\"],\n )\n )\n pass\n\n def list_cache_paths(self):\n with self.ssh(**self.path_info) as ssh:\n return list(ssh.walk_files(self.prefix))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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.makedirs.if_tail_.self__sftp_mkdir_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection_SSHConnection.makedirs.if_tail_.self__sftp_mkdir_path_", "embedding": null, "metadata": {"file_path": "dvc/remote/ssh/connection.py", "file_name": "connection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 41, "end_line": 123, "span_ids": ["SSHConnection.__enter__", "SSHConnection.isfile", "SSHConnection", "SSHConnection.islink", "SSHConnection.close", "SSHConnection.makedirs", "SSHConnection.__init__", "SSHConnection.file_exists", "SSHConnection.isdir", "SSHConnection.__exit__", "SSHConnection._sftp_connect"], "tokens": 479}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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, *args, **kwargs):\n self.timeout = kwargs.get(\"timeout\", 1800)\n\n self._ssh = paramiko.SSHClient()\n self._ssh.load_system_host_keys()\n self._ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())\n\n self._ssh.connect(*args, **kwargs)\n self._sftp = None\n self._sftp_alive = False\n\n def __enter__(self):\n return self\n\n def __exit__(self, exception_type, exception_value, traceback):\n self.close()\n\n def _sftp_connect(self):\n if not self._sftp or not self._sftp_alive:\n self._sftp = self._ssh.open_sftp()\n self._sftp_alive = True\n\n def close(self):\n if self._sftp:\n self._sftp.close()\n self._sftp_alive = False\n\n self._ssh.close()\n\n def file_exists(self, path):\n self._sftp_connect()\n try:\n return self._sftp.stat(path)\n except IOError:\n return False\n pass\n\n def isdir(self, path):\n from stat import S_ISDIR\n\n self._sftp_connect()\n try:\n return S_ISDIR(self._sftp.stat(path).st_mode)\n except IOError:\n return False\n\n def isfile(self, path):\n from stat import S_ISREG\n\n self._sftp_connect()\n try:\n return S_ISREG(self._sftp.stat(path).st_mode)\n except IOError:\n return False\n\n def islink(self, path):\n from stat import S_ISLNK\n\n self._sftp_connect()\n try:\n return S_ISLNK(self._sftp.stat(path).st_mode)\n except IOError:\n return False\n\n def makedirs(self, path):\n self._sftp_connect()\n\n if self.isdir(path):\n return\n\n if self.isfile(path) or self.islink(path):\n raise DvcException(\n \"a file with the same name '{}' already exists\".format(path)\n )\n\n head, tail = os.path.split(path)\n\n if head:\n self.makedirs(head)\n\n if tail:\n self._sftp.mkdir(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.upload_SSHConnection.upload.self__sftp_rename_tmp_fil": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.upload_SSHConnection.upload.self__sftp_rename_tmp_fil", "embedding": null, "metadata": {"file_path": "dvc/remote/ssh/connection.py", "file_name": "connection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 183, "end_line": 198, "span_ids": ["SSHConnection.upload"], "tokens": 116}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SSHConnection:\n\n def upload(self, src, dest, no_progress_bar=False, progress_title=None):\n self._sftp_connect()\n\n self.makedirs(posixpath.dirname(dest))\n tmp_file = tmp_fname(dest)\n\n if no_progress_bar:\n self._sftp.put(src, tmp_file)\n else:\n if not progress_title:\n progress_title = posixpath.basename(dest)\n\n self._sftp.put(src, tmp_file, callback=create_cb(progress_title))\n progress.finish_target(progress_title)\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": 182, "end_line": 229, "span_ids": ["SSHConnection.execute"], "tokens": 287}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SSHConnection:\n\n def execute(self, cmd):\n stdin, stdout, stderr = self._ssh.exec_command(cmd)\n channel = stdout.channel\n\n stdin.close()\n channel.shutdown_write()\n\n stdout_chunks = []\n stderr_chunks = []\n while (\n not channel.closed\n or channel.recv_ready()\n or channel.recv_stderr_ready()\n ):\n import select\n\n got_chunk = False\n readq, _, _ = select.select([stdout.channel], [], [], self.timeout)\n for c in readq:\n if c.recv_ready():\n stdout_chunks.append(stdout.channel.recv(len(c.in_buffer)))\n got_chunk = True\n\n if c.recv_stderr_ready():\n stderr_len = len(c.in_stderr_buffer)\n s = stderr.channel.recv_stderr(stderr_len)\n stderr_chunks.append(s)\n got_chunk = True\n\n if (\n not got_chunk\n and stdout.channel.exit_status_ready()\n and not stderr.channel.recv_stderr_ready()\n and not stdout.channel.recv_ready()\n ):\n stdout.channel.shutdown_read()\n stdout.channel.close()\n break\n\n stdout.close()\n stderr.close()\n\n ret = stdout.channel.recv_exit_status()\n if ret != 0:\n err = b\"\".join(stderr_chunks).decode(\"utf-8\")\n raise RemoteCmdError(\"ssh\", cmd, ret, err)\n\n return b\"\".join(stdout_chunks).decode(\"utf-8\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.md5_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.md5_", "embedding": null, "metadata": {"file_path": "dvc/remote/ssh/connection.py", "file_name": "connection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 231, "end_line": 260, "span_ids": ["SSHConnection.cp", "SSHConnection.md5"], "tokens": 229}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SSHConnection:\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 uname = self.execute(\"uname\").strip()\n\n command = {\n \"Darwin\": \"md5 {}\".format(path),\n \"Linux\": \"md5sum --tag {}\".format(path),\n }.get(uname)\n\n if not command:\n raise DvcException(\n \"'{uname}' is not supported as a remote\".format(uname=uname)\n )\n\n md5 = self.execute(command).split()[-1]\n assert len(md5) == 32\n return md5\n\n def cp(self, src, dest):\n self.makedirs(posixpath.dirname(dest))\n self.execute(\"cp {} {}\".format(src, dest))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_from___future___import_un_Repo.check_dag.self_graph_stages_stages_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_from___future___import_un_Repo.check_dag.self_graph_stages_stages_", "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": 131, "span_ids": ["Repo.check_dag", "Repo.__repr__", "Repo.find_root", "imports", "Repo", "Repo.find_dvc_dir", "Repo._ignore", "Repo.unprotect", "Repo.init", "Repo.__init__"], "tokens": 903}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 __future__ import unicode_literals\n\nimport os\n\nimport dvc.prompt as prompt\nimport dvc.logger as logger\n\nfrom dvc.exceptions import (\n DvcException,\n NotDvcRepoError,\n OutputNotFoundError,\n TargetNotDirectoryError,\n)\n\n\nclass Repo(object):\n DVC_DIR = \".dvc\"\n\n from dvc.repo.destroy import destroy\n from dvc.repo.install import install\n from dvc.repo.add import add\n from dvc.repo.remove import remove\n from dvc.repo.lock import lock as lock_stage\n from dvc.repo.move import move\n from dvc.repo.run import run\n from dvc.repo.imp import imp\n from dvc.repo.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.pkg import install_pkg\n from dvc.repo.brancher import brancher\n\n def __init__(self, root_dir=None):\n from dvc.config import Config\n from dvc.state import State\n from dvc.lock import Lock\n from dvc.scm import SCM\n from dvc.cache import Cache\n from dvc.data_cloud import DataCloud\n from dvc.updater import Updater\n from dvc.repo.metrics import Metrics\n from dvc.scm.tree import WorkingTree\n from dvc.repo.tag import Tag\n\n root_dir = self.find_root(root_dir)\n\n self.root_dir = os.path.abspath(os.path.realpath(root_dir))\n self.dvc_dir = os.path.join(self.root_dir, self.DVC_DIR)\n\n self.config = Config(self.dvc_dir)\n\n self.tree = WorkingTree()\n\n self.scm = SCM(self.root_dir, repo=self)\n self.lock = Lock(self.dvc_dir)\n # NOTE: storing state and link_state in the repository itself to avoid\n # any possible state corruption in 'shared cache dir' scenario.\n self.state = State(self, self.config.config)\n\n core = self.config.config[Config.SECTION_CORE]\n\n logger.set_level(core.get(Config.SECTION_CORE_LOGLEVEL))\n\n self.cache = Cache(self)\n self.cloud = DataCloud(self, config=self.config.config)\n self.updater = Updater(self.dvc_dir)\n\n self.metrics = Metrics(self)\n self.tag = Tag(self)\n\n self._ignore()\n\n self.updater.check()\n\n def __repr__(self):\n return \"Repo: '{root_dir}'\".format(root_dir=self.root_dir)\n\n @staticmethod\n def find_root(root=None):\n if root is None:\n root = os.getcwd()\n else:\n root = os.path.abspath(os.path.realpath(root))\n\n while True:\n dvc_dir = os.path.join(root, Repo.DVC_DIR)\n if os.path.isdir(dvc_dir):\n return root\n if os.path.ismount(root):\n break\n root = os.path.dirname(root)\n raise NotDvcRepoError(root)\n\n @staticmethod\n def find_dvc_dir(root=None):\n root_dir = Repo.find_root(root)\n return os.path.join(root_dir, Repo.DVC_DIR)\n\n @staticmethod\n def init(root_dir=os.curdir, no_scm=False, force=False):\n from dvc.repo.init import init\n\n init(root_dir=root_dir, no_scm=no_scm, force=force)\n return Repo(root_dir)\n\n def unprotect(self, target):\n path_info = {\"schema\": \"local\", \"path\": target}\n return self.cache.local.unprotect(path_info)\n\n def _ignore(self):\n flist = [\n self.state.state_file,\n self.lock.lock_file,\n self.config.config_local_file,\n self.updater.updater_file,\n self.updater.lock.lock_file,\n ] + self.state.temp_files\n\n if self.cache.local.cache_dir.startswith(self.root_dir):\n flist += [self.cache.local.cache_dir]\n\n self.scm.ignore_list(flist)\n\n def check_dag(self, stages):\n \"\"\"Generate graph including the new stage to check for errors\"\"\"\n self.graph(stages=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._check_cyclic_graph_Repo.collect.return.ret": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo._check_cyclic_graph_Repo.collect.return.ret", "embedding": null, "metadata": {"file_path": "dvc/repo/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 133, "end_line": 166, "span_ids": ["Repo._get_pipeline", "Repo._check_cyclic_graph", "Repo.collect"], "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 Repo(object):\n\n @staticmethod\n def _check_cyclic_graph(graph):\n import networkx as nx\n from dvc.exceptions import CyclicGraphError\n\n cycles = list(nx.simple_cycles(graph))\n\n if cycles:\n raise CyclicGraphError(cycles[0])\n\n def _get_pipeline(self, node):\n pipelines = [i for i in self.pipelines() if i.has_node(node)]\n assert len(pipelines) == 1\n return pipelines[0]\n\n def collect(self, target, with_deps=False, recursive=False):\n import networkx as nx\n from dvc.stage import Stage\n\n if not target or recursive:\n return self.active_stages(target)\n\n stage = Stage.load(self, target)\n if not with_deps:\n return [stage]\n\n node = os.path.relpath(stage.path, self.root_dir)\n G = self._get_pipeline(node)\n\n ret = []\n for n in nx.dfs_postorder_nodes(G, node):\n ret.append(G.node[n][\"stage\"])\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/__init__.py_Repo._collect_dir_cache_Repo._collect_dir_cache.return.ret": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo._collect_dir_cache_Repo._collect_dir_cache.return.ret", "embedding": null, "metadata": {"file_path": "dvc/repo/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 170, "end_line": 208, "span_ids": ["Repo._collect_dir_cache"], "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 Repo(object):\n\n def _collect_dir_cache(\n self, out, branch=None, remote=None, force=False, jobs=None\n ):\n info = out.dumpd()\n ret = [info]\n r = out.remote\n md5 = info[r.PARAM_CHECKSUM]\n\n if self.cache.local.changed_cache_file(md5):\n try:\n self.cloud.pull(\n ret, jobs=jobs, remote=remote, show_checksums=False\n )\n except DvcException as exc:\n msg = \"Failed to pull cache for '{}': {}\"\n logger.debug(msg.format(out, exc))\n\n if self.cache.local.changed_cache_file(md5):\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):\n raise DvcException(\n \"unable to fully collect used cache\"\n \" without cache for directory '{}'\".format(out)\n )\n else:\n return ret\n\n for i in self.cache.local.load_dir_cache(md5):\n i[\"branch\"] = branch\n i[r.PARAM_PATH] = os.path.join(\n info[r.PARAM_PATH], i[r.PARAM_RELPATH]\n )\n ret.append(i)\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/__init__.py_Repo._collect_used_cache_Repo._collect_used_cache.return.self__collect_dir_cache_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo._collect_used_cache_Repo._collect_used_cache.return.self__collect_dir_cache_", "embedding": null, "metadata": {"file_path": "dvc/repo/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 210, "end_line": 237, "span_ids": ["Repo._collect_used_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 Repo(object):\n\n def _collect_used_cache(\n self, out, branch=None, remote=None, force=False, jobs=None\n ):\n if not out.use_cache or not out.info:\n if not out.info:\n logger.warning(\n \"Output '{}'({}) is missing version \"\n \"info. Cache for it will not be collected. \"\n \"Use dvc repro to get your pipeline up to \"\n \"date.\".format(out, out.stage)\n )\n return []\n\n info = out.dumpd()\n info[\"branch\"] = branch\n ret = [info]\n\n if out.scheme != \"local\":\n return ret\n\n md5 = info[out.remote.PARAM_CHECKSUM]\n cache = self.cache.local.get(md5)\n if not out.remote.is_dir_cache(cache):\n return ret\n\n return self._collect_dir_cache(\n out, branch=branch, remote=remote, force=force, jobs=jobs\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": 237, "end_line": 289, "span_ids": ["Repo.used_cache"], "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 Repo(object):\n\n def used_cache(\n self,\n target=None,\n all_branches=False,\n active=True,\n with_deps=False,\n all_tags=False,\n remote=None,\n force=False,\n jobs=None,\n recursive=False,\n ):\n cache = {}\n cache[\"local\"] = []\n cache[\"s3\"] = []\n cache[\"gs\"] = []\n cache[\"hdfs\"] = []\n cache[\"ssh\"] = []\n cache[\"azure\"] = []\n\n for branch in self.brancher(\n all_branches=all_branches, all_tags=all_tags\n ):\n if target:\n if recursive:\n stages = self.stages(target)\n else:\n stages = self.collect(target, with_deps=with_deps)\n elif active:\n stages = self.active_stages()\n else:\n stages = self.stages()\n\n for stage in stages:\n if active and not target and stage.locked:\n logger.warning(\n \"DVC file '{path}' is locked. Its dependencies are\"\n \" not going to be pushed/pulled/fetched.\".format(\n path=stage.relpath\n )\n )\n\n for out in stage.outs:\n scheme = out.path_info[\"scheme\"]\n cache[scheme] += self._collect_used_cache(\n out,\n branch=branch,\n remote=remote,\n force=force,\n jobs=jobs,\n )\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/__init__.py_Repo.graph_Repo.graph.return.G_G_active": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.graph_Repo.graph.return.G_G_active", "embedding": null, "metadata": {"file_path": "dvc/repo/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 291, "end_line": 355, "span_ids": ["Repo.graph"], "tokens": 463}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Repo(object):\n\n def graph(self, stages=None, from_directory=None):\n import networkx as nx\n from dvc.exceptions import (\n OutputDuplicationError,\n StagePathAsOutputError,\n OverlappingOutputPathsError,\n )\n\n G = nx.DiGraph()\n G_active = nx.DiGraph()\n stages = stages or self.stages(from_directory, check_dag=False)\n stages = [stage for stage in stages if stage]\n outs = []\n\n for stage in stages:\n for out in stage.outs:\n existing = []\n for o in outs:\n if o.path == out.path:\n existing.append(o.stage)\n\n in_o_dir = out.path.startswith(o.path + o.sep)\n in_out_dir = o.path.startswith(out.path + out.sep)\n if in_o_dir or in_out_dir:\n raise OverlappingOutputPathsError(o, out)\n\n if existing:\n stages = [stage.relpath, existing[0].relpath]\n raise OutputDuplicationError(out.path, stages)\n\n outs.append(out)\n\n for stage in stages:\n path_dir = os.path.dirname(stage.path) + os.sep\n for out in outs:\n if path_dir.startswith(out.path + os.sep):\n raise StagePathAsOutputError(stage.wdir, stage.relpath)\n\n # collect the whole DAG\n for stage in stages:\n node = os.path.relpath(stage.path, self.root_dir)\n\n G.add_node(node, stage=stage)\n G_active.add_node(node, stage=stage)\n\n for dep in stage.deps:\n for out in outs:\n if (\n out.path != dep.path\n and not dep.path.startswith(out.path + out.sep)\n and not out.path.startswith(dep.path + dep.sep)\n ):\n continue\n\n dep_stage = out.stage\n dep_node = os.path.relpath(dep_stage.path, self.root_dir)\n G.add_node(dep_node, stage=dep_stage)\n G.add_edge(node, dep_node)\n if not stage.locked:\n G_active.add_node(dep_node, stage=dep_stage)\n G_active.add_edge(node, dep_node)\n\n self._check_cyclic_graph(G)\n\n return G, G_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/__init__.py_Repo.pipelines_Repo.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.pipelines_Repo.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": 357, "end_line": 409, "span_ids": ["Repo.pipelines", "Repo.stages"], "tokens": 383}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Repo(object):\n\n def pipelines(self, from_directory=None):\n import networkx as nx\n\n G, G_active = self.graph(from_directory=from_directory)\n\n return [\n G.subgraph(c).copy() for c in nx.weakly_connected_components(G)\n ]\n\n def stages(self, from_directory=None, check_dag=True):\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 from dvc.stage import Stage\n\n if not from_directory:\n from_directory = self.root_dir\n elif not os.path.isdir(from_directory):\n raise TargetNotDirectoryError(from_directory)\n\n stages = []\n outs = []\n for root, dirs, files in self.tree.walk(from_directory):\n for fname in files:\n path = os.path.join(root, fname)\n if not Stage.is_valid_filename(path):\n continue\n stage = Stage.load(self, path)\n for out in stage.outs:\n outs.append(out.path + out.sep)\n stages.append(stage)\n\n def filter_dirs(dname, root=root):\n path = os.path.join(root, dname)\n if path in (self.dvc_dir, self.scm.dir):\n return False\n for out in outs:\n if path == os.path.normpath(out) or path.startswith(out):\n return False\n return True\n\n dirs[:] = list(filter(filter_dirs, dirs))\n\n if check_dag:\n self.check_dag(stages)\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/__init__.py_Repo.active_stages_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.active_stages_", "embedding": null, "metadata": {"file_path": "dvc/repo/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 411, "end_line": 448, "span_ids": ["Repo.is_dvc_internal", "Repo.active_stages", "Repo.find_outs_by_path"], "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 Repo(object):\n\n def active_stages(self, from_directory=None):\n import networkx as nx\n\n stages = []\n for G in self.pipelines(from_directory):\n stages.extend(list(nx.get_node_attributes(G, \"stage\").values()))\n return stages\n\n def find_outs_by_path(self, path, outs=None, recursive=False):\n if not outs:\n # there is no `from_directory=path` argument because some data\n # files might be generated to an upper level, and so it is\n # needed to look at all the files (project root_dir)\n stages = self.stages()\n outs = [out for stage in stages for out in stage.outs]\n\n abs_path = os.path.abspath(path)\n is_dir = self.tree.isdir(abs_path)\n\n def func(out):\n if out.path == abs_path:\n return True\n\n if is_dir and recursive and out.path.startswith(abs_path + os.sep):\n return True\n\n return False\n\n matched = list(filter(func, outs))\n if not matched:\n raise OutputNotFoundError(path)\n\n return matched\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/add.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/add.py_os_", "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": 56, "span_ids": ["add", "imports", "_create_stages", "_find_all_targets"], "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\n\nfrom dvc.repo.scm_context import scm_context\nfrom dvc.stage import Stage\nfrom dvc.utils import walk_files\nfrom dvc.exceptions import RecursiveAddingWhileUsingFilename\n\n\n@scm_context\ndef add(repo, target, recursive=False, no_commit=False, fname=None):\n if recursive and fname:\n raise RecursiveAddingWhileUsingFilename()\n\n targets = _find_all_targets(repo, target, recursive)\n\n stages = _create_stages(repo, targets, fname, no_commit)\n\n repo.check_dag(repo.stages() + stages)\n\n for stage in stages:\n stage.dump()\n return stages\n\n\ndef _find_all_targets(repo, target, recursive):\n if os.path.isdir(target) and recursive:\n return [\n file\n for file in walk_files(target)\n if not repo.is_dvc_internal(file)\n if not Stage.is_stage_file(file)\n if not repo.scm.belongs_to_scm(file)\n if not repo.scm.is_tracked(file)\n ]\n return [target]\n\n\ndef _create_stages(repo, targets, fname, no_commit):\n stages = []\n\n with repo.state:\n for out in targets:\n stage = Stage.create(repo=repo, outs=[out], add=True, fname=fname)\n\n if not stage:\n continue\n\n stage.save()\n\n if not no_commit:\n stage.commit()\n\n stages.append(stage)\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/commit.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/commit.py__", "embedding": null, "metadata": {"file_path": "dvc/repo/commit.py", "file_name": "commit.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 8, "span_ids": ["commit"], "tokens": 61}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def commit(self, target, with_deps=False, recursive=False, force=False):\n stages = self.collect(target, with_deps=with_deps, recursive=recursive)\n with self.state:\n for stage in stages:\n stage.check_can_commit(force=force)\n stage.commit()\n stage.dump()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": 9, "span_ids": ["imports", "destroy"], "tokens": 27}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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\n\ndef destroy(self):\n for stage in self.stages():\n stage.remove()\n\n shutil.rmtree(self.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/fetch.py_from___future___import_un_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/fetch.py_from___future___import_un_", "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": 29, "span_ids": ["fetch", "imports"], "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": "from __future__ import unicode_literals\n\n\ndef fetch(\n self,\n target=None,\n jobs=1,\n remote=None,\n all_branches=False,\n show_checksums=False,\n with_deps=False,\n all_tags=False,\n recursive=False,\n):\n with self.state:\n used = self.used_cache(\n target,\n all_branches=all_branches,\n all_tags=all_tags,\n with_deps=with_deps,\n force=True,\n remote=remote,\n jobs=jobs,\n recursive=recursive,\n )[\"local\"]\n return self.cloud.pull(\n used, 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/repo/gc.py_from___future___import_un__do_gc.if_not_removed_.logger_info_No_unused_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/gc.py_from___future___import_un__do_gc.if_not_removed_.logger_info_No_unused_", "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": 54, "span_ids": ["imports", "_load_all_used_cache", "_do_gc", "_merge_cache_lists"], "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": "from __future__ import unicode_literals\n\nimport collections\n\nimport dvc.logger as logger\n\n\ndef _merge_cache_lists(clists):\n merged_cache = collections.defaultdict(list)\n\n for cache_list in clists:\n for scheme, cache in cache_list.items():\n for item in cache:\n if item not in merged_cache[scheme]:\n merged_cache[scheme].append(item)\n\n return merged_cache\n\n\ndef _load_all_used_cache(\n repos,\n target=None,\n all_branches=False,\n active=True,\n with_deps=False,\n all_tags=False,\n remote=None,\n force=False,\n jobs=None,\n):\n clists = []\n\n for repo in repos:\n with repo.state:\n repo_clist = repo.used_cache(\n target=None,\n all_branches=all_branches,\n active=False,\n with_deps=with_deps,\n all_tags=all_tags,\n remote=remote,\n force=force,\n jobs=jobs,\n )\n\n clists.append(repo_clist)\n\n return clists\n\n\ndef _do_gc(typ, func, clist):\n removed = func(clist)\n if not removed:\n logger.info(\"No unused {} cache to remove.\".format(typ))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": 57, "end_line": 112, "span_ids": ["gc"], "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": "def gc(\n self,\n all_branches=False,\n cloud=False,\n remote=None,\n with_deps=False,\n all_tags=False,\n force=False,\n jobs=None,\n repos=None,\n):\n from dvc.repo import Repo\n\n all_repos = [self]\n\n if repos:\n all_repos.extend(Repo(path) for path in repos)\n\n all_clists = _load_all_used_cache(\n all_repos,\n target=None,\n all_branches=all_branches,\n active=False,\n with_deps=with_deps,\n all_tags=all_tags,\n remote=remote,\n force=force,\n jobs=jobs,\n )\n\n if len(all_clists) > 1:\n clist = _merge_cache_lists(all_clists)\n else:\n clist = all_clists[0]\n\n with self.state:\n _do_gc(\"local\", self.cache.local.gc, clist)\n\n if self.cache.s3:\n _do_gc(\"s3\", self.cache.s3.gc, clist)\n\n if self.cache.gs:\n _do_gc(\"gs\", self.cache.gs.gc, clist)\n\n if self.cache.ssh:\n _do_gc(\"ssh\", self.cache.ssh.gc, clist)\n\n if self.cache.hdfs:\n _do_gc(\"hdfs\", self.cache.hdfs.gc, clist)\n\n if self.cache.azure:\n _do_gc(\"azure\", self.cache.azure.gc, clist)\n\n if cloud:\n _do_gc(\"remote\", self.cloud._get_cloud(remote, \"gc -c\").gc, clist)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": 22, "span_ids": ["imports", "imp"], "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": "from dvc.repo.scm_context import scm_context\n\n\n@scm_context\ndef imp(self, url, out, resume=False):\n from dvc.stage import Stage\n\n with self.state:\n stage = Stage.create(repo=self, cmd=None, deps=[url], outs=[out])\n\n if stage is None:\n return None\n\n self.check_dag(self.stages() + [stage])\n\n with self.state:\n stage.run(resume=resume)\n\n stage.dump()\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/init.py_os__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_os__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": 34, "span_ids": ["imports", "_welcome_message"], "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": "import os\nimport shutil\nimport colorama\n\nimport dvc.logger as logger\nfrom dvc.repo import Repo\nfrom dvc.scm import SCM, NoSCM\nfrom dvc.config import Config\nfrom dvc.exceptions import InitError\n\n\ndef _welcome_message():\n logger.box(\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 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/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": 37, "end_line": 91, "span_ids": ["init"], "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 init(root_dir=os.curdir, no_scm=False, force=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 root_dir = os.path.abspath(root_dir)\n dvc_dir = os.path.join(root_dir, Repo.DVC_DIR)\n scm = SCM(root_dir)\n if isinstance(scm, NoSCM) and not no_scm:\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.\".format(\n repo=root_dir\n )\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=os.path.relpath(dvc_dir)\n )\n )\n\n shutil.rmtree(dvc_dir)\n\n os.mkdir(dvc_dir)\n\n config = Config.init(dvc_dir)\n proj = Repo(root_dir)\n\n scm.add([config.config_file])\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": 10}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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):\n self.scm.install()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/lock.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/lock.py__", "embedding": null, "metadata": {"file_path": "dvc/repo/lock.py", "file_name": "lock.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 9, "span_ids": ["lock"], "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": "def lock(self, target, unlock=False):\n from dvc.stage import Stage\n\n stage = Stage.load(self, target)\n stage.locked = False if unlock else True\n stage.dump()\n\n return stage", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/__init__.py_Metrics_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/__init__.py_Metrics_", "embedding": null, "metadata": {"file_path": "dvc/repo/metrics/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 24, "span_ids": ["Metrics.modify", "Metrics.show", "Metrics.__init__", "Metrics.add", "Metrics", "Metrics.remove"], "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 Metrics(object):\n def __init__(self, repo):\n self.repo = repo\n\n def add(self, *args, **kwargs):\n from dvc.repo.metrics.add import add\n\n return add(self.repo, *args, **kwargs)\n\n def modify(self, *args, **kwargs):\n from dvc.repo.metrics.modify import modify\n\n return modify(self.repo, *args, **kwargs)\n\n def show(self, *args, **kwargs):\n from dvc.repo.metrics.show import show\n\n return show(self.repo, *args, **kwargs)\n\n def remove(self, *args, **kwargs):\n from dvc.repo.metrics.remove import remove\n\n return remove(self.repo, *args, **kwargs)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/add.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/add.py__", "embedding": null, "metadata": {"file_path": "dvc/repo/metrics/add.py", "file_name": "add.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 8, "span_ids": ["add", "imports"], "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.repo.metrics.modify import modify\n\n\ndef add(repo, path, typ=None, xpath=None):\n if not typ:\n typ = \"raw\"\n modify(repo, path, typ, xpath)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/modify.py_from___future___import_un_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/modify.py_from___future___import_un_", "embedding": null, "metadata": {"file_path": "dvc/repo/metrics/modify.py", "file_name": "modify.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 41, "span_ids": ["imports", "modify"], "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 __future__ import unicode_literals\n\nfrom dvc.exceptions import DvcException\n\n\ndef modify(repo, path, typ=None, xpath=None, delete=False):\n supported_types = [\"raw\", \"json\", \"csv\", \"tsv\", \"hcsv\", \"htsv\"]\n outs = repo.find_outs_by_path(path)\n assert len(outs) == 1\n out = outs[0]\n\n if out.scheme != \"local\":\n msg = \"output '{}' scheme '{}' is not supported for metrics\"\n raise DvcException(msg.format(out.path, out.path_info[\"scheme\"]))\n\n if typ is not None:\n typ = typ.lower().strip()\n if typ not in [\"raw\", \"json\", \"csv\", \"tsv\", \"hcsv\", \"htsv\"]:\n msg = (\n \"metric type '{typ}' is not supported, \"\n \"must be one of [{types}]\"\n )\n raise DvcException(\n msg.format(typ=typ, types=\", \".join(supported_types))\n )\n if not isinstance(out.metric, dict):\n out.metric = {}\n out.metric[out.PARAM_METRIC_TYPE] = typ\n\n if xpath is not None:\n if not isinstance(out.metric, dict):\n out.metric = {}\n out.metric[out.PARAM_METRIC_XPATH] = xpath\n\n if delete:\n out.metric = None\n\n out.verify_metric()\n\n out.stage.dump()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/remove.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/remove.py__", "embedding": null, "metadata": {"file_path": "dvc/repo/metrics/remove.py", "file_name": "remove.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 6, "span_ids": ["imports", "remove"], "tokens": 24}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.repo.metrics.modify import modify\n\n\ndef remove(repo, path):\n modify(repo, path, delete=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/show.py_from___future___import_un__read_metric_xsv.return._do_read_metric_xsv_reade": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/show.py_from___future___import_un__read_metric_xsv.return._do_read_metric_xsv_reade", "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": 50, "span_ids": ["_read_metric_json", "_get_values", "imports", "_read_metric_hxsv", "_do_read_metric_xsv", "_read_metric_xsv"], "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": "from __future__ import unicode_literals\n\nimport os\nimport csv\nimport json\nfrom jsonpath_rw import parse\n\nimport dvc.logger as logger\nfrom dvc.exceptions import OutputNotFoundError, BadMetricError, NoMetricsError\nfrom dvc.utils.compat import builtin_str, open, StringIO, csv_reader\n\n\ndef _read_metric_json(fd, json_path):\n parser = parse(json_path)\n return [x.value for x in parser.find(json.load(fd))]\n\n\ndef _get_values(row):\n if isinstance(row, dict):\n return list(row.values())\n else:\n return row\n\n\ndef _do_read_metric_xsv(reader, row, col):\n if col is not None and row is not None:\n return [reader[row][col]]\n elif col is not None:\n return [r[col] for r in reader]\n elif row is not None:\n return _get_values(reader[row])\n return [_get_values(r) for r in reader]\n\n\ndef _read_metric_hxsv(fd, hxsv_path, delimiter):\n indices = hxsv_path.split(\",\")\n row = indices[0]\n row = int(row) if row else None\n col = indices[1] if len(indices) > 1 and indices[1] else None\n reader = list(csv.DictReader(fd, delimiter=builtin_str(delimiter)))\n return _do_read_metric_xsv(reader, row, col)\n\n\ndef _read_metric_xsv(fd, xsv_path, delimiter):\n indices = xsv_path.split(\",\")\n row = indices[0]\n row = int(row) if row else None\n col = int(indices[1]) if len(indices) > 1 and indices[1] else None\n reader = list(csv.reader(fd, delimiter=builtin_str(delimiter)))\n return _do_read_metric_xsv(reader, row, col)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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__read_typed_metric__read_typed_metric.return.ret": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/show.py__read_typed_metric__read_typed_metric.return.ret", "embedding": null, "metadata": {"file_path": "dvc/repo/metrics/show.py", "file_name": "show.py", "file_type": "text/x-python", "category": "implementation", "start_line": 53, "end_line": 66, "span_ids": ["_read_typed_metric"], "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 _read_typed_metric(typ, xpath, fd):\n if typ == \"json\":\n ret = _read_metric_json(fd, xpath)\n elif typ == \"csv\":\n ret = _read_metric_xsv(fd, xpath, \",\")\n elif typ == \"tsv\":\n ret = _read_metric_xsv(fd, xpath, \"\\t\")\n elif typ == \"hcsv\":\n ret = _read_metric_hxsv(fd, xpath, \",\")\n elif typ == \"htsv\":\n ret = _read_metric_hxsv(fd, xpath, \"\\t\")\n else:\n ret = fd.read().strip()\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__collect_metrics__collect_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__collect_metrics__collect_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": 148, "end_line": 193, "span_ids": ["_collect_metrics"], "tokens": 318}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _collect_metrics(self, path, recursive, typ, xpath, branch):\n \"\"\"Gather all the metric outputs.\n\n Args:\n path (str): Path to a metric file or a directory.\n recursive (bool): If path is a directory, do a recursive search for\n metrics on the given path.\n typ (str): The type of metric to search for, could be one of the\n following (raw|json|tsv|htsv|csv|hcsv).\n xpath (str): Path to search for.\n branch (str): Branch to look up for metrics.\n\n Returns:\n list(tuple): (output, typ, xpath)\n - output:\n - typ:\n - xpath:\n \"\"\"\n outs = [out for stage in self.stages() for out in stage.outs]\n\n if path:\n try:\n outs = self.find_outs_by_path(path, outs=outs, recursive=recursive)\n except OutputNotFoundError:\n logger.debug(\n \"stage file not for found for '{}' in branch '{}'\".format(\n path, branch\n )\n )\n return []\n\n res = []\n for o in outs:\n if not o.metric:\n continue\n\n if not typ and isinstance(o.metric, dict):\n t = o.metric.get(o.PARAM_METRIC_TYPE, typ)\n x = o.metric.get(o.PARAM_METRIC_XPATH, xpath)\n else:\n t = typ\n x = xpath\n\n res.append((o, t, x))\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/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": 69, "span_ids": ["imports", "_expand_target_path", "move"], "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 os\n\nfrom dvc.exceptions import MoveNotDataSourceError\nfrom dvc.repo.scm_context import scm_context\n\n\ndef _expand_target_path(from_path, to_path):\n if os.path.isdir(to_path) and not os.path.isdir(from_path):\n return os.path.join(to_path, os.path.basename(from_path))\n return to_path\n\n\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 stage 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\n from_out = Output.loads_from(Stage(self), [from_path])[0]\n\n to_path = _expand_target_path(from_path, to_path)\n\n outs = self.find_outs_by_path(from_out.path)\n assert len(outs) == 1\n out = outs[0]\n stage = out.stage\n\n if not stage.is_data_source:\n raise MoveNotDataSourceError(stage.relpath)\n\n stage_name = os.path.splitext(os.path.basename(stage.path))[0]\n from_name = os.path.basename(from_out.path)\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) + Stage.STAGE_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_out = Output.loads_from(\n stage, [os.path.basename(to_path)], out.cache, out.metric\n )[0]\n\n with self.state:\n out.move(to_out)\n\n stage.dump()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_from___future___import_un_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/pull.py_from___future___import_un_", "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": 30, "span_ids": ["imports", "pull"], "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 __future__ import unicode_literals\n\n\ndef pull(\n self,\n target=None,\n jobs=1,\n remote=None,\n all_branches=False,\n show_checksums=False,\n with_deps=False,\n all_tags=False,\n force=False,\n recursive=False,\n):\n processed_files_count = self.fetch(\n target,\n jobs,\n remote=remote,\n all_branches=all_branches,\n all_tags=all_tags,\n show_checksums=show_checksums,\n with_deps=with_deps,\n recursive=recursive,\n )\n self.checkout(\n target=target, with_deps=with_deps, force=force, recursive=recursive\n )\n return processed_files_count", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_from___future___import_un_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/push.py_from___future___import_un_", "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": 29, "span_ids": ["imports", "push"], "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": "from __future__ import unicode_literals\n\n\ndef push(\n self,\n target=None,\n jobs=1,\n remote=None,\n all_branches=False,\n show_checksums=False,\n with_deps=False,\n all_tags=False,\n recursive=False,\n):\n with self.state:\n used = self.used_cache(\n target,\n all_branches=all_branches,\n all_tags=all_tags,\n with_deps=with_deps,\n force=True,\n remote=remote,\n jobs=jobs,\n recursive=recursive,\n )[\"local\"]\n return self.cloud.push(\n used, 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/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": 11, "span_ids": ["remove"], "tokens": 52}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def remove(self, target, outs_only=False):\n from dvc.stage import Stage\n\n stage = Stage.load(self, target)\n if outs_only:\n stage.remove_outs(force=True)\n else:\n stage.remove(force=True)\n\n return stage", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/reproduce.py_from___future___import_un__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_from___future___import_un__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": 28, "span_ids": ["imports", "_reproduce_stage"], "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": "from __future__ import unicode_literals\n\nimport os\n\nimport dvc.logger as logger\nfrom dvc.exceptions import ReproductionError\nfrom dvc.repo.scm_context import scm_context\n\n\ndef _reproduce_stage(stages, node, force, dry, interactive, no_commit):\n stage = stages[node]\n\n if stage.locked:\n logger.warning(\n \"DVC file '{path}' is locked. Its dependencies are\"\n \" not going to be reproduced.\".format(path=stage.relpath)\n )\n\n stage = stage.reproduce(\n force=force, dry=dry, interactive=interactive, no_commit=no_commit\n )\n if not stage:\n return []\n\n if not dry:\n stage.dump()\n\n return [stage]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/reproduce.py_reproduce_reproduce.return.ret": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/reproduce.py_reproduce_reproduce.return.ret", "embedding": null, "metadata": {"file_path": "dvc/repo/reproduce.py", "file_name": "reproduce.py", "file_type": "text/x-python", "category": "implementation", "start_line": 31, "end_line": 85, "span_ids": ["reproduce"], "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": "@scm_context\ndef reproduce(\n self,\n target=None,\n recursive=True,\n force=False,\n dry=False,\n interactive=False,\n pipeline=False,\n all_pipelines=False,\n ignore_build_cache=False,\n no_commit=False,\n):\n from dvc.stage import Stage\n\n if not target and not all_pipelines:\n raise ValueError()\n\n if not interactive:\n config = self.config\n core = config.config[config.SECTION_CORE]\n interactive = core.get(config.SECTION_CORE_INTERACTIVE, False)\n\n targets = []\n if pipeline or all_pipelines:\n if pipeline:\n stage = Stage.load(self, target)\n node = os.path.relpath(stage.path, self.root_dir)\n pipelines = [self._get_pipeline(node)]\n else:\n pipelines = self.pipelines()\n\n for G in pipelines:\n for node in G.nodes():\n if G.in_degree(node) == 0:\n targets.append(os.path.join(self.root_dir, node))\n else:\n targets.append(target)\n\n ret = []\n with self.state:\n for target in targets:\n stages = _reproduce(\n self,\n target,\n recursive=recursive,\n force=force,\n dry=dry,\n interactive=interactive,\n ignore_build_cache=ignore_build_cache,\n no_commit=no_commit,\n )\n ret.extend(stages)\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/reproduce.py__reproduce__reproduce.return.ret": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/reproduce.py__reproduce__reproduce.return.ret", "embedding": null, "metadata": {"file_path": "dvc/repo/reproduce.py", "file_name": "reproduce.py", "file_type": "text/x-python", "category": "implementation", "start_line": 90, "end_line": 124, "span_ids": ["_reproduce"], "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 _reproduce(\n self,\n target,\n recursive=True,\n force=False,\n dry=False,\n interactive=False,\n ignore_build_cache=False,\n no_commit=False,\n):\n import networkx as nx\n from dvc.stage import Stage\n\n stage = Stage.load(self, target)\n G = self.graph()[1]\n stages = nx.get_node_attributes(G, \"stage\")\n node = os.path.relpath(stage.path, self.root_dir)\n\n if recursive:\n ret = _reproduce_stages(\n G,\n stages,\n node,\n force,\n dry,\n interactive,\n ignore_build_cache,\n no_commit,\n )\n else:\n ret = _reproduce_stage(\n stages, node, force, dry, interactive, no_commit\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/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": 127, "end_line": 151, "span_ids": ["_reproduce_stages"], "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 _reproduce_stages(\n G, stages, node, force, dry, interactive, ignore_build_cache, no_commit\n):\n import networkx as nx\n\n result = []\n for n in nx.dfs_postorder_nodes(G, node):\n try:\n ret = _reproduce_stage(\n stages, n, force, dry, interactive, no_commit\n )\n\n if len(ret) != 0 and ignore_build_cache:\n # NOTE: we are walking our pipeline from the top to the\n # bottom. If one stage is changed, it will be reproduced,\n # which tells us that we should force reproducing all of\n # the other stages down below, even if their direct\n # dependencies didn't change.\n force = True\n\n result += ret\n except Exception as ex:\n raise ReproductionError(stages[n].relpath, ex)\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/run.py_from___future___import_un_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/run.py_from___future___import_un_", "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": 74, "span_ids": ["imports", "run"], "tokens": 375}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 __future__ import unicode_literals\n\nfrom dvc.repo.scm_context import scm_context\n\n\n@scm_context\ndef run(\n self,\n cmd=None,\n deps=None,\n outs=None,\n outs_no_cache=None,\n metrics=None,\n metrics_no_cache=None,\n fname=None,\n cwd=None,\n wdir=None,\n no_exec=False,\n overwrite=False,\n ignore_build_cache=False,\n remove_outs=False,\n no_commit=False,\n outs_persist=None,\n outs_persist_no_cache=None,\n):\n from dvc.stage import Stage\n\n if outs is None:\n outs = []\n if deps is None:\n deps = []\n if outs_no_cache is None:\n outs_no_cache = []\n if metrics is None:\n metrics = []\n if metrics_no_cache is None:\n metrics_no_cache = []\n if outs_persist is None:\n outs_persist = []\n if outs_persist_no_cache is None:\n outs_persist_no_cache = []\n\n with self.state:\n stage = Stage.create(\n repo=self,\n fname=fname,\n cmd=cmd,\n cwd=cwd,\n wdir=wdir,\n outs=outs,\n outs_no_cache=outs_no_cache,\n metrics=metrics,\n metrics_no_cache=metrics_no_cache,\n deps=deps,\n overwrite=overwrite,\n ignore_build_cache=ignore_build_cache,\n remove_outs=remove_outs,\n outs_persist=outs_persist,\n outs_persist_no_cache=outs_persist_no_cache,\n )\n\n if stage is None:\n return None\n\n self.check_dag(self.stages() + [stage])\n\n with self.state:\n if not no_exec:\n stage.run(no_commit=no_commit)\n\n stage.dump()\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/status.py_from___future___import_un__local_status.return.status": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/status.py_from___future___import_un__local_status.return.status", "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": 22, "span_ids": ["imports", "_local_status"], "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": "from __future__ import unicode_literals\n\nimport dvc.logger as logger\n\n\ndef _local_status(self, target=None, with_deps=False):\n status = {}\n\n stages = self.collect(target, with_deps=with_deps)\n\n for stage in stages:\n if stage.locked:\n logger.warning(\n \"DVC file '{path}' is locked. Its dependencies are\"\n \" not going to be shown in the status output.\".format(\n path=stage.relpath\n )\n )\n\n status.update(stage.status())\n\n return 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/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": 28, "end_line": 64, "span_ids": ["_cloud_status"], "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 _cloud_status(\n self,\n target=None,\n jobs=1,\n remote=None,\n show_checksums=False,\n all_branches=False,\n with_deps=False,\n all_tags=False,\n):\n import dvc.remote.base as cloud\n\n used = self.used_cache(\n target,\n all_branches=all_branches,\n all_tags=all_tags,\n with_deps=with_deps,\n force=True,\n remote=remote,\n jobs=jobs,\n )[\"local\"]\n\n ret = {}\n status_info = self.cloud.status(\n used, jobs, remote=remote, show_checksums=show_checksums\n )\n for md5, info in status_info.items():\n name = info[\"name\"]\n status = info[\"status\"]\n if status == cloud.STATUS_OK:\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": 67, "end_line": 91, "span_ids": ["status"], "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 status(\n self,\n target=None,\n jobs=1,\n cloud=False,\n remote=None,\n show_checksums=False,\n all_branches=False,\n with_deps=False,\n all_tags=False,\n):\n with self.state:\n if cloud or remote:\n return _cloud_status(\n self,\n target,\n jobs,\n remote=remote,\n show_checksums=show_checksums,\n all_branches=all_branches,\n with_deps=with_deps,\n all_tags=all_tags,\n )\n return _local_status(self, target, with_deps=with_deps)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/__init__.py__Manages_source_control_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/__init__.py__Manages_source_control_", "embedding": null, "metadata": {"file_path": "dvc/scm/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 30, "span_ids": ["NoSCM", "SCM", "docstring"], "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": "\"\"\"Manages source control systems(e.g. Git).\"\"\"\n\nfrom __future__ import unicode_literals\n\nfrom dvc.scm.base import Base\nfrom dvc.scm.git import Git\n\n\n# just a sugar to point that this is an actual implementation for a dvc\n# project under no SCM control\nclass NoSCM(Base):\n pass\n\n\ndef SCM(root_dir, repo=None): # 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 repo (dvc.repo.Repo): dvc repo instance that root_dir belongs to.\n\n Returns:\n dvc.scm.base.Base: SCM instance.\n \"\"\"\n if Git.is_repo(root_dir) or Git.is_submodule(root_dir):\n return Git(root_dir, repo=repo)\n\n return NoSCM(root_dir, repo=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.py_from___future___import_un_MissingDataSource.__init__.super_MissingDataSource_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_from___future___import_un_MissingDataSource.__init__.super_MissingDataSource_", "embedding": null, "metadata": {"file_path": "dvc/stage.py", "file_name": "stage.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 110, "span_ids": ["StagePathOutsideError", "StagePathNotFoundError", "StagePathNotDirectoryError.__init__", "MissingDataSource.__init__", "StageFileDoesNotExistError.__init__", "MissingDep.__init__", "StageFileAlreadyExistsError", "StagePathNotDirectoryError", "StageFileIsNotDvcFileError", "StagePathOutsideError.__init__", "imports", "StageFileFormatError.__init__", "StageFileDoesNotExistError", "MissingDataSource", "StageCommitError", "StageFileBadNameError", "StageFileFormatError", "StagePathNotFoundError.__init__", "StageCmdFailedError", "StageFileAlreadyExistsError.__init__", "StageCmdFailedError.__init__", "StageFileIsNotDvcFileError.__init__", "MissingDep", "StageFileBadNameError.__init__"], "tokens": 788}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import unicode_literals\n\nfrom dvc.utils.compat import str, open\n\nimport re\nimport os\nimport yaml\nimport subprocess\n\nfrom dvc.utils.fs import contains_symlink_up_to\nfrom schema import Schema, SchemaError, Optional, Or, And\n\nimport dvc.prompt as prompt\nimport dvc.logger as logger\nimport dvc.dependency as dependency\nimport dvc.output as output\nfrom dvc.exceptions import DvcException\nfrom dvc.utils import dict_md5, fix_env, load_stage_file_fobj\n\n\nclass StageCmdFailedError(DvcException):\n def __init__(self, stage):\n msg = \"stage '{}' cmd {} failed\".format(stage.relpath, stage.cmd)\n super(StageCmdFailedError, self).__init__(msg)\n\n\nclass StageFileFormatError(DvcException):\n def __init__(self, fname, e):\n msg = \"stage file '{}' format error: {}\".format(fname, str(e))\n super(StageFileFormatError, self).__init__(msg)\n\n\nclass StageFileDoesNotExistError(DvcException):\n def __init__(self, fname):\n msg = \"'{}' does not exist.\".format(fname)\n\n sname = fname + Stage.STAGE_FILE_SUFFIX\n if Stage.is_stage_file(sname):\n msg += \" Do you mean '{}'?\".format(sname)\n\n super(StageFileDoesNotExistError, self).__init__(msg)\n\n\nclass StageFileAlreadyExistsError(DvcException):\n def __init__(self, relpath):\n msg = \"stage '{}' already exists\".format(relpath)\n super(StageFileAlreadyExistsError, self).__init__(msg)\n\n\nclass StageFileIsNotDvcFileError(DvcException):\n def __init__(self, fname):\n msg = \"'{}' is not a dvc file\".format(fname)\n\n sname = fname + Stage.STAGE_FILE_SUFFIX\n if Stage.is_stage_file(sname):\n msg += \" Do you mean '{}'?\".format(sname)\n\n super(StageFileIsNotDvcFileError, self).__init__(msg)\n\n\nclass StageFileBadNameError(DvcException):\n def __init__(self, msg):\n super(StageFileBadNameError, self).__init__(msg)\n\n\nclass StagePathOutsideError(DvcException):\n def __init__(self, path):\n msg = \"stage working or file path '{}' is outside of dvc repo\"\n super(StagePathOutsideError, self).__init__(msg.format(path))\n\n\nclass StagePathNotFoundError(DvcException):\n def __init__(self, path):\n msg = \"stage working or file path '{}' does not exist\"\n super(StagePathNotFoundError, self).__init__(msg.format(path))\n\n\nclass StagePathNotDirectoryError(DvcException):\n def __init__(self, path):\n msg = \"stage working or file path '{}' is not directory\"\n super(StagePathNotDirectoryError, self).__init__(msg.format(path))\n\n\nclass StageCommitError(DvcException):\n pass\n\n\nclass MissingDep(DvcException):\n def __init__(self, deps):\n assert len(deps) > 0\n\n if len(deps) > 1:\n dep = \"dependencies\"\n else:\n dep = \"dependency\"\n\n msg = \"missing {}: {}\".format(dep, \", \".join(map(str, deps)))\n super(MissingDep, self).__init__(msg)\n\n\nclass MissingDataSource(DvcException):\n def __init__(self, missing_files):\n assert len(missing_files) > 0\n\n source = \"source\"\n if len(missing_files) > 1:\n source += \"s\"\n\n msg = \"missing data {}: {}\".format(source, \", \".join(missing_files))\n super(MissingDataSource, self).__init__(msg)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage_Stage.is_import.return.not_self_cmd_and_len_self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage_Stage.is_import.return.not_self_cmd_and_len_self", "embedding": null, "metadata": {"file_path": "dvc/stage.py", "file_name": "stage.py", "file_type": "text/x-python", "category": "implementation", "start_line": 113, "end_line": 204, "span_ids": ["Stage.__init__", "Stage.is_stage_file", "Stage.changed_md5", "Stage.is_callback", "Stage.is_valid_filename", "Stage.is_data_source", "Stage.relpath", "Stage", "Stage.__repr__", "Stage.is_import"], "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": "class Stage(object):\n STAGE_FILE = \"Dvcfile\"\n STAGE_FILE_SUFFIX = \".dvc\"\n\n PARAM_MD5 = \"md5\"\n PARAM_CMD = \"cmd\"\n PARAM_WDIR = \"wdir\"\n PARAM_DEPS = \"deps\"\n PARAM_OUTS = \"outs\"\n PARAM_LOCKED = \"locked\"\n\n SCHEMA = {\n Optional(PARAM_MD5): Or(str, None),\n Optional(PARAM_CMD): Or(str, None),\n Optional(PARAM_WDIR): Or(str, None),\n Optional(PARAM_DEPS): Or(And(list, Schema([dependency.SCHEMA])), None),\n Optional(PARAM_OUTS): Or(And(list, Schema([output.SCHEMA])), None),\n Optional(PARAM_LOCKED): bool,\n }\n\n TAG_REGEX = r\"^(?P.*)@(?P[^\\\\/@:]*)$\"\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,\n tag=None,\n ):\n if deps is None:\n deps = []\n if outs is None:\n outs = []\n\n self.repo = repo\n self.path = path\n self.cmd = cmd\n self.wdir = wdir\n self.outs = outs\n self.deps = deps\n self.md5 = md5\n self.locked = locked\n self.tag = tag\n\n def __repr__(self):\n return \"Stage: '{path}'\".format(\n path=self.relpath if self.path else \"No path\"\n )\n\n @property\n def relpath(self):\n return os.path.relpath(self.path)\n\n @property\n def is_data_source(self):\n \"\"\"Whether the stage file was created with `dvc add` or `dvc import`\"\"\"\n return self.cmd is None\n\n @staticmethod\n def is_valid_filename(path):\n return (\n # path.endswith doesn't work for encoded unicode filenames on\n # Python 2 and since Stage.STAGE_FILE_SUFFIX is ascii then it is\n # not needed to decode the path from py2's str\n path[-len(Stage.STAGE_FILE_SUFFIX) :] == Stage.STAGE_FILE_SUFFIX\n or os.path.basename(path) == Stage.STAGE_FILE\n )\n\n @staticmethod\n def is_stage_file(path):\n return os.path.isfile(path) and Stage.is_valid_filename(path)\n\n def changed_md5(self):\n return self.md5 != self._compute_md5()\n\n @property\n def is_callback(self):\n \"\"\"\n A callback stage is always considered as changed,\n so it runs on every `dvc repro` call.\n \"\"\"\n return not self.is_data_source and len(self.deps) == 0\n\n @property\n def is_import(self):\n \"\"\"Whether the stage file was created with `dvc import`.\"\"\"\n return not self.cmd and len(self.deps) == 1 and len(self.outs) == 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.py_Stage._changed_deps_Stage._changed_deps.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage._changed_deps_Stage._changed_deps.return.False", "embedding": null, "metadata": {"file_path": "dvc/stage.py", "file_name": "stage.py", "file_type": "text/x-python", "category": "implementation", "start_line": 206, "end_line": 229, "span_ids": ["Stage._changed_deps"], "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 Stage(object):\n\n def _changed_deps(self):\n if self.locked:\n return False\n\n if self.is_callback:\n logger.warning(\n \"Dvc file '{fname}' is a 'callback' stage \"\n \"(has a command and no dependencies) and thus always \"\n \"considered as changed.\".format(fname=self.relpath)\n )\n return True\n\n for dep in self.deps:\n status = dep.status()\n if status:\n logger.warning(\n \"Dependency '{dep}' of '{stage}' changed because it is \"\n \"'{status}'.\".format(\n dep=dep, stage=self.relpath, status=status[str(dep)]\n )\n )\n return True\n\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage._changed_outs_Stage.remove.os_unlink_self_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage._changed_outs_Stage.remove.os_unlink_self_path_", "embedding": null, "metadata": {"file_path": "dvc/stage.py", "file_name": "stage.py", "file_type": "text/x-python", "category": "implementation", "start_line": 231, "end_line": 286, "span_ids": ["Stage.remove_outs", "Stage._changed_md5", "Stage.unprotect_outs", "Stage.remove", "Stage.changed", "Stage._changed_outs"], "tokens": 360}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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(object):\n\n def _changed_outs(self):\n for out in self.outs:\n status = out.status()\n if status:\n logger.warning(\n \"Output '{out}' of '{stage}' changed because it is \"\n \"'{status}'\".format(\n out=out, stage=self.relpath, status=status[str(out)]\n )\n )\n return True\n\n return False\n\n def _changed_md5(self):\n if self.changed_md5():\n logger.warning(\"Dvc file '{}' changed.\".format(self.relpath))\n return True\n return False\n\n def changed(self):\n ret = any(\n [self._changed_deps(), self._changed_outs(), self._changed_md5()]\n )\n\n if ret:\n msg = \"Stage '{}' changed.\".format(self.relpath)\n color = \"yellow\"\n else:\n msg = \"Stage '{}' didn't change.\".format(self.relpath)\n color = \"green\"\n\n logger.info(logger.colorize(msg, color))\n\n return ret\n\n def remove_outs(self, ignore_remove=False, force=False):\n \"\"\"Used mainly for `dvc remove --outs` and :func:`Stage.reproduce`.\"\"\"\n for out in self.outs:\n if out.persist and not force:\n out.unprotect()\n else:\n logger.debug(\n \"Removing output '{out}' of '{stage}'.\".format(\n out=out, stage=self.relpath\n )\n )\n out.remove(ignore_remove=ignore_remove)\n\n def unprotect_outs(self):\n for out in self.outs:\n out.unprotect()\n\n def remove(self, force=False):\n self.remove_outs(ignore_remove=True, force=force)\n os.unlink(self.path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage.reproduce_Stage.reproduce.return.self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage.reproduce_Stage.reproduce.return.self", "embedding": null, "metadata": {"file_path": "dvc/stage.py", "file_name": "stage.py", "file_type": "text/x-python", "category": "implementation", "start_line": 288, "end_line": 308, "span_ids": ["Stage.reproduce"], "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 Stage(object):\n\n def reproduce(\n self, force=False, dry=False, interactive=False, no_commit=False\n ):\n if not self.changed() and not force:\n return None\n\n msg = (\n \"Going to reproduce '{stage}'. \"\n \"Are you sure you want to continue?\".format(stage=self.relpath)\n )\n\n if interactive and not prompt.confirm(msg):\n raise DvcException(\"reproduction aborted by the user\")\n\n logger.info(\"Reproducing '{stage}'\".format(stage=self.relpath))\n\n self.run(dry=dry, no_commit=no_commit, force=force)\n\n logger.debug(\"'{stage}' was reproduced\".format(stage=self.relpath))\n\n return 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.py_Stage.is_cached_Stage.is_cached.return.old_d_new_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage.is_cached_Stage.is_cached.return.old_d_new_d", "embedding": null, "metadata": {"file_path": "dvc/stage.py", "file_name": "stage.py", "file_type": "text/x-python", "category": "implementation", "start_line": 332, "end_line": 361, "span_ids": ["Stage.is_cached"], "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 Stage(object):\n\n @property\n def is_cached(self):\n \"\"\"\n Checks if this stage has been already ran and stored\n \"\"\"\n from dvc.remote.local import RemoteLOCAL\n from dvc.remote.s3 import RemoteS3\n\n old = Stage.load(self.repo, self.path)\n if old._changed_outs():\n return False\n\n # NOTE: need to save checksums for deps in order to compare them\n # with what is written in the old stage.\n for dep in self.deps:\n dep.save()\n\n old_d = old.dumpd()\n new_d = self.dumpd()\n\n # NOTE: need to remove checksums from old dict in order to compare\n # it to the new one, since the new one doesn't have checksums yet.\n old_d.pop(self.PARAM_MD5, None)\n new_d.pop(self.PARAM_MD5, None)\n outs = old_d.get(self.PARAM_OUTS, [])\n for out in outs:\n out.pop(RemoteLOCAL.PARAM_CHECKSUM, None)\n out.pop(RemoteS3.PARAM_CHECKSUM, None)\n\n 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.py_Stage.create_Stage.create.return.stage": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage.create_Stage.create.return.stage", "embedding": null, "metadata": {"file_path": "dvc/stage.py", "file_name": "stage.py", "file_type": "text/x-python", "category": "implementation", "start_line": 394, "end_line": 497, "span_ids": ["Stage.create"], "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": "class Stage(object):\n\n @staticmethod\n def create(\n repo=None,\n cmd=None,\n deps=None,\n outs=None,\n outs_no_cache=None,\n metrics=None,\n metrics_no_cache=None,\n fname=None,\n cwd=None,\n wdir=None,\n locked=False,\n add=False,\n overwrite=True,\n ignore_build_cache=False,\n remove_outs=False,\n validate_state=True,\n outs_persist=None,\n outs_persist_no_cache=None,\n ):\n if outs is None:\n outs = []\n if deps is None:\n deps = []\n if outs_no_cache is None:\n outs_no_cache = []\n if metrics is None:\n metrics = []\n if metrics_no_cache is None:\n metrics_no_cache = []\n if outs_persist is None:\n outs_persist = []\n if outs_persist_no_cache is None:\n outs_persist_no_cache = []\n\n # Backward compatibility for `cwd` option\n if wdir is None and cwd is not None:\n if fname is not None and os.path.basename(fname) != fname:\n raise StageFileBadNameError(\n \"stage file name '{fname}' may not contain subdirectories\"\n \" if '-c|--cwd' (deprecated) is specified. Use '-w|--wdir'\"\n \" along with '-f' to specify stage file path and working\"\n \" directory.\".format(fname=fname)\n )\n wdir = cwd\n else:\n wdir = os.curdir if wdir is None else wdir\n\n stage = Stage(repo=repo, wdir=wdir, cmd=cmd, locked=locked)\n\n Stage._fill_stage_outputs(\n stage,\n outs,\n outs_no_cache,\n metrics,\n metrics_no_cache,\n outs_persist,\n outs_persist_no_cache,\n )\n stage.deps = dependency.loads_from(stage, deps)\n\n stage._check_circular_dependency()\n stage._check_duplicated_arguments()\n\n fname = Stage._stage_fname(fname, stage.outs, add=add)\n wdir = os.path.abspath(wdir)\n\n if cwd is not None:\n path = os.path.join(wdir, fname)\n else:\n path = os.path.abspath(fname)\n\n Stage._check_stage_path(repo, wdir)\n Stage._check_stage_path(repo, os.path.dirname(path))\n\n stage.wdir = wdir\n stage.path = path\n\n # NOTE: remove outs before we check build cache\n if remove_outs:\n stage.remove_outs(ignore_remove=False)\n logger.warning(\"Build cache is ignored when using --remove-outs.\")\n ignore_build_cache = True\n else:\n stage.unprotect_outs()\n\n if validate_state:\n if os.path.exists(path):\n if not ignore_build_cache and stage.is_cached:\n logger.info(\"Stage is cached, skipping.\")\n return None\n\n msg = (\n \"'{}' already exists. Do you wish to run the command and \"\n \"overwrite it?\".format(stage.relpath)\n )\n\n if not overwrite and not prompt.confirm(msg):\n raise StageFileAlreadyExistsError(stage.relpath)\n\n os.unlink(path)\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.py_Stage.load_Stage.load.return.stage": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage.load_Stage.load.return.stage", "embedding": null, "metadata": {"file_path": "dvc/stage.py", "file_name": "stage.py", "file_type": "text/x-python", "category": "implementation", "start_line": 552, "end_line": 586, "span_ids": ["Stage.load"], "tokens": 269}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Stage(object):\n\n @staticmethod\n def load(repo, fname):\n fname, tag = Stage._get_path_tag(fname)\n\n # it raises the proper exceptions by priority:\n # 1. when the file doesn't exists\n # 2. filename is not a dvc filename\n # 3. path doesn't represent a regular file\n Stage._check_file_exists(repo, fname)\n Stage._check_dvc_filename(fname)\n Stage._check_isfile(repo, fname)\n\n d = load_stage_file_fobj(repo.tree.open(fname), fname)\n\n Stage.validate(d, fname=os.path.relpath(fname))\n path = os.path.abspath(fname)\n\n stage = Stage(\n repo=repo,\n path=path,\n wdir=os.path.abspath(\n os.path.join(\n os.path.dirname(path), d.get(Stage.PARAM_WDIR, \".\")\n )\n ),\n cmd=d.get(Stage.PARAM_CMD),\n md5=d.get(Stage.PARAM_MD5),\n locked=d.get(Stage.PARAM_LOCKED, False),\n tag=tag,\n )\n\n stage.deps = dependency.loadd_from(stage, d.get(Stage.PARAM_DEPS, []))\n stage.outs = output.loadd_from(stage, d.get(Stage.PARAM_OUTS, []))\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.py_Stage.save_Stage.check_can_commit.if_changed_deps_or_change.self_save_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage.save_Stage.check_can_commit.if_changed_deps_or_change.self_save_", "embedding": null, "metadata": {"file_path": "dvc/stage.py", "file_name": "stage.py", "file_type": "text/x-python", "category": "implementation", "start_line": 563, "end_line": 599, "span_ids": ["Stage.save", "Stage.check_can_commit", "Stage._changed_entries"], "tokens": 281}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Stage(object):\n\n def save(self):\n for dep in self.deps:\n dep.save()\n\n for out in self.outs:\n out.save()\n\n self.md5 = self._compute_md5()\n\n @staticmethod\n def _changed_entries(entries):\n ret = []\n for entry in entries:\n if entry.checksum and entry.changed_checksum():\n ret.append(entry.rel_path)\n return ret\n\n def check_can_commit(self, force):\n changed_deps = self._changed_entries(self.deps)\n changed_outs = self._changed_entries(self.outs)\n\n if changed_deps or changed_outs or self.changed_md5():\n msg = (\n \"dependencies {}\".format(changed_deps) if changed_deps else \"\"\n )\n msg += \" and \" if (changed_deps and changed_outs) else \"\"\n msg += \"outputs {}\".format(changed_outs) if changed_outs else \"\"\n msg += \"md5\" if not (changed_deps or changed_outs) else \"\"\n msg += \" of '{}' changed. Are you sure you commit it?\".format(\n self.relpath\n )\n if not force and not prompt.confirm(msg):\n raise StageCommitError(\n \"unable to commit changed '{}'. Use `-f|--force` to \"\n \"force.`\".format(self.relpath)\n )\n self.save()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage.commit_Stage._warn_if_fish.logger_warning_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage.commit_Stage._warn_if_fish.logger_warning_", "embedding": null, "metadata": {"file_path": "dvc/stage.py", "file_name": "stage.py", "file_type": "text/x-python", "category": "implementation", "start_line": 601, "end_line": 625, "span_ids": ["Stage._warn_if_fish", "Stage.commit", "Stage._check_missing_deps"], "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 Stage(object):\n\n def commit(self):\n for out in self.outs:\n out.commit()\n\n def _check_missing_deps(self):\n missing = [dep for dep in self.deps if not dep.exists]\n\n if any(missing):\n raise MissingDep(missing)\n\n @staticmethod\n def _warn_if_fish(executable): # pragma: no cover\n if (\n executable is None\n or os.path.basename(os.path.realpath(executable)) != \"fish\"\n ):\n return\n\n logger.warning(\n \"DVC detected that you are using fish as your default \"\n \"shell. Be aware that it might cause problems by overwriting \"\n \"your current environment variables with values defined \"\n \"in '.fishrc', which might affect your command. See \"\n \"https://github.com/iterative/dvc/issues/1307. \"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage._check_circular_dependency_Stage._run.if_p_returncode_0_.raise_StageCmdFailedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage._check_circular_dependency_Stage._run.if_p_returncode_0_.raise_StageCmdFailedError", "embedding": null, "metadata": {"file_path": "dvc/stage.py", "file_name": "stage.py", "file_type": "text/x-python", "category": "implementation", "start_line": 627, "end_line": 662, "span_ids": ["Stage._check_circular_dependency", "Stage._check_duplicated_arguments", "Stage._run"], "tokens": 235}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Stage(object):\n\n def _check_circular_dependency(self):\n from dvc.exceptions import CircularDependencyError\n\n circular_dependencies = set(d.path for d in self.deps) & set(\n o.path for o in self.outs\n )\n\n if circular_dependencies:\n raise CircularDependencyError(circular_dependencies.pop())\n\n def _check_duplicated_arguments(self):\n from dvc.exceptions import ArgumentDuplicationError\n from collections import Counter\n\n path_counts = Counter(edge.path for edge in self.deps + self.outs)\n\n for path, occurrence in path_counts.items():\n if occurrence > 1:\n raise ArgumentDuplicationError(path)\n\n def _run(self):\n self._check_missing_deps()\n executable = os.getenv(\"SHELL\") if os.name != \"nt\" else None\n self._warn_if_fish(executable)\n\n p = subprocess.Popen(\n self.cmd,\n cwd=self.wdir,\n shell=True,\n env=fix_env(os.environ),\n executable=executable,\n )\n p.communicate()\n\n if p.returncode != 0:\n raise StageCmdFailedError(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.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.py_Stage.run_Stage.run.if_not_dry_.if_not_no_commit_.self_commit_", "embedding": null, "metadata": {"file_path": "dvc/stage.py", "file_name": "stage.py", "file_type": "text/x-python", "category": "implementation", "start_line": 754, "end_line": 802, "span_ids": ["Stage.run"], "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 Stage(object):\n\n def run(self, dry=False, resume=False, no_commit=False, force=False):\n if (self.cmd or self.is_import) and not self.locked and not dry:\n self.remove_outs(ignore_remove=False, force=False)\n\n if self.locked:\n logger.info(\n \"Verifying outputs in locked stage '{stage}'\".format(\n stage=self.relpath\n )\n )\n if not dry:\n self.check_missing_outputs()\n\n elif self.is_import:\n logger.info(\n \"Importing '{dep}' -> '{out}'\".format(\n dep=self.deps[0].path, out=self.outs[0].path\n )\n )\n if not dry:\n if self._already_cached() and not force:\n self.outs[0].checkout()\n else:\n self.deps[0].download(\n self.outs[0].path_info, resume=resume\n )\n\n elif self.is_data_source:\n msg = \"Verifying data sources in '{}'\".format(self.relpath)\n logger.info(msg)\n if not dry:\n self.check_missing_outputs()\n\n else:\n logger.info(\"Running command:\\n\\t{}\".format(self.cmd))\n if not dry:\n if (\n not force\n and not self.is_callback\n and self._already_cached()\n ):\n self.checkout()\n else:\n self._run()\n\n if not dry:\n self.save()\n if not no_commit:\n self.commit()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage.check_missing_outputs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage.check_missing_outputs_", "embedding": null, "metadata": {"file_path": "dvc/stage.py", "file_name": "stage.py", "file_type": "text/x-python", "category": "implementation", "start_line": 804, "end_line": 864, "span_ids": ["Stage.status", "Stage.check_missing_outputs", "Stage.checkout", "Stage.get_all_files_number", "Stage._status", "Stage._already_cached"], "tokens": 324}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Stage(object):\n\n def check_missing_outputs(self):\n paths = [\n out.path if out.scheme != \"local\" else out.rel_path\n for out in self.outs\n if not out.exists\n ]\n\n if paths:\n raise MissingDataSource(paths)\n\n def checkout(self, force=False, progress_callback=None):\n for out in self.outs:\n out.checkout(\n force=force, tag=self.tag, progress_callback=progress_callback\n )\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(self):\n ret = []\n\n if not self.locked:\n deps_status = self._status(self.deps)\n if deps_status:\n ret.append({\"changed deps\": deps_status})\n\n outs_status = self._status(self.outs)\n if outs_status:\n ret.append({\"changed outs\": outs_status})\n\n if self.changed_md5():\n ret.append(\"changed checksum\")\n\n if self.is_callback:\n ret.append(\"always changed\")\n\n if ret:\n return {self.relpath: ret}\n\n return {}\n\n def _already_cached(self):\n return (\n not self.changed_md5()\n and all(not dep.changed() for dep in self.deps)\n and all(\n not out.changed_cache() if out.use_cache else not out.changed()\n for out in self.outs\n )\n )\n\n def get_all_files_number(self):\n return sum(out.get_files_number() for out in self.outs)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py__Manages_state_database__file_metadata_changed.return.actual_mtime_mtime_or_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py__Manages_state_database__file_metadata_changed.return.actual_mtime_mtime_or_", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 30, "span_ids": ["StateVersionTooNewError", "_file_metadata_changed", "StateVersionTooNewError.__init__", "docstring"], "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": "\"\"\"Manages state database used for checksum caching.\"\"\"\n\nfrom __future__ import unicode_literals\n\nimport os\nimport sqlite3\n\nimport dvc.logger as logger\nfrom dvc.config import Config\nfrom dvc.utils import file_md5, remove, current_timestamp\nfrom dvc.exceptions import DvcException\nfrom dvc.utils.fs import get_mtime_and_size, get_inode\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(StateVersionTooNewError, self).__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\ndef _file_metadata_changed(actual_mtime, mtime, actual_size, size):\n return actual_mtime != mtime or actual_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/dvc/state.py_State_State._collect.return._file_md5_path_0_None_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State_State._collect.return._file_md5_path_0_None_", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 33, "end_line": 115, "span_ids": ["State.__exit__", "State._collect", "State.__enter__", "State", "State.__init__"], "tokens": 546}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State(object): # pylint: disable=too-many-instance-attributes\n \"\"\"Class for the state database.\n\n Args:\n repo (dvc.repo.Repo): repo instance that this state belongs to.\n config (configobj.ConfigObj): config for the state.\n\n Raises:\n StateVersionTooNewError: thrown when dvc version is older than the\n state database version.\n \"\"\"\n\n VERSION = 3\n STATE_FILE = \"state\"\n STATE_TABLE = \"state\"\n STATE_TABLE_LAYOUT = (\n \"inode INTEGER PRIMARY KEY, \"\n \"mtime TEXT NOT NULL, \"\n \"size TEXT NOT NULL, \"\n \"md5 TEXT NOT NULL, \"\n \"timestamp TEXT NOT NULL\"\n )\n\n STATE_INFO_TABLE = \"state_info\"\n STATE_INFO_TABLE_LAYOUT = \"count INTEGER\"\n STATE_INFO_ROW = 1\n\n LINK_STATE_TABLE = \"link_state\"\n LINK_STATE_TABLE_LAYOUT = (\n \"path TEXT PRIMARY KEY, \"\n \"inode INTEGER NOT NULL, \"\n \"mtime TEXT NOT NULL\"\n )\n\n STATE_ROW_LIMIT = 100000000\n STATE_ROW_CLEANUP_QUOTA = 50\n\n MAX_INT = 2 ** 63 - 1\n MAX_UINT = 2 ** 64 - 2\n\n def __init__(self, repo, config):\n self.repo = repo\n self.dvc_dir = repo.dvc_dir\n self.root_dir = repo.root_dir\n\n self.row_limit = 100\n self.row_cleanup_quota = 50\n\n state_config = config.get(Config.SECTION_STATE, {})\n self.row_limit = state_config.get(\n Config.SECTION_STATE_ROW_LIMIT, self.STATE_ROW_LIMIT\n )\n self.row_cleanup_quota = state_config.get(\n Config.SECTION_STATE_ROW_CLEANUP_QUOTA,\n self.STATE_ROW_CLEANUP_QUOTA,\n )\n\n if not self.dvc_dir:\n self.state_file = None\n return\n\n self.state_file = os.path.join(self.dvc_dir, self.STATE_FILE)\n\n # https://www.sqlite.org/tempfiles.html\n self.temp_files = [\n self.state_file + \"-journal\",\n self.state_file + \"-wal\",\n ]\n\n self.database = None\n self.cursor = None\n self.inserts = 0\n\n def __enter__(self):\n self.load()\n\n def __exit__(self, typ, value, tbck):\n self.dump()\n\n def _collect(self, path):\n if os.path.isdir(path):\n return self.repo.cache.local.collect_dir_cache(path)\n return (file_md5(path)[0], 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.changed_State.changed.return.actual_split_0_m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.changed_State.changed.return.actual_split_0_m", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 117, "end_line": 135, "span_ids": ["State.changed"], "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 State(object):\n\n def changed(self, path, md5):\n \"\"\"Check if file/directory has the expected md5.\n\n Args:\n path (str): path to the file/directory to check.\n md5 (str): expected md5.\n\n Returns:\n bool: True if path has the expected md5, False otherwise.\n \"\"\"\n actual = self.update(path)\n\n msg = \"File '{}', md5 '{}', actual '{}'\"\n logger.debug(msg.format(path, md5, actual))\n\n if not md5 or not actual:\n return True\n\n return actual.split(\".\")[0] != md5.split(\".\")[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/state.py_State._execute_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._execute_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": 137, "end_line": 164, "span_ids": ["State._fetchall", "State._to_sqlite", "State._execute", "State._from_sqlite"], "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 State(object):\n\n def _execute(self, cmd):\n logger.debug(cmd)\n return self.cursor.execute(cmd)\n\n def _fetchall(self):\n ret = self.cursor.fetchall()\n logger.debug(\"fetched: {}\".format(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/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": 166, "end_line": 208, "span_ids": ["State._prepare_db"], "tokens": 350}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State(object):\n\n def _prepare_db(self, empty=False):\n from dvc import VERSION\n\n if not empty:\n cmd = \"PRAGMA user_version;\"\n self._execute(cmd)\n ret = self._fetchall()\n assert len(ret) == 1\n assert len(ret[0]) == 1\n assert isinstance(ret[0][0], int)\n version = ret[0][0]\n\n if version > self.VERSION:\n raise StateVersionTooNewError(VERSION, self.VERSION, version)\n elif version < self.VERSION:\n msg = (\n \"State file version '{}' is too old. \"\n \"Reformatting to the current version '{}'.\"\n )\n logger.warning(msg.format(version, self.VERSION))\n cmd = \"DROP TABLE IF EXISTS {};\"\n self._execute(cmd.format(self.STATE_TABLE))\n self._execute(cmd.format(self.STATE_INFO_TABLE))\n self._execute(cmd.format(self.LINK_STATE_TABLE))\n\n # Check that the state file is indeed a database\n cmd = \"CREATE TABLE IF NOT EXISTS {} ({})\"\n self._execute(cmd.format(self.STATE_TABLE, self.STATE_TABLE_LAYOUT))\n self._execute(\n cmd.format(self.STATE_INFO_TABLE, self.STATE_INFO_TABLE_LAYOUT)\n )\n self._execute(\n cmd.format(self.LINK_STATE_TABLE, self.LINK_STATE_TABLE_LAYOUT)\n )\n\n cmd = (\n \"INSERT OR IGNORE INTO {} (count) SELECT 0 \"\n \"WHERE NOT EXISTS (SELECT * FROM {})\"\n )\n self._execute(cmd.format(self.STATE_INFO_TABLE, self.STATE_INFO_TABLE))\n\n cmd = \"PRAGMA user_version = {};\"\n self._execute(cmd.format(self.VERSION))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.load_State._vacuum.self.database.isolation_level_1._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.load_State._vacuum.self.database.isolation_level_1._", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 210, "end_line": 242, "span_ids": ["State.load", "State._vacuum"], "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 State(object):\n\n def load(self):\n \"\"\"Loads state database.\"\"\"\n retries = 1\n while True:\n assert self.database is None\n assert self.cursor is None\n assert self.inserts == 0\n empty = not os.path.exists(self.state_file)\n self.database = sqlite3.connect(self.state_file)\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": 244, "end_line": 295, "span_ids": ["State.dump"], "tokens": 360}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State(object):\n\n def dump(self):\n \"\"\"Saves state database.\"\"\"\n assert self.database is not None\n\n cmd = \"SELECT count from {} WHERE rowid={}\"\n self._execute(cmd.format(self.STATE_INFO_TABLE, 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 = {}\"\n self._execute(\n cmd.format(\n self.STATE_INFO_TABLE,\n self._to_sqlite(count),\n self.STATE_INFO_ROW,\n )\n )\n\n self._update_cache_directory_state()\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/state.py_State._do_update_State._do_update.return.md5_info": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State._do_update_State._do_update.return.md5_info", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 297, "end_line": 323, "span_ids": ["State._do_update"], "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 State(object):\n\n def _do_update(self, path, known_checksum=None):\n \"\"\"\n Make sure the stored info for the given path is up to date.\n \"\"\"\n if not os.path.exists(path):\n return None, None\n\n actual_mtime, actual_size = get_mtime_and_size(path)\n actual_inode = get_inode(path)\n\n existing_record = self.get_state_record_for_inode(actual_inode)\n\n if existing_record:\n md5, info = self._update_existing_state_record(\n path,\n actual_inode,\n actual_mtime,\n actual_size,\n existing_record,\n known_checksum,\n )\n else:\n md5, info = self._insert_new_state_record(\n path, actual_inode, actual_mtime, actual_size, known_checksum\n )\n\n return md5, 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/state.py_State._update_existing_state_record_State._update_state_record_timestamp_for_inode.self__execute_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State._update_existing_state_record_State._update_state_record_timestamp_for_inode.self__execute_", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 325, "end_line": 353, "span_ids": ["State._update_state_record_timestamp_for_inode", "State._update_existing_state_record"], "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 State(object):\n\n def _update_existing_state_record(\n self,\n path,\n actual_inode,\n actual_mtime,\n actual_size,\n existing_record,\n known_checksum=None,\n ):\n\n mtime, size, md5, _ = existing_record\n if _file_metadata_changed(actual_mtime, mtime, actual_size, size):\n md5, info = self._update_state_for_path_changed(\n path, actual_inode, actual_mtime, actual_size, known_checksum\n )\n else:\n info = None\n self._update_state_record_timestamp_for_inode(actual_inode)\n return md5, info\n\n def _update_state_record_timestamp_for_inode(self, actual_inode):\n cmd = 'UPDATE {} SET timestamp = \"{}\" WHERE inode = {}'\n self._execute(\n cmd.format(\n self.STATE_TABLE,\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._update_state_for_path_changed_State._update_state_for_path_changed.return.md5_info": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State._update_state_for_path_changed_State._update_state_for_path_changed.return.md5_info", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 355, "end_line": 383, "span_ids": ["State._update_state_for_path_changed"], "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 State(object):\n\n def _update_state_for_path_changed(\n self,\n path,\n actual_inode,\n actual_mtime,\n actual_size,\n known_checksum=None,\n ):\n if known_checksum:\n md5, info = known_checksum, None\n else:\n md5, info = self._collect(path)\n cmd = (\n \"UPDATE {} SET \"\n 'mtime = \"{}\", size = \"{}\", '\n 'md5 = \"{}\", timestamp = \"{}\" '\n \"WHERE inode = {}\"\n )\n self._execute(\n cmd.format(\n self.STATE_TABLE,\n actual_mtime,\n actual_size,\n md5,\n current_timestamp(),\n self._to_sqlite(actual_inode),\n )\n )\n return md5, 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/state.py_State._insert_new_state_record_State._insert_new_state_record.return.md5_info": {"__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._insert_new_state_record.return.md5_info", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 385, "end_line": 407, "span_ids": ["State._insert_new_state_record"], "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 State(object):\n\n def _insert_new_state_record(\n self, path, actual_inode, actual_mtime, actual_size, known_checksum\n ):\n if known_checksum:\n md5, info = known_checksum, None\n else:\n md5, info = self._collect(path)\n cmd = (\n \"INSERT INTO {}(inode, mtime, size, md5, timestamp) \"\n 'VALUES ({}, \"{}\", \"{}\", \"{}\", \"{}\")'\n )\n self._execute(\n cmd.format(\n self.STATE_TABLE,\n self._to_sqlite(actual_inode),\n actual_mtime,\n actual_size,\n md5,\n current_timestamp(),\n )\n )\n self.inserts += 1\n return md5, 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/state.py_State.get_state_record_for_inode_State.update.return.self__do_update_path_kno": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.get_state_record_for_inode_State.update.return.self__do_update_path_kno", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 409, "end_line": 431, "span_ids": ["State.get_state_record_for_inode", "State.update"], "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 State(object):\n\n def get_state_record_for_inode(self, inode):\n cmd = \"SELECT mtime, size, md5, timestamp from {} \" \"WHERE inode={}\"\n cmd = cmd.format(self.STATE_TABLE, self._to_sqlite(inode))\n self._execute(cmd)\n results = self._fetchall()\n if results:\n # uniquness constrain on inode\n assert len(results) == 1\n return results[0]\n return None\n\n def update(self, path, known_checksum=None):\n \"\"\"Gets the checksum for the specified path. Checksum will be\n retrieved from the state database if available, otherwise it will be\n computed and cached in the state database for the further use.\n\n Args:\n path (str): path to get the checksum for.\n\n Returns:\n str: checksum for the specified path.\n \"\"\"\n return self._do_update(path, known_checksum)[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/state.py_State.update_info_State.update_info.return._md5_info_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.update_info_State.update_info.return._md5_info_", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 433, "end_line": 448, "span_ids": ["State.update_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": "class State(object):\n\n def update_info(self, path):\n \"\"\"Gets the checksum and the directory info (if applicable) for the\n specified path.\n\n Args:\n path (str): path to get the checksum and the directory info for.\n\n Returns:\n tuple: checksum for the specified path along with a directory info\n (list of {relative_path: checksum} entries for each file in the\n directory) if applicable, otherwise None.\n \"\"\"\n md5, info = self._do_update(path)\n if not info:\n info = self.repo.cache.local.load_dir_cache(md5)\n return (md5, 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/state.py_State.update_link_State.update_link.self__execute_cmd_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.update_link_State.update_link.self__execute_cmd_", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 450, "end_line": 470, "span_ids": ["State.update_link"], "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 State(object):\n\n def update_link(self, path):\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 (str): path to add to the list of links.\n \"\"\"\n if not os.path.exists(path):\n return\n\n mtime, _ = get_mtime_and_size(path)\n inode = get_inode(path)\n relpath = os.path.relpath(path, self.root_dir)\n\n cmd = (\n \"REPLACE INTO {}(path, inode, mtime) \"\n 'VALUES (\"{}\", {}, \"{}\")'.format(\n self.LINK_STATE_TABLE, relpath, self._to_sqlite(inode), mtime\n )\n )\n self._execute(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/state.py_State.remove_unused_links_State.remove_unused_links.for_relpath_in_unused_.self__execute_cmd_format_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.remove_unused_links_State.remove_unused_links.for_relpath_in_unused_.self__execute_cmd_format_", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 472, "end_line": 502, "span_ids": ["State.remove_unused_links"], "tokens": 218}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State(object):\n\n def remove_unused_links(self, used):\n \"\"\"Removes all saved links except the ones that are used.\n\n Args:\n used (list): list of used links that should not be removed.\n \"\"\"\n unused = []\n\n self._execute(\"SELECT * FROM {}\".format(self.LINK_STATE_TABLE))\n for row in self.cursor:\n relpath, inode, mtime = row\n inode = self._from_sqlite(inode)\n path = os.path.join(self.root_dir, relpath)\n\n if path in used:\n continue\n\n if not os.path.exists(path):\n continue\n\n actual_inode = get_inode(path)\n actual_mtime, _ = get_mtime_and_size(path)\n\n if inode == actual_inode and mtime == actual_mtime:\n logger.debug(\"Removing '{}' as unused link.\".format(path))\n remove(path)\n unused.append(relpath)\n\n for relpath in unused:\n cmd = 'DELETE FROM {} WHERE path = \"{}\"'\n self._execute(cmd.format(self.LINK_STATE_TABLE, 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/state.py_State._update_cache_directory_state_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State._update_cache_directory_state_", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 504, "end_line": 520, "span_ids": ["State._update_cache_directory_state"], "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 State(object):\n\n def _update_cache_directory_state(self):\n cache_path = self.repo.cache.local.cache_dir\n mtime, size = get_mtime_and_size(cache_path)\n inode = get_inode(cache_path)\n\n cmd = (\n \"INSERT OR REPLACE INTO {}(inode, size, mtime, timestamp, md5) \"\n 'VALUES ({}, \"{}\", \"{}\", \"{}\", \"\")'.format(\n self.STATE_TABLE,\n self._to_sqlite(inode),\n size,\n mtime,\n current_timestamp(),\n )\n )\n self._execute(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/system.py_from___future___import_un_System.hardlink.if_res_0_.raise_DvcException_Creat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_from___future___import_un_System.hardlink.if_res_0_.raise_DvcException_Creat", "embedding": null, "metadata": {"file_path": "dvc/system.py", "file_name": "system.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 35, "span_ids": ["imports", "System.hardlink", "System.is_unix", "System"], "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": "from __future__ import unicode_literals\n\nfrom dvc.utils.compat import str, open\n\nimport os\n\n\nclass System(object):\n @staticmethod\n def is_unix():\n return os.name != \"nt\"\n\n @staticmethod\n def hardlink(source, link_name):\n import ctypes\n from dvc.exceptions import DvcException\n\n if System.is_unix():\n try:\n os.link(source, link_name)\n return\n except Exception as exc:\n raise DvcException(\"link\", cause=exc)\n\n CreateHardLink = ctypes.windll.kernel32.CreateHardLinkW\n CreateHardLink.argtypes = [\n ctypes.c_wchar_p,\n ctypes.c_wchar_p,\n ctypes.c_void_p,\n ]\n CreateHardLink.restype = ctypes.wintypes.BOOL\n\n res = CreateHardLink(link_name, source, None)\n if res == 0:\n raise DvcException(\"CreateHardLinkW\", cause=ctypes.WinError())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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.symlink_System.symlink.if_func_link_name_source.raise_DvcException_Creat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System.symlink_System.symlink.if_func_link_name_source.raise_DvcException_Creat", "embedding": null, "metadata": {"file_path": "dvc/system.py", "file_name": "system.py", "file_type": "text/x-python", "category": "implementation", "start_line": 37, "end_line": 59, "span_ids": ["System.symlink"], "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 System(object):\n\n @staticmethod\n def symlink(source, link_name):\n import ctypes\n from dvc.exceptions import DvcException\n\n if System.is_unix():\n try:\n os.symlink(source, link_name)\n return\n except Exception as exc:\n msg = \"failed to symlink '{}' -> '{}': {}\"\n raise DvcException(msg.format(source, link_name, str(exc)))\n\n flags = 0\n if source is not None and os.path.isdir(source):\n flags = 1\n\n func = ctypes.windll.kernel32.CreateSymbolicLinkW\n func.argtypes = (ctypes.c_wchar_p, ctypes.c_wchar_p, ctypes.c_uint32)\n func.restype = ctypes.c_ubyte\n\n if func(link_name, source, flags) == 0:\n raise DvcException(\"CreateSymbolicLinkW\", cause=ctypes.WinError())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": 61, "end_line": 77, "span_ids": ["System._reflink_darwin"], "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 System(object):\n\n @staticmethod\n def _reflink_darwin(src, dst):\n import ctypes\n\n clib = ctypes.CDLL(\"libc.dylib\")\n if not hasattr(clib, \"clonefile\"):\n return -1\n\n clonefile = clib.clonefile\n clonefile.argtypes = [ctypes.c_char_p, ctypes.c_char_p, ctypes.c_int]\n clonefile.restype = ctypes.c_int\n\n return clonefile(\n ctypes.c_char_p(src.encode(\"utf-8\")),\n ctypes.c_char_p(dst.encode(\"utf-8\")),\n ctypes.c_int(0),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System._reflink_windows_System._reflink_linux.return.ret": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System._reflink_windows_System._reflink_linux.return.ret", "embedding": null, "metadata": {"file_path": "dvc/system.py", "file_name": "system.py", "file_type": "text/x-python", "category": "implementation", "start_line": 79, "end_line": 107, "span_ids": ["System._reflink_linux", "System._reflink_windows"], "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": "class System(object):\n\n @staticmethod\n def _reflink_windows(src, dst):\n return -1\n\n @staticmethod\n def _reflink_linux(src, dst):\n import os\n import fcntl\n\n FICLONE = 0x40049409\n\n s = open(src, \"r\")\n d = open(dst, \"w+\")\n\n try:\n ret = fcntl.ioctl(d.fileno(), FICLONE, s.fileno())\n except IOError:\n s.close()\n d.close()\n os.unlink(dst)\n raise\n\n s.close()\n d.close()\n\n if ret != 0:\n os.unlink(dst)\n\n return ret", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System.reflink_System.reflink.if_ret_0_.raise_DvcException_refli": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System.reflink_System.reflink.if_ret_0_.raise_DvcException_refli", "embedding": null, "metadata": {"file_path": "dvc/system.py", "file_name": "system.py", "file_type": "text/x-python", "category": "implementation", "start_line": 109, "end_line": 128, "span_ids": ["System.reflink"], "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 System(object):\n\n @staticmethod\n def reflink(source, link_name):\n import platform\n from dvc.exceptions import DvcException\n\n system = platform.system()\n try:\n if system == \"Windows\":\n ret = System._reflink_windows(source, link_name)\n elif system == \"Darwin\":\n ret = System._reflink_darwin(source, link_name)\n elif system == \"Linux\":\n ret = System._reflink_linux(source, link_name)\n else:\n ret = -1\n except IOError:\n ret = -1\n\n if ret != 0:\n raise DvcException(\"reflink is not supported\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System.getdirinfo_System.getdirinfo.FILETIME._fields_._dwLowDateTime_DWORD_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System.getdirinfo_System.getdirinfo.FILETIME._fields_._dwLowDateTime_DWORD_", "embedding": null, "metadata": {"file_path": "dvc/system.py", "file_name": "system.py", "file_type": "text/x-python", "category": "implementation", "start_line": 130, "end_line": 146, "span_ids": ["System.getdirinfo"], "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 System(object):\n\n @staticmethod\n def getdirinfo(path):\n import ctypes\n from ctypes import c_void_p, c_wchar_p, Structure, WinError, POINTER\n from ctypes.wintypes import DWORD, HANDLE, BOOL\n\n # NOTE: use this flag to open symlink itself and not the target\n # See https://docs.microsoft.com/en-us/windows/desktop/api/\n # fileapi/nf-fileapi-createfilew#symbolic-link-behavior\n FILE_FLAG_OPEN_REPARSE_POINT = 0x00200000\n\n FILE_FLAG_BACKUP_SEMANTICS = 0x02000000\n FILE_SHARE_READ = 0x00000001\n OPEN_EXISTING = 3\n\n class FILETIME(Structure):\n _fields_ = [(\"dwLowDateTime\", DWORD), (\"dwHighDateTime\", DWORD)]\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/system.py_System.getdirinfo.BY_HANDLE_FILE_INFORMATION_System.getdirinfo.BY_HANDLE_FILE_INFORMATION._fields_._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System.getdirinfo.BY_HANDLE_FILE_INFORMATION_System.getdirinfo.BY_HANDLE_FILE_INFORMATION._fields_._", "embedding": null, "metadata": {"file_path": "dvc/system.py", "file_name": "system.py", "file_type": "text/x-python", "category": "implementation", "start_line": 148, "end_line": 160, "span_ids": ["System.getdirinfo"], "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 System(object):\n\n @staticmethod\n def getdirinfo(path):\n # ... other code\n\n class BY_HANDLE_FILE_INFORMATION(Structure):\n _fields_ = [\n (\"dwFileAttributes\", DWORD),\n (\"ftCreationTime\", FILETIME),\n (\"ftLastAccessTime\", FILETIME),\n (\"ftLastWriteTime\", FILETIME),\n (\"dwVolumeSerialNumber\", DWORD),\n (\"nFileSizeHigh\", DWORD),\n (\"nFileSizeLow\", DWORD),\n (\"nNumberOfLinks\", DWORD),\n (\"nFileIndexHigh\", DWORD),\n (\"nFileIndexLow\", DWORD),\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/system.py_System.getdirinfo.flags_System.getdirinfo.return.info": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System.getdirinfo.flags_System.getdirinfo.return.info", "embedding": null, "metadata": {"file_path": "dvc/system.py", "file_name": "system.py", "file_type": "text/x-python", "category": "implementation", "start_line": 162, "end_line": 198, "span_ids": ["System.getdirinfo"], "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 System(object):\n\n @staticmethod\n def getdirinfo(path):\n # ... other code\n\n flags = FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT\n\n func = ctypes.windll.kernel32.CreateFileW\n func.argtypes = [\n c_wchar_p,\n DWORD,\n DWORD,\n c_void_p,\n DWORD,\n DWORD,\n HANDLE,\n ]\n func.restype = HANDLE\n\n hfile = func(\n path, 0, FILE_SHARE_READ, None, OPEN_EXISTING, flags, None\n )\n if hfile is None:\n raise WinError()\n\n func = ctypes.windll.kernel32.GetFileInformationByHandle\n func.argtypes = [HANDLE, POINTER(BY_HANDLE_FILE_INFORMATION)]\n func.restype = BOOL\n\n info = BY_HANDLE_FILE_INFORMATION()\n rv = func(hfile, info)\n\n func = ctypes.windll.kernel32.CloseHandle\n func.argtypes = [HANDLE]\n func.restype = BOOL\n\n func(hfile)\n\n if rv == 0:\n raise WinError()\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/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": 200, "end_line": 224, "span_ids": ["System.inode"], "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(object):\n\n @staticmethod\n def inode(path):\n if System.is_unix():\n import ctypes\n\n inode = os.lstat(path).st_ino\n # NOTE: See https://bugs.python.org/issue29619 and\n # https://stackoverflow.com/questions/34643289/\n # pythons-os-stat-is-returning-wrong-inode-value\n inode = ctypes.c_ulong(inode).value\n else:\n # getdirinfo from ntfsutils works on both files and dirs\n info = System.getdirinfo(path)\n inode = abs(\n hash(\n (\n info.dwVolumeSerialNumber,\n info.nFileIndexHigh,\n info.nFileIndexLow,\n )\n )\n )\n assert inode >= 0\n assert inode < 2 ** 64\n return inode", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System._wait_for_input_windows_System._wait_for_input_windows.if_rc_not_in_WAIT_OBJECT.raise_RuntimeError_rc_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System._wait_for_input_windows_System._wait_for_input_windows.if_rc_not_in_WAIT_OBJECT.raise_RuntimeError_rc_", "embedding": null, "metadata": {"file_path": "dvc/system.py", "file_name": "system.py", "file_type": "text/x-python", "category": "implementation", "start_line": 226, "end_line": 243, "span_ids": ["System._wait_for_input_windows"], "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 System(object):\n\n @staticmethod\n def _wait_for_input_windows(timeout):\n import sys\n import ctypes\n import msvcrt\n from ctypes.wintypes import DWORD, HANDLE\n\n # https://docs.microsoft.com/en-us/windows/desktop/api/synchapi/nf-synchapi-waitforsingleobject\n WAIT_OBJECT_0 = 0\n WAIT_TIMEOUT = 0x00000102\n\n func = ctypes.windll.kernel32.WaitForSingleObject\n func.argtypes = [HANDLE, DWORD]\n func.restype = DWORD\n\n rc = func(msvcrt.get_osfhandle(sys.stdin.fileno()), timeout * 1000)\n if rc not in [WAIT_OBJECT_0, WAIT_TIMEOUT]:\n raise RuntimeError(rc)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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._wait_for_input_posix_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System._wait_for_input_posix_", "embedding": null, "metadata": {"file_path": "dvc/system.py", "file_name": "system.py", "file_type": "text/x-python", "category": "implementation", "start_line": 245, "end_line": 283, "span_ids": ["System.wait_for_input", "System._wait_for_input_posix", "System.is_hardlink", "System.is_symlink"], "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 System(object):\n\n @staticmethod\n def _wait_for_input_posix(timeout):\n import sys\n import select\n\n try:\n select.select([sys.stdin], [], [], timeout)\n except select.error:\n pass\n\n @staticmethod\n def wait_for_input(timeout):\n if System.is_unix():\n return System._wait_for_input_posix(timeout)\n else:\n return System._wait_for_input_windows(timeout)\n\n @staticmethod\n def is_symlink(path):\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 FILE_ATTRIBUTE_REPARSE_POINT = 0x400\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 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_from___future___import_un_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_from___future___import_un_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": 46, "span_ids": ["Updater._with_lock", "Updater.__init__", "imports", "Updater", "Updater.check", "Updater._is_outdated_file"], "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": "from __future__ import unicode_literals\n\nimport sys\nimport os\nimport time\nimport requests\nimport colorama\n\nimport dvc.logger as logger\nfrom dvc import VERSION_BASE\nfrom dvc.lock import Lock, LockError\nfrom dvc.utils import is_binary\n\n\nclass Updater(object): # pragma: no cover\n URL = \"https://updater.dvc.org\"\n UPDATER_FILE = \"updater\"\n TIMEOUT = 24 * 60 * 60 # every day\n TIMEOUT_GET = 10\n\n def __init__(self, dvc_dir):\n self.dvc_dir = dvc_dir\n self.updater_file = os.path.join(dvc_dir, self.UPDATER_FILE)\n self.lock = Lock(dvc_dir, self.updater_file + \".lock\")\n self.current = VERSION_BASE\n\n def _is_outdated_file(self):\n ctime = os.path.getmtime(self.updater_file)\n outdated = time.time() - ctime >= self.TIMEOUT\n if outdated:\n logger.debug(\"'{}' is outdated(\".format(self.updater_file))\n return outdated\n\n def _with_lock(self, func, action):\n try:\n with self.lock:\n func()\n except LockError:\n msg = \"Failed to acquire '{}' before {} updates\"\n logger.debug(msg.format(self.lock.lock_file, action))\n\n def check(self):\n if os.getenv(\"CI\") or os.getenv(\"DVC_TEST\"):\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_self__is_outdated_.self__notify_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater._check_Updater._check.if_self__is_outdated_.self__notify_", "embedding": null, "metadata": {"file_path": "dvc/updater.py", "file_name": "updater.py", "file_type": "text/x-python", "category": "implementation", "start_line": 48, "end_line": 66, "span_ids": ["Updater._check"], "tokens": 127}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Updater(object):\n\n def _check(self):\n if not os.path.exists(self.updater_file) or self._is_outdated_file():\n self.fetch()\n return\n\n with open(self.updater_file, \"r\") as fobj:\n import json\n\n try:\n info = json.load(fobj)\n self.latest = info[\"version\"]\n except Exception as exc:\n msg = \"'{}' is not a valid json: {}\"\n logger.debug(msg.format(self.updater_file, exc))\n self.fetch()\n return\n\n if self._is_outdated():\n self._notify()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater.fetch_Updater._is_outdated.return.l_patch_c_patch": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater.fetch_Updater._is_outdated.return.l_patch_c_patch", "embedding": null, "metadata": {"file_path": "dvc/updater.py", "file_name": "updater.py", "file_type": "text/x-python", "category": "implementation", "start_line": 68, "end_line": 101, "span_ids": ["Updater.fetch", "Updater._get_latest_version", "Updater._is_outdated"], "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 Updater(object):\n\n def fetch(self, detach=True):\n from dvc.daemon import daemon\n\n if detach:\n daemon([\"updater\"])\n return\n\n self._with_lock(self._get_latest_version, \"fetching\")\n\n def _get_latest_version(self):\n import json\n\n try:\n r = requests.get(self.URL, timeout=self.TIMEOUT_GET)\n info = r.json()\n except requests.exceptions.RequestException as exc:\n msg = \"Failed to retrieve latest version: {}\"\n logger.debug(msg.format(exc))\n return\n\n with open(self.updater_file, \"w+\") as fobj:\n json.dump(info, fobj)\n\n def _is_outdated(self):\n l_major, l_minor, l_patch = [int(x) for x in self.latest.split(\".\")]\n c_major, c_minor, c_patch = [int(x) for x in self.current.split(\".\")]\n\n if l_major != c_major:\n return l_major > c_major\n\n if l_minor != c_minor:\n return l_minor > c_minor\n\n return l_patch > c_patch", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_box_message_borde": {"__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_box_message_borde", "embedding": null, "metadata": {"file_path": "dvc/updater.py", "file_name": "updater.py", "file_type": "text/x-python", "category": "implementation", "start_line": 103, "end_line": 121, "span_ids": ["Updater._notify"], "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 Updater(object):\n\n def _notify(self):\n if not sys.stdout.isatty():\n return\n\n message = (\n \"Update available {red}{current}{reset} -> {green}{latest}{reset}\"\n + \"\\n\"\n + self._get_update_instructions()\n ).format(\n red=colorama.Fore.RED,\n reset=colorama.Fore.RESET,\n green=colorama.Fore.GREEN,\n yellow=colorama.Fore.YELLOW,\n blue=colorama.Fore.BLUE,\n current=self.current,\n latest=self.latest,\n )\n\n logger.box(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/updater.py_Updater._get_update_instructions_Updater._get_update_instructions.return.instructions_package_mana": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater._get_update_instructions_Updater._get_update_instructions.return.instructions_package_mana", "embedding": null, "metadata": {"file_path": "dvc/updater.py", "file_name": "updater.py", "file_type": "text/x-python", "category": "implementation", "start_line": 123, "end_line": 149, "span_ids": ["Updater._get_update_instructions"], "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 Updater(object):\n\n def _get_update_instructions(self):\n instructions = {\n \"pip\": \"Run {yellow}pip{reset} install dvc {blue}--upgrade{reset}\",\n \"yum\": \"Run {yellow}yum{reset} update dvc\",\n \"yay\": \"Run {yellow}yay{reset} {blue}-S{reset} dvc\",\n \"formula\": \"Run {yellow}brew{reset} upgrade dvc\",\n \"cask\": \"Run {yellow}brew cask{reset} upgrade dvc\",\n \"apt\": (\n \"Run {yellow}apt-get{reset} install\"\n \" {blue}--only-upgrade{reset} dvc\"\n ),\n \"binary\": (\n \"To upgrade follow this 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 None: (\n \"Find the latest release at\\n{blue}\"\n \"https://github.com/iterative/dvc/releases/latest\"\n \"{reset}\"\n ),\n }\n\n package_manager = self._get_package_manager()\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/updater.py_Updater._get_linux_Updater._get_darwin.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater._get_linux_Updater._get_darwin.return.None", "embedding": null, "metadata": {"file_path": "dvc/updater.py", "file_name": "updater.py", "file_type": "text/x-python", "category": "implementation", "start_line": 151, "end_line": 183, "span_ids": ["Updater._get_darwin", "Updater._get_linux"], "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 Updater(object):\n\n def _get_linux(self):\n import distro\n\n if not is_binary():\n return \"pip\"\n\n package_managers = {\n \"rhel\": \"yum\",\n \"centos\": \"yum\",\n \"fedora\": \"yum\",\n \"amazon\": \"yum\",\n \"opensuse\": \"yum\",\n \"ubuntu\": \"apt\",\n \"debian\": \"apt\",\n }\n\n return package_managers.get(distro.id())\n\n def _get_darwin(self):\n if not is_binary():\n if __file__.startswith(\"/usr/local/Cellar\"):\n return \"formula\"\n else:\n return \"pip\"\n\n # NOTE: both pkg and cask put dvc binary into /usr/local/bin,\n # so in order to know which method of installation was used,\n # we need to actually call `brew cask`\n ret = os.system(\"brew cask ls dvc\")\n if ret == 0:\n return \"cask\"\n\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/updater.py_Updater._get_windows_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater._get_windows_", "embedding": null, "metadata": {"file_path": "dvc/updater.py", "file_name": "updater.py", "file_type": "text/x-python", "category": "implementation", "start_line": 185, "end_line": 204, "span_ids": ["Updater._get_package_manager", "Updater._get_windows"], "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 Updater(object):\n\n def _get_windows(self):\n return None if is_binary() else \"pip\"\n\n def _get_package_manager(self):\n import platform\n from dvc.exceptions import DvcException\n\n m = {\n \"Windows\": self._get_windows,\n \"Darwin\": self._get_darwin,\n \"Linux\": self._get_linux,\n }\n\n system = platform.system()\n func = m.get(system)\n if func is None:\n raise DvcException(\"not supported system '{}'\".format(system))\n\n return 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/utils/__init__.py_bytes_md5_dict_md5.return.bytes_md5_byts_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_bytes_md5_dict_md5.return.bytes_md5_byts_", "embedding": null, "metadata": {"file_path": "dvc/utils/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 68, "end_line": 102, "span_ids": ["dict_md5", "dict_filter", "bytes_md5"], "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 bytes_md5(byts):\n hasher = hashlib.md5()\n hasher.update(byts)\n return hasher.hexdigest()\n\n\ndef dict_filter(d, exclude=[]):\n \"\"\"\n Exclude specified keys from a nested dict\n \"\"\"\n\n if isinstance(d, list):\n ret = []\n for e in d:\n ret.append(dict_filter(e, exclude))\n return ret\n elif isinstance(d, dict):\n ret = {}\n for k, v in d.items():\n if isinstance(k, builtin_str):\n k = str(k)\n\n assert isinstance(k, str)\n if k in exclude:\n continue\n ret[k] = dict_filter(v, exclude)\n return ret\n\n return d\n\n\ndef dict_md5(d, exclude=[]):\n filtered = dict_filter(d, exclude)\n byts = json.dumps(filtered, sort_keys=True).encode(\"utf-8\")\n return bytes_md5(byts)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_copyfile_copyfile.fdest_close_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_copyfile_copyfile.fdest_close_", "embedding": null, "metadata": {"file_path": "dvc/utils/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 105, "end_line": 133, "span_ids": ["copyfile"], "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 copyfile(src, dest, no_progress_bar=False, name=None):\n \"\"\"Copy file with progress bar\"\"\"\n from dvc.progress import progress\n\n copied = 0\n name = name if name else os.path.basename(dest)\n total = os.stat(src).st_size\n\n fsrc = open(src, \"rb\")\n\n if os.path.isdir(dest):\n fdest = open(os.path.join(dest, os.path.basename(src)), \"wb+\")\n else:\n fdest = open(dest, \"wb+\")\n\n while True:\n buf = fsrc.read(LOCAL_CHUNK_SIZE)\n if not buf:\n break\n fdest.write(buf)\n copied += len(buf)\n if not no_progress_bar:\n progress.update_target(name, copied, total)\n\n if not no_progress_bar:\n progress.finish_target(name)\n\n fsrc.close()\n fdest.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/__init__.py_move_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_move_", "embedding": null, "metadata": {"file_path": "dvc/utils/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 140, "end_line": 252, "span_ids": ["to_chunks", "is_binary", "fix_env", "load_stage_file_fobj", "walk_files", "current_timestamp", "tmp_fname", "move", "remove", "load_stage_file", "convert_to_unicode"], "tokens": 658}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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):\n dst = os.path.abspath(dst)\n dname = os.path.dirname(dst)\n if not os.path.exists(dname):\n os.makedirs(dname)\n\n if os.path.islink(src):\n shutil.copy(os.readlink(src), dst)\n os.unlink(src)\n return\n\n shutil.move(src, dst)\n\n\ndef remove(path):\n import dvc.logger as logger\n\n if not os.path.exists(path):\n return\n\n logger.debug(\"Removing '{}'\".format(os.path.relpath(path)))\n\n def _chmod(func, p, excinfo):\n perm = os.stat(p).st_mode\n perm |= stat.S_IWRITE\n os.chmod(p, perm)\n func(p)\n\n if os.path.isfile(path):\n _chmod(os.unlink, path, None)\n else:\n shutil.rmtree(path, onerror=_chmod)\n\n\ndef to_chunks(l, jobs):\n n = int(math.ceil(len(l) / jobs))\n\n if len(l) == 1:\n return [l]\n\n if n == 0:\n n = 1\n\n return [l[x : x + n] for x in range(0, len(l), n)]\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)\n\n\n# NOTE: Fix env variables modified by PyInstaller\n# http://pyinstaller.readthedocs.io/en/stable/runtime-information.html\ndef fix_env(env=None):\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 # NOTE: py2 doesn't like unicode strings in environ\n env[cast_bytes_py2(lp_key)] = cast_bytes_py2(lp_orig)\n else:\n env.pop(lp_key, None)\n\n return env\n\n\ndef convert_to_unicode(data):\n if isinstance(data, builtin_str):\n return str(data)\n elif isinstance(data, dict):\n return dict(map(convert_to_unicode, data.items()))\n elif isinstance(data, list) or isinstance(data, tuple):\n return type(data)(map(convert_to_unicode, data))\n else:\n return data\n\n\ndef tmp_fname(fname):\n \"\"\" Temporary name for a partial download \"\"\"\n from uuid import uuid4\n\n return fname + \".\" + str(uuid4()) + \".tmp\"\n\n\ndef current_timestamp():\n return int(nanotime.timestamp(time.time()))\n\n\ndef load_stage_file(path):\n with open(path, \"r\") as fobj:\n return load_stage_file_fobj(fobj, path)\n\n\ndef load_stage_file_fobj(fobj, path):\n from dvc.exceptions import StageFileCorruptedError\n\n try:\n return yaml.safe_load(fobj) or {}\n except ScannerError:\n raise StageFileCorruptedError(path)\n\n\ndef walk_files(directory):\n for root, _, files in os.walk(str(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/compat.py_if_is_py2__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/compat.py_if_is_py2__", "embedding": null, "metadata": {"file_path": "dvc/utils/compat.py", "file_name": "compat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 63, "end_line": 100, "span_ids": ["impl:9"], "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": "if is_py2:\n from urlparse import urlparse, urljoin # noqa: F401\n from StringIO import StringIO # noqa: F401\n from BaseHTTPServer import HTTPServer # noqa: F401\n from SimpleHTTPServer import SimpleHTTPRequestHandler # noqa: F401\n import ConfigParser # noqa: F401\n from io import open # noqa: F401\n\n builtin_str = str # noqa: F821\n bytes = str # noqa: F821\n str = unicode # noqa: F821\n basestring = basestring # noqa: F821\n numeric_types = (int, long, float) # noqa: F821\n integer_types = (int, long) # noqa: F821\n input = raw_input # noqa: F821\n cast_bytes_py2 = cast_bytes\n makedirs = _makedirs\n\nelif is_py3:\n from os import makedirs # noqa: F401\n from urllib.parse import urlparse, urljoin # noqa: F401\n from io import StringIO # noqa: F401\n from http.server import ( # noqa: F401\n HTTPServer, # noqa: F401\n SimpleHTTPRequestHandler, # noqa: F401\n ) # noqa: F401\n import configparser as ConfigParser # noqa: F401\n\n builtin_str = str # noqa: F821\n str = str # noqa: F821\n bytes = bytes # noqa: F821\n basestring = (str, bytes) # noqa: F821\n numeric_types = (int, float) # noqa: F821\n integer_types = (int,) # noqa: F821\n input = input # noqa: F821\n open = open # noqa: F821\n cast_bytes_py2 = no_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/scripts/hooks/hook-checksumdir.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/hooks/hook-checksumdir.py__", "embedding": null, "metadata": {"file_path": "scripts/hooks/hook-checksumdir.py", "file_name": "hook-checksumdir.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 4, "span_ids": ["imports"], "tokens": 18}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from PyInstaller.utils.hooks import copy_metadata\n\ndatas = copy_metadata(\"checksumdir\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {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.api.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/hooks/hook-google.api.py__", "embedding": null, "metadata": {"file_path": "scripts/hooks/hook-google.api.py", "file_name": "hook-google.api.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 4, "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": "from PyInstaller.utils.hooks import copy_metadata\n\ndatas = copy_metadata(\"google-api-core\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {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.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/hooks/hook-google.cloud.py__", "embedding": null, "metadata": {"file_path": "scripts/hooks/hook-google.cloud.py", "file_name": "hook-google.cloud.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 5, "span_ids": ["imports"], "tokens": 26}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from PyInstaller.utils.hooks import copy_metadata\n\ndatas = copy_metadata(\"google-cloud-core\")\nhiddenimports = [\"google.api\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {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": 4, "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": "from PyInstaller.utils.hooks import copy_metadata\n\ndatas = copy_metadata(\"google-cloud-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/scripts/hooks/hook-google_compute_engine.logger.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/hooks/hook-google_compute_engine.logger.py__", "embedding": null, "metadata": {"file_path": "scripts/hooks/hook-google_compute_engine.logger.py", "file_name": "hook-google_compute_engine.logger.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 5, "span_ids": ["imports"], "tokens": 28}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from PyInstaller.utils.hooks import copy_metadata\n\ndatas = copy_metadata(\"google-compute-engine\")\nhiddenimports = [\"google_cloud_engine\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/innosetup/config_gen.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/innosetup/config_gen.py__", "embedding": null, "metadata": {"file_path": "scripts/innosetup/config_gen.py", "file_name": "config_gen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 11, "span_ids": ["docstring"], "tokens": 73}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\nfrom dvc import VERSION\nfrom dvc.utils.compat import ConfigParser\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/setup.py_from_setuptools_import_se_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/setup.py_from_setuptools_import_se_", "embedding": null, "metadata": {"file_path": "setup.py", "file_name": "setup.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 66, "span_ids": ["imports", "impl:13"], "tokens": 590}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 setuptools import setup, find_packages\nfrom dvc import VERSION\n\n\ninstall_requires = [\n \"ply>=3.9\", # See https://github.com/pyinstaller/pyinstaller/issues/1945\n \"configparser>=3.5.0\",\n \"zc.lockfile>=1.2.1\",\n \"future>=0.16.0\",\n \"colorama>=0.3.9\",\n \"configobj>=5.0.6\",\n \"networkx>=2.1\",\n \"pyyaml>=3.12\",\n \"gitpython>=2.1.8\",\n \"setuptools>=34.0.0\",\n \"nanotime>=0.5.2\",\n \"pyasn1>=0.4.1\",\n \"schema>=0.6.7\",\n \"jsonpath-rw==1.4.0\",\n \"requests>=2.18.4\",\n \"grandalf==0.6\",\n \"asciimatics>=1.10.0\",\n \"distro>=1.3.0\",\n \"appdirs>=1.4.3\",\n \"treelib>=1.5.5\",\n]\n\n# Extra dependencies for remote integrations\ngs = [\"google-cloud-storage==1.13.0\"]\ns3 = [\"boto3==1.9.115\"]\nazure = [\"azure-storage-blob==1.3.0\"]\nssh = [\"paramiko>=2.4.1\"]\nall_remotes = gs + s3 + azure + ssh\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@dataversioncontrol.com\",\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 \"s3\": s3,\n \"azure\": azure,\n \"ssh\": ssh,\n # NOTE: https://github.com/inveniosoftware/troubleshooting/issues/1\n ':python_version==\"2.7\"': [\"futures\"],\n },\n keywords=\"data science, data version control, machine learning\",\n classifiers=[\n \"Development Status :: 4 - Beta\",\n \"Programming Language :: Python :: 2\",\n \"Programming Language :: Python :: 3\",\n ],\n packages=find_packages(exclude=[\"tests\"]),\n include_package_data=True,\n url=\"http://dataversioncontrol.com\",\n entry_points={\"console_scripts\": [\"dvc = dvc.main:main\"]},\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/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/__init__.py__", "embedding": null, "metadata": {"file_path": "tests/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 15, "span_ids": ["imports"], "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": "import os\n\n# Increasing fd ulimit for tests\nif os.name == \"nt\":\n import win32file\n\n win32file._setmaxstdio(2048)\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/__main__.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/__main__.py_os_", "embedding": null, "metadata": {"file_path": "tests/__main__.py", "file_name": "__main__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 25, "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 os\nimport sys\nfrom subprocess import check_call\n\n\nREPO_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\nos.chdir(REPO_ROOT)\n\nos.putenv(\n \"PATH\", \"{}:{}\".format(os.path.join(REPO_ROOT, \"bin\"), os.getenv(\"PATH\"))\n)\nos.putenv(\"DVC_HOME\", REPO_ROOT)\nos.putenv(\"DVC_TEST\", \"true\")\n\nif len(sys.argv) == 1:\n params = \"\"\nelse:\n params = \" \".join(sys.argv[1:])\n\ncmd = (\n \"py.test -v -n=4 --timeout=600 --timeout_method=thread --cov=dvc \"\n \"{params} \".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/test_add.py_TestAddUnupportedFile_TestAddDirectory.test.for_info_in_dir_info_.self_assertTrue_not_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestAddUnupportedFile_TestAddDirectory.test.for_info_in_dir_info_.self_assertTrue_not_", "embedding": null, "metadata": {"file_path": "tests/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 51, "end_line": 73, "span_ids": ["TestAddUnupportedFile.test", "TestAddUnupportedFile", "TestAddDirectory.test", "TestAddDirectory"], "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 TestAddUnupportedFile(TestDvc):\n def test(self):\n with self.assertRaises(DvcException):\n self.dvc.add(\"unsupported://unsupported\")\n\n\nclass TestAddDirectory(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(len(stage.deps), 0)\n self.assertEqual(len(stage.outs), 1)\n\n md5 = stage.outs[0].info[\"md5\"]\n\n dir_info = self.dvc.cache.local.load_dir_cache(md5)\n for info in dir_info:\n self.assertTrue(\"\\\\\" not in info[\"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/tests/test_add.py_TestAddDirectoryRecursive_TestAddTrackedFile.test.with_self_assertRaises_Ou.self_dvc_add_fname_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestAddDirectoryRecursive_TestAddTrackedFile.test.with_self_assertRaises_Ou.self_dvc_add_fname_", "embedding": null, "metadata": {"file_path": "tests/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 76, "end_line": 108, "span_ids": ["TestAddDirectoryWithForwardSlash", "TestAddTrackedFile", "TestAddDirectoryRecursive", "TestAddCmdDirectoryRecursive", "TestAddDirectoryWithForwardSlash.test", "TestAddDirectoryRecursive.test", "TestAddTrackedFile.test", "TestAddCmdDirectoryRecursive.test"], "tokens": 240}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestAddDirectoryRecursive(TestDvc):\n def test(self):\n stages = self.dvc.add(self.DATA_DIR, recursive=True)\n self.assertEqual(len(stages), 2)\n\n\nclass TestAddCmdDirectoryRecursive(TestDvc):\n def test(self):\n ret = main([\"add\", \"--recursive\", self.DATA_DIR])\n self.assertEqual(ret, 0)\n\n\nclass 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\nclass TestAddTrackedFile(TestDvc):\n def test(self):\n fname = \"tracked_file\"\n self.create(fname, \"tracked file contents\")\n self.dvc.scm.add([fname])\n self.dvc.scm.commit(\"add {}\".format(fname))\n\n with self.assertRaises(OutputAlreadyTrackedError):\n self.dvc.add(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/test_add.py_TestAddDirWithExistingCache_TestAddDirWithExistingCache.test.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestAddDirWithExistingCache_TestAddDirWithExistingCache.test.None_5", "embedding": null, "metadata": {"file_path": "tests/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 111, "end_line": 123, "span_ids": ["TestAddDirWithExistingCache", "TestAddDirWithExistingCache.test"], "tokens": 116}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestAddModifiedDir_TestAddFileInDir.test.self_assertEqual_stage_re": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestAddModifiedDir_TestAddFileInDir.test.self_assertEqual_stage_re", "embedding": null, "metadata": {"file_path": "tests/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 126, "end_line": 148, "span_ids": ["TestAddModifiedDir.test", "TestAddModifiedDir", "TestAddFileInDir", "TestAddFileInDir.test"], "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 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)\n\n\nclass TestAddFileInDir(TestDvc):\n def test(self):\n stages = self.dvc.add(self.DATA_SUB)\n self.assertEqual(len(stages), 1)\n stage = stages[0]\n self.assertNotEqual(stage, None)\n self.assertEqual(len(stage.deps), 0)\n self.assertEqual(len(stage.outs), 1)\n self.assertEqual(stage.relpath, self.DATA_SUB + \".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/test_add.py_TestAddExternalLocalFile_TestAddExternalLocalFile.test.self_assertTrue_filecmp_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestAddExternalLocalFile_TestAddExternalLocalFile.test.self_assertTrue_filecmp_c", "embedding": null, "metadata": {"file_path": "tests/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 151, "end_line": 166, "span_ids": ["TestAddExternalLocalFile.test", "TestAddExternalLocalFile"], "tokens": 151}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestAddExternalLocalFile(TestDvc):\n def test(self):\n dname = TestDvc.mkdtemp()\n fname = os.path.join(dname, \"foo\")\n shutil.copyfile(self.FOO, fname)\n\n stages = self.dvc.add(fname)\n self.assertEqual(len(stages), 1)\n stage = stages[0]\n self.assertNotEqual(stage, None)\n self.assertEqual(len(stage.deps), 0)\n self.assertEqual(len(stage.outs), 1)\n self.assertEqual(stage.relpath, \"foo.dvc\")\n self.assertEqual(len(os.listdir(dname)), 1)\n self.assertTrue(os.path.isfile(fname))\n self.assertTrue(filecmp.cmp(fname, \"foo\", shallow=False))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/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/test_add.py_TestCmdAdd_TestDoubleAddUnchanged.test_dir.None_1", "embedding": null, "metadata": {"file_path": "tests/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 199, "end_line": 221, "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/test_add.py_TestShouldUpdateStateEntryForFileAfterAdd_TestShouldUpdateStateEntryForFileAfterAdd.test.with_patch_object_dvc_sta.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestShouldUpdateStateEntryForFileAfterAdd_TestShouldUpdateStateEntryForFileAfterAdd.test.with_patch_object_dvc_sta.None_6", "embedding": null, "metadata": {"file_path": "tests/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 224, "end_line": 242, "span_ids": ["TestShouldUpdateStateEntryForFileAfterAdd.test", "TestShouldUpdateStateEntryForFileAfterAdd"], "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 TestShouldUpdateStateEntryForFileAfterAdd(TestDvc):\n def test(self):\n file_md5_counter = spy(dvc.state.file_md5)\n with patch.object(dvc.state, \"file_md5\", file_md5_counter):\n\n ret = main([\"config\", \"cache.type\", \"copy\"])\n self.assertEqual(ret, 0)\n\n ret = main([\"add\", self.FOO])\n self.assertEqual(ret, 0)\n self.assertEqual(file_md5_counter.mock.call_count, 1)\n\n ret = main([\"status\"])\n self.assertEqual(ret, 0)\n self.assertEqual(file_md5_counter.mock.call_count, 1)\n\n ret = main([\"run\", \"-d\", self.FOO, \"cat {}\".format(self.FOO)])\n self.assertEqual(ret, 0)\n self.assertEqual(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/test_add.py_TestShouldUpdateStateEntryForDirectoryAfterAdd_TestShouldUpdateStateEntryForDirectoryAfterAdd.test.with_patch_object_dvc_sta.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestShouldUpdateStateEntryForDirectoryAfterAdd_TestShouldUpdateStateEntryForDirectoryAfterAdd.test.with_patch_object_dvc_sta.None_6", "embedding": null, "metadata": {"file_path": "tests/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 245, "end_line": 265, "span_ids": ["TestShouldUpdateStateEntryForDirectoryAfterAdd.test", "TestShouldUpdateStateEntryForDirectoryAfterAdd"], "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 TestShouldUpdateStateEntryForDirectoryAfterAdd(TestDvc):\n def test(self):\n file_md5_counter = spy(dvc.state.file_md5)\n with patch.object(dvc.state, \"file_md5\", file_md5_counter):\n\n ret = main([\"config\", \"cache.type\", \"copy\"])\n self.assertEqual(ret, 0)\n\n ret = main([\"add\", self.DATA_DIR])\n self.assertEqual(ret, 0)\n self.assertEqual(file_md5_counter.mock.call_count, 3)\n\n ret = main([\"status\"])\n self.assertEqual(ret, 0)\n self.assertEqual(file_md5_counter.mock.call_count, 3)\n\n ret = main(\n [\"run\", \"-d\", self.DATA_DIR, \"ls {}\".format(self.DATA_DIR)]\n )\n self.assertEqual(ret, 0)\n self.assertEqual(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/test_add.py_TestAddCommit_TestAddCommit.test.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestAddCommit_TestAddCommit.test.None_5", "embedding": null, "metadata": {"file_path": "tests/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 268, "end_line": 278, "span_ids": ["TestAddCommit", "TestAddCommit.test"], "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 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.assertEqual(len(os.listdir(self.dvc.cache.local.cache_dir)), 0)\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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_analytics.py_TestAnalyticsGit_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_analytics.py_TestAnalyticsGit_", "embedding": null, "metadata": {"file_path": "tests/test_analytics.py", "file_name": "test_analytics.py", "file_type": "text/x-python", "category": "test", "start_line": 48, "end_line": 63, "span_ids": ["TestAnalyticsDvc.test_send_disabled", "TestAnalyticsDvc", "TestAnalyticsGit"], "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": "class TestAnalyticsGit(TestAnalytics, TestGit):\n pass\n\n\nclass TestAnalyticsDvc(TestAnalytics, TestDvc):\n @mock.patch(\"requests.post\")\n def test_send_disabled(self, mockpost):\n ret = main([\"config\", \"core.analytics\", \"false\"])\n self.assertEqual(ret, 0)\n\n with mock.patch.object(os, \"getenv\", new=_clean_getenv):\n ret = main([\"daemon\", \"analytics\", Analytics().dump(), \"-v\"])\n self.assertEqual(ret, 0)\n\n self.assertFalse(mockpost.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/test_cache.py_os_TestCache.test_get.self_assertEqual_cache_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_cache.py_os_TestCache.test_get.self_assertEqual_cache_s", "embedding": null, "metadata": {"file_path": "tests/test_cache.py", "file_name": "test_cache.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 37, "span_ids": ["TestCache.test_get", "imports", "TestCache.setUp", "TestCache", "TestCache.test_all"], "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\nimport shutil\nimport configobj\n\nfrom dvc.cache import Cache\nfrom dvc.main import main\n\nfrom tests.basic_env import TestDvc, TestDir\n\n\nclass TestCache(TestDvc):\n def setUp(self):\n super(TestCache, self).setUp()\n self.cache1_md5 = \"123\"\n self.cache2_md5 = \"234\"\n self.cache1 = os.path.join(\n self.dvc.cache.local.cache_dir,\n self.cache1_md5[0:2],\n self.cache1_md5[2:],\n )\n self.cache2 = os.path.join(\n self.dvc.cache.local.cache_dir,\n self.cache2_md5[0:2],\n self.cache2_md5[2:],\n )\n self.create(self.cache1, \"1\")\n self.create(self.cache2, \"2\")\n\n def test_all(self):\n md5_list = list(Cache(self.dvc).local.all())\n self.assertEqual(len(md5_list), 2)\n self.assertIn(self.cache1_md5, md5_list)\n self.assertIn(self.cache2_md5, md5_list)\n\n def test_get(self):\n cache = Cache(self.dvc).local.get(self.cache1_md5)\n self.assertEqual(cache, self.cache1)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_cache.py_TestCacheLoadBadDirCache_TestCacheLoadBadDirCache.test.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_cache.py_TestCacheLoadBadDirCache_TestCacheLoadBadDirCache.test.None_3", "embedding": null, "metadata": {"file_path": "tests/test_cache.py", "file_name": "test_cache.py", "file_type": "text/x-python", "category": "test", "start_line": 40, "end_line": 52, "span_ids": ["TestCacheLoadBadDirCache._do_test", "TestCacheLoadBadDirCache.test", "TestCacheLoadBadDirCache"], "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 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 fname = self.dvc.cache.local.get(\"123.dir\")\n self.create(fname, \"not,json\")\n self._do_test(self.dvc.cache.local.load_dir_cache(fname))\n\n fname = self.dvc.cache.local.get(\"234.dir\")\n self.create(fname, '{\"a\": \"b\"}')\n self._do_test(self.dvc.cache.local.load_dir_cache(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/test_cache.py_TestExternalCacheDir_TestExternalCacheDir.test.self_assertNotEqual_len_o": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_cache.py_TestExternalCacheDir_TestExternalCacheDir.test.self_assertNotEqual_len_o", "embedding": null, "metadata": {"file_path": "tests/test_cache.py", "file_name": "test_cache.py", "file_type": "text/x-python", "category": "test", "start_line": 55, "end_line": 71, "span_ids": ["TestExternalCacheDir.test", "TestExternalCacheDir"], "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 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 shutil.rmtree(\".dvc/cache\")\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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/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/test_cache.py_TestSharedCacheDir_TestSharedCacheDir.test.None_5", "embedding": null, "metadata": {"file_path": "tests/test_cache.py", "file_name": "test_cache.py", "file_type": "text/x-python", "category": "test", "start_line": 74, "end_line": 118, "span_ids": ["TestSharedCacheDir", "TestSharedCacheDir.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 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 shutil.rmtree(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/test_cache.py_TestCacheLinkType_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_cache.py_TestCacheLinkType_", "embedding": null, "metadata": {"file_path": "tests/test_cache.py", "file_name": "test_cache.py", "file_type": "text/x-python", "category": "test", "start_line": 121, "end_line": 162, "span_ids": ["TestCmdCacheDir", "TestCacheLinkType", "TestCacheLinkType.test", "TestCmdCacheDir.test_relative_path", "TestCmdCacheDir.test_abs_path", "TestCmdCacheDir.test"], "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": "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.config_file)\n self.assertEqual(config[\"cache\"][\"dir\"], dname)\n\n def test_relative_path(self):\n tmpdir = self.mkdtemp()\n dname = os.path.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.config_file)\n self.assertEqual(config[\"cache\"][\"dir\"], rel)\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/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/test_checkout.py_TestCheckoutSingleStage_TestCheckoutCorruptedCacheFile.test.None_2", "embedding": null, "metadata": {"file_path": "tests/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 46, "end_line": 67, "span_ids": ["TestCheckoutCorruptedCacheFile", "TestCheckoutCorruptedCacheFile.test", "TestCheckoutSingleStage", "TestCheckoutSingleStage.test"], "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 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\n\n with open(cache, \"a\") as fd:\n fd.write(\"1\")\n\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/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/test_checkout.py_TestRemoveFilesWhenCheckout_TestRemoveFilesWhenCheckout.test.self_assertFalse_os_path_", "embedding": null, "metadata": {"file_path": "tests/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 135, "end_line": 158, "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/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/test_checkout.py_TestCheckoutCleanWorkingDir_TestCheckoutCleanWorkingDir.test.self_assertFalse_os_path_", "embedding": null, "metadata": {"file_path": "tests/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 161, "end_line": 175, "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/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/test_checkout.py_TestCheckoutCleanWorkingDir.test_force_TestCheckoutCleanWorkingDir.test_force.self_assertRaises_DvcExce", "embedding": null, "metadata": {"file_path": "tests/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 177, "end_line": 194, "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/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/test_checkout.py_TestCheckoutSelectiveRemove_TestCheckoutSelectiveRemove.test.None_7", "embedding": null, "metadata": {"file_path": "tests/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 197, "end_line": 218, "span_ids": ["TestCheckoutSelectiveRemove.test", "TestCheckoutSelectiveRemove"], "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 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 stages = self.dvc.add(self.DATA_DIR)\n self.assertEqual(len(stages), 1)\n stage = stages[0]\n staged_files = self.outs_info(stage)\n\n os.remove(staged_files[0].path)\n\n ret = main([\"checkout\", \"--force\", stage.relpath])\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/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/test_checkout.py_TestGitIgnoreBasic_TestGitIgnoreBasic.test.None_9", "embedding": null, "metadata": {"file_path": "tests/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 221, "end_line": 247, "span_ids": ["TestGitIgnoreBasic.test", "TestGitIgnoreBasic"], "tokens": 191}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestGitIgnoreBasic(CheckoutBase):\n def test(self):\n fname1 = \"file_1\"\n fname2 = \"file_2\"\n fname3 = \"file_3\"\n\n self.dvc.scm.add(self.dvc.scm.untracked_files())\n self.dvc.scm.commit(\"add all files\")\n\n self.assertFalse(os.path.exists(self.GIT_IGNORE))\n\n self.commit_data_file(fname1)\n self.commit_data_file(fname2)\n self.dvc.run(\n cmd=\"python {} {} {}\".format(self.CODE, self.FOO, fname3),\n deps=[self.CODE, self.FOO],\n outs_no_cache=[fname3],\n )\n\n self.assertTrue(os.path.exists(self.GIT_IGNORE))\n\n ignored = self.read_ignored()\n\n self.assertEqual(len(ignored), 2)\n\n self.assertIn(\"/\" + fname1, ignored)\n self.assertIn(\"/\" + fname2, ignored)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/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/test_checkout.py_TestGitIgnoreWhenCheckout_TestGitIgnoreWhenCheckout.test.None_12", "embedding": null, "metadata": {"file_path": "tests/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 250, "end_line": 279, "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/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/test_checkout.py_TestCheckoutMissingMd5InStageFile_TestCheckoutEmptyDir.test.self_assertEqual_len_os_l", "embedding": null, "metadata": {"file_path": "tests/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 290, "end_line": 321, "span_ids": ["TestCheckoutMissingMd5InStageFile.test", "TestCheckoutEmptyDir.test", "TestCheckoutEmptyDir", "TestCheckoutMissingMd5InStageFile"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCheckoutMissingMd5InStageFile(TestRepro):\n def test(self):\n with open(self.file1_stage, \"r\") as fd:\n d = yaml.load(fd)\n\n del d[Stage.PARAM_OUTS][0][RemoteLOCAL.PARAM_CHECKSUM]\n del d[Stage.PARAM_DEPS][0][RemoteLOCAL.PARAM_CHECKSUM]\n\n with open(self.file1_stage, \"w\") as fd:\n yaml.dump(d, fd)\n\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 self.dvc.checkout(force=True)\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/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/test_checkout.py_TestCheckoutNotCachedFile_TestCheckoutDirectory.test.self_assertTrue_os_path_e", "embedding": null, "metadata": {"file_path": "tests/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 316, "end_line": 354, "span_ids": ["TestCheckoutWithDeps", "TestCheckoutNotCachedFile.test", "TestCheckoutNotCachedFile", "TestCheckoutDirectory", "TestCheckoutDirectory.test", "TestCheckoutWithDeps.test"], "tokens": 258}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCheckoutNotCachedFile(TestDvc):\n def test(self):\n cmd = \"python {} {} {}\".format(self.CODE, self.FOO, \"out\")\n\n self.dvc.add(self.FOO)\n stage = self.dvc.run(\n cmd=cmd, deps=[self.FOO, self.CODE], outs_no_cache=[\"out\"]\n )\n self.assertTrue(stage is not None)\n\n self.dvc.checkout(force=True)\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/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/test_checkout.py_TestCheckoutHook_TestCheckoutHook.test.with_self_assertRaises_Co.self_dvc_checkout_", "embedding": null, "metadata": {"file_path": "tests/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 365, "end_line": 380, "span_ids": ["TestCheckoutHook", "TestCheckoutHook.test"], "tokens": 145}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCheckoutHook(TestDvc):\n @patch(\"sys.stdout.isatty\", return_value=True)\n @patch(\"dvc.prompt.input\", side_effect=EOFError)\n def test(self, mock_input, mock_isatty):\n \"\"\" Test that dvc checkout handles EOFError gracefully, which is what\n it will experience when running in a git hook.\n \"\"\"\n stages = self.dvc.add(self.DATA_DIR)\n self.assertEqual(len(stages), 1)\n stage = stages[0]\n self.assertNotEqual(stage, None)\n\n self.create(os.path.join(self.DATA_DIR, \"test\"), \"test\")\n\n with self.assertRaises(ConfirmRemoveError):\n self.dvc.checkout()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/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/test_cli.py_os_TestArgParse.test.self_assertIsInstance_arg", "embedding": null, "metadata": {"file_path": "tests/test_cli.py", "file_name": "test_cli.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 23, "span_ids": ["imports", "TestArgParse", "TestArgParse.test"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nfrom dvc.cli import parse_args\nfrom dvc.command.init import CmdInit\nfrom dvc.command.run import CmdRun\nfrom dvc.command.data_sync import CmdDataPull, CmdDataPush\nfrom dvc.command.status import CmdDataStatus\nfrom dvc.command.repro import CmdRepro\nfrom dvc.command.add import CmdAdd\nfrom dvc.command.remove import CmdRemove\nfrom dvc.command.gc import CmdGC\nfrom dvc.command.config import CmdConfig\nfrom dvc.command.checkout import CmdCheckout\nfrom dvc.exceptions import DvcException\nfrom dvc.command.base import CmdBase\n\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/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/test_cli.py_TestRun_TestRun.test.self_assertEqual_args_com", "embedding": null, "metadata": {"file_path": "tests/test_cli.py", "file_name": "test_cli.py", "file_type": "text/x-python", "category": "test", "start_line": 26, "end_line": 76, "span_ids": ["TestRun.test", "TestRun"], "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 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 cwd = os.curdir\n cmd = \"cmd\"\n arg1 = \"arg1\"\n arg2 = \"arg2\"\n\n args = parse_args(\n [\n \"run\",\n \"-d\",\n dep1,\n \"--deps\",\n dep2,\n \"-o\",\n out1,\n \"--outs\",\n out2,\n \"-O\",\n out_no_cache1,\n \"--outs-no-cache\",\n out_no_cache2,\n \"-f\",\n fname,\n \"--file\",\n fname,\n \"-c\",\n cwd,\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.cwd, cwd)\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/test_cli.py_TestPull_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_cli.py_TestPull_", "embedding": null, "metadata": {"file_path": "tests/test_cli.py", "file_name": "test_cli.py", "file_type": "text/x-python", "category": "test", "start_line": 79, "end_line": 179, "span_ids": ["TestRemove", "TestAdd", "TestPull.test", "TestConfig", "TestGCMultipleDvcRepos", "TestCheckout", "TestGCMultipleDvcRepos.test", "TestFindRoot.test", "TestPull", "TestGC", "TestFindRoot", "TestPush.test", "TestStatus.test", "TestRemove.test", "TestRepro", "TestConfig.test", "TestPush", "TestStatus", "TestRepro.test", "TestGC.test", "TestCheckout.test", "TestAdd.test"], "tokens": 575}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestPull(TestDvc):\n def test(self):\n args = parse_args([\"pull\"])\n self.assertIsInstance(args.func(args), CmdDataPull)\n\n\nclass TestPush(TestDvc):\n def test(self):\n args = parse_args([\"push\"])\n self.assertIsInstance(args.func(args), CmdDataPush)\n\n\nclass TestStatus(TestDvc):\n def test(self):\n args = parse_args([\"status\"])\n self.assertIsInstance(args.func(args), CmdDataStatus)\n\n\nclass TestRepro(TestDvc):\n def test(self):\n target1 = \"1\"\n target2 = \"2\"\n\n args = parse_args(\n [\"repro\", target1, target2, \"-f\", \"--force\", \"-s\", \"--single-item\"]\n )\n\n self.assertIsInstance(args.func(args), CmdRepro)\n self.assertEqual(args.targets, [target1, target2])\n self.assertEqual(args.force, True)\n self.assertEqual(args.single_item, True)\n\n\nclass TestRemove(TestDvc):\n def test(self):\n target1 = \"1\"\n target2 = \"2\"\n\n args = parse_args([\"remove\", target1, target2])\n\n self.assertIsInstance(args.func(args), CmdRemove)\n self.assertEqual(args.targets, [target1, target2])\n\n\nclass TestAdd(TestDvc):\n def test(self):\n target1 = \"1\"\n target2 = \"2\"\n\n args = parse_args([\"add\", target1, target2])\n\n self.assertIsInstance(args.func(args), CmdAdd)\n self.assertEqual(args.targets, [target1, target2])\n\n\nclass TestGC(TestDvc):\n def test(self):\n args = parse_args([\"gc\"])\n self.assertIsInstance(args.func(args), CmdGC)\n\n\nclass TestGCMultipleDvcRepos(TestDvc):\n def test(self):\n args = parse_args([\"gc\", \"-p\", \"/tmp/asdf\", \"/tmp/xyz\"])\n\n self.assertIsInstance(args.func(args), CmdGC)\n\n self.assertEqual(args.repos, [\"/tmp/asdf\", \"/tmp/xyz\"])\n\n\nclass TestConfig(TestDvc):\n def test(self):\n name = \"param\"\n value = \"1\"\n\n args = parse_args([\"config\", \"-u\", \"--unset\", name, value])\n\n self.assertIsInstance(args.func(args), CmdConfig)\n self.assertEqual(args.unset, True)\n self.assertEqual(args.name, name)\n self.assertEqual(args.value, value)\n\n\nclass TestCheckout(TestDvc):\n def test(self):\n args = parse_args([\"checkout\"])\n self.assertIsInstance(args.func(args), CmdCheckout)\n\n\nclass TestFindRoot(TestDvc):\n def test(self):\n os.chdir(\"..\")\n\n class A(object):\n quiet = False\n verbose = True\n\n args = A()\n with self.assertRaises(DvcException):\n CmdBase(args)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_commit.py_yaml_TestCommitForce.test.self_assertEqual_self_dvc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_commit.py_yaml_TestCommitForce.test.self_assertEqual_self_dvc", "embedding": null, "metadata": {"file_path": "tests/test_commit.py", "file_name": "test_commit.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 43, "span_ids": ["TestCommitForce", "imports", "TestCommitRecursive", "TestCommitForce.test", "TestCommitRecursive.test"], "tokens": 269}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import yaml\nfrom dvc.utils import load_stage_file\n\nfrom tests.basic_env import TestDvc\nfrom dvc.stage import StageCommitError\n\n\nclass TestCommitRecursive(TestDvc):\n def test(self):\n stages = self.dvc.add(self.DATA_DIR, recursive=True, no_commit=True)\n self.assertEqual(len(stages), 2)\n\n self.assertNotEqual(self.dvc.status(), {})\n\n self.dvc.commit(self.DATA_DIR, recursive=True)\n\n self.assertEqual(self.dvc.status(), {})\n\n\nclass TestCommitForce(TestDvc):\n def test(self):\n stages = self.dvc.add(self.FOO, no_commit=True)\n self.assertEqual(len(stages), 1)\n stage = stages[0]\n\n with self.dvc.state:\n self.assertTrue(stage.outs[0].changed_cache())\n\n with open(self.FOO, \"a\") as fobj:\n fobj.write(self.FOO_CONTENTS)\n\n with self.dvc.state:\n self.assertTrue(stage.outs[0].changed_cache())\n\n with self.assertRaises(StageCommitError):\n self.dvc.commit(stage.path)\n\n with self.dvc.state:\n self.assertTrue(stage.outs[0].changed_cache())\n\n self.dvc.commit(stage.path, force=True)\n\n self.assertEqual(self.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/test_commit.py_TestCommitWithDeps_TestCommitWithDeps.test.None_1.self_assertFalse_stage_ou": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_commit.py_TestCommitWithDeps_TestCommitWithDeps.test.None_1.self_assertFalse_stage_ou", "embedding": null, "metadata": {"file_path": "tests/test_commit.py", "file_name": "test_commit.py", "file_type": "text/x-python", "category": "test", "start_line": 45, "end_line": 70, "span_ids": ["TestCommitWithDeps", "TestCommitWithDeps.test"], "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 TestCommitWithDeps(TestDvc):\n def test(self):\n stages = self.dvc.add(self.FOO, no_commit=True)\n self.assertEqual(len(stages), 1)\n foo_stage = stages[0]\n self.assertTrue(foo_stage is not None)\n self.assertEqual(len(foo_stage.outs), 1)\n\n fname = \"file\"\n stage = self.dvc.run(\n cmd=\"python {} {} {}\".format(self.CODE, self.FOO, fname),\n outs=[fname],\n deps=[self.FOO, self.CODE],\n no_commit=True,\n )\n self.assertTrue(stage is not None)\n self.assertEqual(len(stage.outs), 1)\n\n with self.dvc.state:\n self.assertTrue(foo_stage.outs[0].changed_cache())\n self.assertTrue(stage.outs[0].changed_cache())\n\n self.dvc.commit(stage.path, with_deps=True)\n with self.dvc.state:\n self.assertFalse(foo_stage.outs[0].changed_cache())\n self.assertFalse(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/test_commit.py_TestCommitChangedMd5_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_commit.py_TestCommitChangedMd5_", "embedding": null, "metadata": {"file_path": "tests/test_commit.py", "file_name": "test_commit.py", "file_type": "text/x-python", "category": "test", "start_line": 74, "end_line": 90, "span_ids": ["TestCommitChangedMd5.test", "TestCommitChangedMd5"], "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 TestCommitChangedMd5(TestDvc):\n def test(self):\n stages = self.dvc.add(self.FOO, no_commit=True)\n self.assertEqual(len(stages), 1)\n stage = stages[0]\n\n st = load_stage_file(stage.path)\n\n st[\"md5\"] = \"1111111111\"\n with open(stage.path, \"w\") as fobj:\n yaml.safe_dump(st, fobj, default_flow_style=False)\n\n with self.assertRaises(StageCommitError):\n self.dvc.commit(stage.path)\n\n self.dvc.commit(stage.path, force=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/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/test_config.py_configobj_TestConfigCLI.test_root.None_1", "embedding": null, "metadata": {"file_path": "tests/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 34, "span_ids": ["imports", "TestConfigCLI.test_root", "TestConfigCLI._contains", "TestConfigCLI"], "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": "import configobj\n\nfrom dvc.main import main\nfrom dvc.command.config import CmdConfig\nfrom tests.basic_env import TestDvc\n\n\nclass TestConfigCLI(TestDvc):\n def _contains(self, section, field, value, local=False):\n if local:\n fname = self.dvc.config.config_local_file\n else:\n fname = self.dvc.config.config_file\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/test_config.py_TestConfigCLI._do_test_TestConfigCLI.test_local.self__do_test_True_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_config.py_TestConfigCLI._do_test_TestConfigCLI.test_local.self__do_test_True_", "embedding": null, "metadata": {"file_path": "tests/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 36, "end_line": 67, "span_ids": ["TestConfigCLI._do_test", "TestConfigCLI.test", "TestConfigCLI.test_local"], "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 TestConfigCLI(TestDvc):\n\n def _do_test(self, local=False):\n section = \"setsection\"\n field = \"setfield\"\n section_field = \"{}.{}\".format(section, field)\n value = \"setvalue\"\n newvalue = \"setnewvalue\"\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))\n\n def test(self):\n self._do_test(False)\n\n def test_local(self):\n self._do_test(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/test_config.py_TestConfigCLI.test_non_existing_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_config.py_TestConfigCLI.test_non_existing_", "embedding": null, "metadata": {"file_path": "tests/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 69, "end_line": 105, "span_ids": ["TestConfigCLI.test_failed_write", "TestConfigCLI.test_non_existing"], "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 TestConfigCLI(TestDvc):\n\n def test_non_existing(self):\n # FIXME check stdout/err\n\n ret = main([\"config\", \"non_existing_section.field\"])\n self.assertEqual(ret, 1)\n\n ret = main([\"config\", \"global.non_existing_field\"])\n self.assertEqual(ret, 1)\n\n ret = main([\"config\", \"non_existing_section.field\", \"-u\"])\n self.assertEqual(ret, 1)\n\n ret = main([\"config\", \"global.non_existing_field\", \"-u\"])\n self.assertEqual(ret, 1)\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, 1)\n\n def test_failed_write(self):\n class A(object):\n system = False\n glob = False\n local = False\n name = \"core.remote\"\n value = \"myremote\"\n unset = False\n\n args = A()\n cmd = CmdConfig(args)\n\n cmd.configobj.write = None\n ret = cmd.run()\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/test_data_cloud.py_from_subprocess_import_Ca__should_test_aws.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_from_subprocess_import_Ca__should_test_aws.return.False", "embedding": null, "metadata": {"file_path": "tests/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 62, "span_ids": ["imports", "_should_test_aws"], "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": "from subprocess import CalledProcessError\nfrom subprocess import check_output, Popen\nfrom unittest import SkipTest\nimport os\nimport uuid\nimport shutil\nimport getpass\nimport platform\nimport yaml\nimport copy\n\nfrom dvc.state import State\nfrom mock import patch\nfrom tests.utils.logger import MockLoggerHandlers, ConsoleFontColorsRemover\n\nfrom dvc.logger import logger\nfrom dvc.utils.compat import str\nfrom dvc.main import main\nfrom dvc.config import Config\nfrom dvc.data_cloud import (\n DataCloud,\n RemoteS3,\n RemoteGS,\n RemoteAzure,\n RemoteLOCAL,\n RemoteSSH,\n RemoteHDFS,\n RemoteHTTP,\n)\nfrom dvc.remote.base import STATUS_OK, STATUS_NEW, STATUS_DELETED\nfrom dvc.utils import file_md5, load_stage_file\n\nfrom tests.basic_env import TestDvc\nfrom tests.utils import (\n spy,\n reset_logger_standard_output,\n reset_logger_error_output,\n)\n\n\nTEST_REMOTE = \"upstream\"\nTEST_SECTION = 'remote \"{}\"'.format(TEST_REMOTE)\nTEST_CONFIG = {\n Config.SECTION_CORE: {Config.SECTION_CORE_REMOTE: TEST_REMOTE},\n TEST_SECTION: {Config.SECTION_REMOTE_URL: \"\"},\n}\n\nTEST_AWS_REPO_BUCKET = \"dvc-test\"\nTEST_GCP_REPO_BUCKET = \"dvc-test\"\n\n\ndef _should_test_aws():\n dvc_test_aws = os.getenv(\"DVC_TEST_AWS\")\n if dvc_test_aws == \"true\":\n return True\n elif dvc_test_aws == \"false\":\n return False\n\n if os.getenv(\"AWS_ACCESS_KEY_ID\") and os.getenv(\"AWS_SECRET_ACCESS_KEY\"):\n return True\n\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py__should_test_gcp__should_test_gcp.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py__should_test_gcp__should_test_gcp.return.False", "embedding": null, "metadata": {"file_path": "tests/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 62, "end_line": 88, "span_ids": ["_should_test_gcp"], "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 _should_test_gcp():\n if os.getenv(\"DVC_TEST_GCP\") == \"true\":\n return True\n\n if not os.path.exists(TestDvc.GCP_CREDS_FILE):\n return False\n\n creds = os.getenv(\"GOOGLE_APPLICATION_CREDENTIALS\")\n if creds and os.getenv(\"GCP_CREDS\"):\n if os.path.exists(creds):\n os.unlink(creds)\n shutil.copyfile(TestDvc.GCP_CREDS_FILE, creds)\n try:\n check_output(\n [\n \"gcloud\",\n \"auth\",\n \"activate-service-account\",\n \"--key-file\",\n creds,\n ]\n )\n except (CalledProcessError, OSError):\n return False\n return True\n\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py__should_test_azure__should_test_ssh.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py__should_test_azure__should_test_ssh.return.True", "embedding": null, "metadata": {"file_path": "tests/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 91, "end_line": 115, "span_ids": ["_should_test_ssh", "_should_test_azure"], "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 _should_test_azure():\n if os.getenv(\"DVC_TEST_AZURE\") == \"true\":\n return True\n elif os.getenv(\"DVC_TEST_AZURE\") == \"false\":\n return False\n\n return os.getenv(\"AZURE_STORAGE_CONTAINER_NAME\") and os.getenv(\n \"AZURE_STORAGE_CONNECTION_STRING\"\n )\n\n\ndef _should_test_ssh():\n if os.getenv(\"DVC_TEST_SSH\") == \"true\":\n return True\n\n # FIXME: enable on windows\n if os.name == \"nt\":\n return False\n\n try:\n check_output([\"ssh\", \"-o\", \"BatchMode=yes\", \"127.0.0.1\", \"ls\"])\n except (CalledProcessError, IOError):\n return False\n\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py__should_test_hdfs__should_test_hdfs.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py__should_test_hdfs__should_test_hdfs.return.True", "embedding": null, "metadata": {"file_path": "tests/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 118, "end_line": 138, "span_ids": ["_should_test_hdfs"], "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 _should_test_hdfs():\n if platform.system() != \"Linux\":\n return False\n\n try:\n check_output(\n [\"hadoop\", \"version\"], shell=True, executable=os.getenv(\"SHELL\")\n )\n except (CalledProcessError, IOError):\n return False\n\n p = Popen(\n \"hadoop fs -ls hdfs://127.0.0.1/\",\n shell=True,\n executable=os.getenv(\"SHELL\"),\n )\n p.communicate()\n if p.returncode != 0:\n return False\n\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_get_local_storagepath_get_azure_url.return._azure_format_co": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_get_local_storagepath_get_azure_url.return._azure_format_co", "embedding": null, "metadata": {"file_path": "tests/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 141, "end_line": 189, "span_ids": ["get_aws_storagepath", "get_local_url", "get_gcp_storagepath", "get_hdfs_url", "get_aws_url", "get_gcp_url", "get_local_storagepath", "get_azure_url_compat", "get_ssh_url", "get_azure_url"], "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 get_local_storagepath():\n return TestDvc.mkdtemp()\n\n\ndef get_local_url():\n return get_local_storagepath()\n\n\ndef get_ssh_url():\n return \"ssh://{}@127.0.0.1:{}\".format(\n getpass.getuser(), get_local_storagepath()\n )\n\n\ndef get_hdfs_url():\n return \"hdfs://{}@127.0.0.1{}\".format(\n getpass.getuser(), get_local_storagepath()\n )\n\n\ndef get_aws_storagepath():\n return TEST_AWS_REPO_BUCKET + \"/\" + str(uuid.uuid4())\n\n\ndef get_aws_url():\n return \"s3://\" + get_aws_storagepath()\n\n\ndef get_gcp_storagepath():\n return TEST_GCP_REPO_BUCKET + \"/\" + str(uuid.uuid4())\n\n\ndef get_gcp_url():\n return \"gs://\" + get_gcp_storagepath()\n\n\ndef get_azure_url_compat():\n container_name = os.getenv(\"AZURE_STORAGE_CONTAINER_NAME\")\n connection_string = os.getenv(\"AZURE_STORAGE_CONNECTION_STRING\")\n assert container_name is not None\n return \"azure://ContainerName={};{}\".format(\n container_name, connection_string\n )\n\n\ndef get_azure_url():\n container_name = os.getenv(\"AZURE_STORAGE_CONTAINER_NAME\")\n assert container_name is not None\n return \"azure://{}/{}\".format(container_name, str(uuid.uuid4()))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestDataCloud_TestDataCloud.test.for_scheme_cl_in_clist_.self__test_cloud_config_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestDataCloud_TestDataCloud.test.for_scheme_cl_in_clist_.self__test_cloud_config_", "embedding": null, "metadata": {"file_path": "tests/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 192, "end_line": 212, "span_ids": ["TestDataCloud._test_cloud", "TestDataCloud.test", "TestDataCloud"], "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 TestDataCloud(TestDvc):\n def _test_cloud(self, config, cl):\n cloud = DataCloud(self.dvc, config=config)\n self.assertIsInstance(cloud._cloud, cl)\n\n def test(self):\n config = copy.deepcopy(TEST_CONFIG)\n\n clist = [\n (\"s3://mybucket/\", RemoteS3),\n (\"gs://mybucket/\", RemoteGS),\n (\"ssh://user@localhost:/\", RemoteSSH),\n (\"http://localhost:8000/\", RemoteHTTP),\n (\"azure://ContainerName=mybucket;conn_string;\", RemoteAzure),\n (TestDvc.mkdtemp(), RemoteLOCAL),\n ]\n\n for scheme, cl in clist:\n remote_url = scheme + str(uuid.uuid4())\n config[TEST_SECTION][Config.SECTION_REMOTE_URL] = remote_url\n self._test_cloud(config, cl)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestDataCloudBase_TestDataCloudBase._setup_cloud.self_assertIsInstance_sel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestDataCloudBase_TestDataCloudBase._setup_cloud.self_assertIsInstance_sel", "embedding": null, "metadata": {"file_path": "tests/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 215, "end_line": 240, "span_ids": ["TestDataCloudBase._ensure_should_run", "TestDataCloudBase._get_url", "TestDataCloudBase._should_test", "TestDataCloudBase", "TestDataCloudBase._setup_cloud", "TestDataCloudBase._get_cloud_class"], "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 TestDataCloudBase(TestDvc):\n def _get_cloud_class(self):\n return None\n\n def _should_test(self):\n return False\n\n def _get_url(self):\n return \"\"\n\n def _ensure_should_run(self):\n if not self._should_test():\n raise SkipTest(\n \"Test {} is disabled\".format(self.__class__.__name__)\n )\n\n def _setup_cloud(self):\n self._ensure_should_run()\n\n repo = self._get_url()\n\n config = copy.deepcopy(TEST_CONFIG)\n config[TEST_SECTION][Config.SECTION_REMOTE_URL] = repo\n self.cloud = DataCloud(self.dvc, config)\n\n self.assertIsInstance(self.cloud._cloud, self._get_cloud_class())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestDataCloudBase._test_cloud_TestDataCloudBase.test.self__test_cloud_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestDataCloudBase._test_cloud_TestDataCloudBase.test.self__test_cloud_", "embedding": null, "metadata": {"file_path": "tests/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 242, "end_line": 319, "span_ids": ["TestDataCloudBase.test", "TestDataCloudBase._test_cloud"], "tokens": 670}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestDataCloudBase(TestDvc):\n\n def _test_cloud(self):\n self._setup_cloud()\n\n stages = self.dvc.add(self.FOO)\n self.assertEqual(len(stages), 1)\n stage = stages[0]\n self.assertTrue(stage is not None)\n cache = stage.outs[0].cache\n info = stage.outs[0].dumpd()\n md5 = info[\"md5\"]\n\n stages = self.dvc.add(self.DATA_DIR)\n self.assertEqual(len(stages), 1)\n stage_dir = stages[0]\n self.assertTrue(stage_dir is not None)\n\n cache_dir = stage_dir.outs[0].cache\n info_dir = stage_dir.outs[0].dumpd()\n md5_dir = info_dir[\"md5\"]\n\n with self.cloud.repo.state:\n # Check status\n status = self.cloud.status([info], show_checksums=True)\n expected = {md5: {\"name\": md5, \"status\": STATUS_NEW}}\n self.assertEqual(status, expected)\n\n status_dir = self.cloud.status([info_dir], show_checksums=True)\n expected = {md5_dir: {\"name\": md5_dir, \"status\": STATUS_NEW}}\n self.assertEqual(status_dir, expected)\n\n # Push and check status\n self.cloud.push([info])\n self.assertTrue(os.path.exists(cache))\n self.assertTrue(os.path.isfile(cache))\n\n self.cloud.push([info_dir])\n self.assertTrue(os.path.isfile(cache_dir))\n\n status = self.cloud.status([info], show_checksums=True)\n expected = {md5: {\"name\": md5, \"status\": STATUS_OK}}\n self.assertEqual(status, expected)\n\n status_dir = self.cloud.status([info_dir], show_checksums=True)\n expected = {md5_dir: {\"name\": md5_dir, \"status\": STATUS_OK}}\n self.assertEqual(status_dir, expected)\n\n # Remove and check status\n shutil.rmtree(self.dvc.cache.local.cache_dir)\n\n status = self.cloud.status([info], show_checksums=True)\n expected = {md5: {\"name\": md5, \"status\": STATUS_DELETED}}\n self.assertEqual(status, expected)\n\n status_dir = self.cloud.status([info_dir], show_checksums=True)\n expected = {md5_dir: {\"name\": md5_dir, \"status\": STATUS_DELETED}}\n self.assertEqual(status_dir, expected)\n\n # Pull and check status\n self.cloud.pull([info])\n self.assertTrue(os.path.exists(cache))\n self.assertTrue(os.path.isfile(cache))\n with open(cache, \"r\") as fd:\n self.assertEqual(fd.read(), self.FOO_CONTENTS)\n\n self.cloud.pull([info_dir])\n self.assertTrue(os.path.isfile(cache_dir))\n\n status = self.cloud.status([info], show_checksums=True)\n expected = {md5: {\"name\": md5, \"status\": STATUS_OK}}\n self.assertEqual(status, expected)\n\n status_dir = self.cloud.status([info_dir], show_checksums=True)\n expected = {md5_dir: {\"name\": md5_dir, \"status\": STATUS_OK}}\n self.assertTrue(status_dir, expected)\n\n def test(self):\n self._ensure_should_run()\n self._test_cloud()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestRemoteS3_TestRemoteGS._get_cloud_class.return.RemoteGS": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestRemoteS3_TestRemoteGS._get_cloud_class.return.RemoteGS", "embedding": null, "metadata": {"file_path": "tests/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 322, "end_line": 355, "span_ids": ["TestRemoteGS._should_test", "TestRemoteGS._get_cloud_class", "TestRemoteGS._setup_cloud", "TestRemoteS3._get_url", "TestRemoteS3", "TestRemoteGS._get_url", "TestRemoteS3._should_test", "TestRemoteGS", "TestRemoteS3._get_cloud_class"], "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 TestRemoteS3(TestDataCloudBase):\n def _should_test(self):\n return _should_test_aws()\n\n def _get_url(self):\n return get_aws_url()\n\n def _get_cloud_class(self):\n return RemoteS3\n\n\nclass TestRemoteGS(TestDataCloudBase):\n def _should_test(self):\n return _should_test_gcp()\n\n def _setup_cloud(self):\n self._ensure_should_run()\n\n repo = self._get_url()\n\n config = copy.deepcopy(TEST_CONFIG)\n config[TEST_SECTION][Config.SECTION_REMOTE_URL] = repo\n config[TEST_SECTION][\n Config.SECTION_GCP_CREDENTIALPATH\n ] = TestDvc.GCP_CREDS_FILE\n self.cloud = DataCloud(self.dvc, config)\n\n self.assertIsInstance(self.cloud._cloud, self._get_cloud_class())\n\n def _get_url(self):\n return get_gcp_url()\n\n def _get_cloud_class(self):\n return RemoteGS", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestRemoteAzureCompat_TestRemoteHDFS._get_cloud_class.return.RemoteHDFS": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestRemoteAzureCompat_TestRemoteHDFS._get_cloud_class.return.RemoteHDFS", "embedding": null, "metadata": {"file_path": "tests/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 358, "end_line": 409, "span_ids": ["TestRemoteLOCAL", "TestRemoteSSH._should_test", "TestRemoteHDFS._get_cloud_class", "TestRemoteAzure", "TestRemoteAzureCompat", "TestRemoteAzureCompat._should_test", "TestRemoteAzureCompat._get_cloud_class", "TestRemoteSSH", "TestRemoteAzure._get_url", "TestRemoteLOCAL._get_url", "TestRemoteAzureCompat._get_url", "TestRemoteSSH._get_url", "TestRemoteLOCAL._should_test", "TestRemoteHDFS._get_url", "TestRemoteLOCAL._get_cloud_class", "TestRemoteHDFS._should_test", "TestRemoteSSH._get_cloud_class", "TestRemoteHDFS", "TestRemoteLOCAL.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 TestRemoteAzureCompat(TestDataCloudBase):\n def _should_test(self):\n return _should_test_azure()\n\n def _get_url(self):\n return get_azure_url_compat()\n\n def _get_cloud_class(self):\n return RemoteAzure\n\n\nclass TestRemoteAzure(TestRemoteAzureCompat):\n def _get_url(self):\n return get_azure_url()\n\n\nclass TestRemoteLOCAL(TestDataCloudBase):\n def _should_test(self):\n return True\n\n def _get_url(self):\n self.dname = get_local_url()\n return self.dname\n\n def _get_cloud_class(self):\n return RemoteLOCAL\n\n def test(self):\n super(TestRemoteLOCAL, self).test()\n self.assertTrue(os.path.isdir(self.dname))\n\n\nclass TestRemoteSSH(TestDataCloudBase):\n def _should_test(self):\n return _should_test_ssh()\n\n def _get_url(self):\n return get_ssh_url()\n\n def _get_cloud_class(self):\n return RemoteSSH\n\n\nclass TestRemoteHDFS(TestDataCloudBase):\n def _should_test(self):\n return _should_test_hdfs()\n\n def _get_url(self):\n return get_hdfs_url()\n\n def _get_cloud_class(self):\n return RemoteHDFS", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestDataCloudCLIBase_TestDataCloudCLIBase.test.if_self__should_test_.self__test_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestDataCloudCLIBase_TestDataCloudCLIBase.test.if_self__should_test_.self__test_", "embedding": null, "metadata": {"file_path": "tests/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 412, "end_line": 492, "span_ids": ["TestDataCloudCLIBase.test", "TestDataCloudCLIBase._test", "TestDataCloudCLIBase._test_cloud", "TestDataCloudCLIBase", "TestDataCloudCLIBase._should_test", "TestDataCloudCLIBase.main"], "tokens": 574}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestDataCloudCLIBase(TestDvc):\n def main(self, args):\n ret = main(args)\n self.assertEqual(ret, 0)\n\n def _test_cloud(self, remote=None):\n args = [\"-v\", \"-j\", \"2\"]\n if remote:\n args += [\"-r\", remote]\n else:\n args += []\n\n stages = self.dvc.add(self.FOO)\n self.assertEqual(len(stages), 1)\n stage = stages[0]\n self.assertTrue(stage is not None)\n cache = stage.outs[0].cache\n\n stages = self.dvc.add(self.DATA_DIR)\n self.assertEqual(len(stages), 1)\n stage_dir = stages[0]\n self.assertTrue(stage_dir is not None)\n cache_dir = stage_dir.outs[0].cache\n\n # FIXME check status output\n self.main([\"status\", \"-c\", \"--show-checksums\"] + args)\n\n self.main([\"push\"] + args)\n self.assertTrue(os.path.exists(cache))\n self.assertTrue(os.path.isfile(cache))\n self.assertTrue(os.path.isfile(cache_dir))\n\n self.main([\"status\", \"-c\", \"--show-checksums\"] + args)\n\n shutil.rmtree(self.dvc.cache.local.cache_dir)\n\n self.main([\"status\", \"-c\", \"--show-checksums\"] + args)\n\n self.main([\"fetch\"] + args)\n self.assertTrue(os.path.exists(cache))\n self.assertTrue(os.path.isfile(cache))\n self.assertTrue(os.path.isfile(cache_dir))\n\n self.main([\"pull\"] + args)\n self.assertTrue(os.path.exists(cache))\n self.assertTrue(os.path.isfile(cache))\n self.assertTrue(os.path.isfile(cache_dir))\n self.assertTrue(os.path.isfile(self.FOO))\n self.assertTrue(os.path.isdir(self.DATA_DIR))\n\n with open(cache, \"r\") as fd:\n self.assertEqual(fd.read(), self.FOO_CONTENTS)\n self.assertTrue(os.path.isfile(cache_dir))\n\n self.main([\"status\", \"-c\", \"--show-checksums\"] + args)\n\n # NOTE: check if remote gc works correctly on directories\n self.main([\"gc\", \"-c\", \"-f\"] + args)\n shutil.move(\n self.dvc.cache.local.cache_dir,\n self.dvc.cache.local.cache_dir + \".back\",\n )\n\n self.main([\"fetch\"] + args)\n\n self.main([\"pull\", \"-f\"] + args)\n self.assertTrue(os.path.exists(cache))\n self.assertTrue(os.path.isfile(cache))\n self.assertTrue(os.path.isfile(cache_dir))\n self.assertTrue(os.path.isfile(self.FOO))\n self.assertTrue(os.path.isdir(self.DATA_DIR))\n\n def _should_test(self):\n return True\n\n def _test(self):\n pass\n\n def test(self):\n if self._should_test():\n self._test()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestCompatRemoteLOCALCLI_TestDataCloudErrorCLI.test_error.self_main_fail_fetch_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestCompatRemoteLOCALCLI_TestDataCloudErrorCLI.test_error.self_main_fail_fetch_", "embedding": null, "metadata": {"file_path": "tests/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 495, "end_line": 616, "span_ids": ["TestCompatRemoteLOCALCLI", "TestDataCloudErrorCLI", "TestRemoteGSCLI", "TestRemoteHDFSCLI", "TestRemoteAzureCLI", "TestCompatRemoteLOCALCLI._test", "TestRemoteSSHCLI._should_test", "TestRemoteGSCLI._should_test", "TestRemoteHDFSCLI._should_test", "TestCompatRemoteS3CLI._should_test", "TestCompatRemoteS3CLI", "TestRemoteS3CLI._test", "TestCompatRemoteGSCLI", "TestRemoteS3CLI", "TestRemoteLOCALCLI._test", "TestCompatRemoteGSCLI._should_test", "TestRemoteAzureCLI._test", "TestCompatRemoteGSCLI._test", "TestRemoteLOCALCLI", "TestRemoteSSHCLI._test", "TestRemoteHDFSCLI._test", "TestRemoteAzureCLI._should_test", "TestCompatRemoteS3CLI._test", "TestRemoteGSCLI._test", "TestRemoteS3CLI._should_test", "TestRemoteSSHCLI", "TestDataCloudErrorCLI.test_error", "TestDataCloudErrorCLI.main_fail"], "tokens": 702}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCompatRemoteLOCALCLI(TestDataCloudCLIBase):\n def _test(self):\n storagepath = get_local_storagepath()\n self.main([\"config\", \"core.cloud\", \"local\"])\n self.main([\"config\", \"local.storagepath\", storagepath])\n\n self._test_cloud()\n\n\nclass TestRemoteLOCALCLI(TestDataCloudCLIBase):\n def _test(self):\n url = get_local_url()\n\n self.main([\"remote\", \"add\", TEST_REMOTE, url])\n\n self._test_cloud(TEST_REMOTE)\n\n\nclass TestRemoteSSHCLI(TestDataCloudCLIBase):\n def _should_test(self):\n return _should_test_ssh()\n\n def _test(self):\n url = get_ssh_url()\n\n self.main([\"remote\", \"add\", TEST_REMOTE, url])\n\n self._test_cloud(TEST_REMOTE)\n\n\nclass TestRemoteHDFSCLI(TestDataCloudCLIBase):\n def _should_test(self):\n return _should_test_hdfs()\n\n def _test(self):\n url = get_hdfs_url()\n\n self.main([\"remote\", \"add\", TEST_REMOTE, url])\n\n self._test_cloud(TEST_REMOTE)\n\n\nclass TestCompatRemoteS3CLI(TestDataCloudCLIBase):\n def _should_test(self):\n return _should_test_aws()\n\n def _test(self):\n storagepath = get_aws_storagepath()\n self.main([\"config\", \"core.cloud\", \"aws\"])\n self.main([\"config\", \"aws.storagepath\", storagepath])\n\n self._test_cloud()\n\n\nclass TestRemoteS3CLI(TestDataCloudCLIBase):\n def _should_test(self):\n return _should_test_aws()\n\n def _test(self):\n url = get_aws_url()\n\n self.main([\"remote\", \"add\", TEST_REMOTE, url])\n\n self._test_cloud(TEST_REMOTE)\n\n\nclass TestCompatRemoteGSCLI(TestDataCloudCLIBase):\n def _should_test(self):\n return _should_test_gcp()\n\n def _test(self):\n storagepath = get_gcp_storagepath()\n self.main([\"config\", \"core.cloud\", \"gcp\"])\n self.main([\"config\", \"gcp.storagepath\", storagepath])\n\n self._test_cloud()\n\n\nclass TestRemoteGSCLI(TestDataCloudCLIBase):\n def _should_test(self):\n return _should_test_gcp()\n\n def _test(self):\n url = get_gcp_url()\n\n self.main([\"remote\", \"add\", TEST_REMOTE, url])\n self.main(\n [\n \"remote\",\n \"modify\",\n TEST_REMOTE,\n \"credentialpath\",\n TestDvc.GCP_CREDS_FILE,\n ]\n )\n\n self._test_cloud(TEST_REMOTE)\n\n\nclass TestRemoteAzureCLI(TestDataCloudCLIBase):\n def _should_test(self):\n return _should_test_azure()\n\n def _test(self):\n url = get_azure_url()\n\n self.main([\"remote\", \"add\", TEST_REMOTE, url])\n\n self._test_cloud(TEST_REMOTE)\n\n\nclass TestDataCloudErrorCLI(TestDvc):\n def main_fail(self, args):\n ret = main(args)\n self.assertNotEqual(ret, 0)\n\n def test_error(self):\n f = \"non-existing-file\"\n self.main_fail([\"status\", \"-c\", f])\n self.main_fail([\"push\", f])\n self.main_fail([\"pull\", f])\n self.main_fail([\"fetch\", f])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestRecursiveSyncOperations_TestRecursiveSyncOperations._clear_local_cache.shutil_rmtree_self_dvc_ca": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestRecursiveSyncOperations_TestRecursiveSyncOperations._clear_local_cache.shutil_rmtree_self_dvc_ca", "embedding": null, "metadata": {"file_path": "tests/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 656, "end_line": 696, "span_ids": ["TestRecursiveSyncOperations", "TestRecursiveSyncOperations._should_test", "TestRecursiveSyncOperations._get_cloud_class", "TestRecursiveSyncOperations._remove_local_data_files", "TestRecursiveSyncOperations.main", "TestRecursiveSyncOperations._test_recursive_pull", "TestRecursiveSyncOperations._prepare_repo", "TestRecursiveSyncOperations._clear_local_cache", "TestRecursiveSyncOperations._get_url"], "tokens": 242}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRecursiveSyncOperations(TestDataCloudBase):\n def main(self, args):\n ret = main(args)\n self.assertEqual(ret, 0)\n\n def _get_url(self):\n self.dname = get_local_url()\n return self.dname\n\n def _should_test(self):\n return True\n\n def _get_cloud_class(self):\n return RemoteLOCAL\n\n def _prepare_repo(self):\n self.main(\n [\"remote\", \"add\", \"-d\", TEST_REMOTE, self.cloud._cloud.cache_dir]\n )\n\n self.dvc.add(self.DATA)\n self.dvc.add(self.DATA_SUB)\n\n def _remove_local_data_files(self):\n os.remove(self.DATA)\n os.remove(self.DATA_SUB)\n\n def _test_recursive_pull(self):\n self._remove_local_data_files()\n self._clear_local_cache()\n\n self.assertFalse(os.path.exists(self.DATA))\n self.assertFalse(os.path.exists(self.DATA_SUB))\n\n self.main([\"pull\", \"-R\", self.DATA_DIR])\n\n self.assertTrue(os.path.exists(self.DATA))\n self.assertTrue(os.path.exists(self.DATA_SUB))\n\n def _clear_local_cache(self):\n shutil.rmtree(self.dvc.cache.local.cache_dir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestRecursiveSyncOperations._test_recursive_fetch_TestRecursiveSyncOperations._test_recursive_fetch.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestRecursiveSyncOperations._test_recursive_fetch_TestRecursiveSyncOperations._test_recursive_fetch.None_5", "embedding": null, "metadata": {"file_path": "tests/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 700, "end_line": 712, "span_ids": ["TestRecursiveSyncOperations._test_recursive_fetch"], "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 TestRecursiveSyncOperations(TestDataCloudBase):\n\n def _test_recursive_fetch(self, data_md5, data_sub_md5):\n self._clear_local_cache()\n\n local_cache_data_path = self.dvc.cache.local.get(data_md5)\n local_cache_data_sub_path = self.dvc.cache.local.get(data_sub_md5)\n\n self.assertFalse(os.path.exists(local_cache_data_path))\n self.assertFalse(os.path.exists(local_cache_data_sub_path))\n\n self.main([\"fetch\", \"-R\", self.DATA_DIR])\n\n self.assertTrue(os.path.exists(local_cache_data_path))\n self.assertTrue(os.path.exists(local_cache_data_sub_path))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestRecursiveSyncOperations._test_recursive_push_TestRecursiveSyncOperations.test.self__test_recursive_pull": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestRecursiveSyncOperations._test_recursive_push_TestRecursiveSyncOperations.test.self__test_recursive_pull", "embedding": null, "metadata": {"file_path": "tests/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 714, "end_line": 737, "span_ids": ["TestRecursiveSyncOperations._test_recursive_push", "TestRecursiveSyncOperations.test"], "tokens": 198}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRecursiveSyncOperations(TestDataCloudBase):\n\n def _test_recursive_push(self, data_md5, data_sub_md5):\n cloud_data_path = self.cloud._cloud.get(data_md5)\n cloud_data_sub_path = self.cloud._cloud.get(data_sub_md5)\n\n self.assertFalse(os.path.exists(cloud_data_path))\n self.assertFalse(os.path.exists(cloud_data_sub_path))\n\n self.main([\"push\", \"-R\", self.DATA_DIR])\n\n self.assertTrue(os.path.exists(cloud_data_path))\n self.assertTrue(os.path.exists(cloud_data_sub_path))\n\n def test(self):\n self._setup_cloud()\n self._prepare_repo()\n\n data_md5 = file_md5(self.DATA)[0]\n data_sub_md5 = file_md5(self.DATA_SUB)[0]\n\n self._test_recursive_push(data_md5, data_sub_md5)\n\n self._test_recursive_fetch(data_md5, data_sub_md5)\n\n self._test_recursive_pull()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_dependency.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_dependency.py__", "embedding": null, "metadata": {"file_path": "tests/test_dependency.py", "file_name": "test_dependency.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 16, "span_ids": ["imports", "TestDepScheme._get", "TestDepScheme"], "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": "from dvc.stage import Stage\nfrom dvc.dependency import _get, DEP_MAP\n\nfrom tests.test_output import TestOutScheme\n\n\nclass TestDepScheme(TestOutScheme):\n MAP = DEP_MAP\n\n TESTS = TestOutScheme.TESTS.copy()\n TESTS[\"http://example.com/path/to/file\"] = \"http\"\n TESTS[\"https://example.com/path/to/file\"] = \"https\"\n\n def _get(self, path):\n return _get(Stage(self.dvc), path, 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/test_destroy.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_destroy.py_os_", "embedding": null, "metadata": {"file_path": "tests/test_destroy.py", "file_name": "test_destroy.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 22, "span_ids": ["imports", "TestDestroyForce", "TestDestroyNoConfirmation", "TestDestroyNoConfirmation.test", "TestDestroyForce.test"], "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 os\n\nfrom dvc.main import main\n\nfrom tests.test_repro import TestRepro\n\n\nclass TestDestroyNoConfirmation(TestRepro):\n def test(self):\n ret = main([\"destroy\"])\n self.assertNotEqual(ret, 0)\n\n\nclass TestDestroyForce(TestRepro):\n def test(self):\n ret = main([\"destroy\", \"-f\"])\n self.assertEqual(ret, 0)\n\n self.assertFalse(os.path.exists(self.dvc.dvc_dir))\n self.assertFalse(os.path.exists(self.file1_stage))\n self.assertFalse(os.path.exists(self.file1))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_gc.py_os_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/test_gc.py_os_TestGC._test_gc.for_c_in_self_good_cache_.self_assertTrue_os_path_e", "embedding": null, "metadata": {"file_path": "tests/test_gc.py", "file_name": "test_gc.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 44, "span_ids": ["TestGC.test_cli", "imports", "TestGC", "TestGC.setUp", "TestGC.test_api", "TestGC._test_gc"], "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 os\nimport configobj\n\nfrom git import Repo\n\nfrom dvc.main import main\nfrom dvc.repo import Repo as DvcRepo\n\nfrom tests.basic_env import TestDvc\nfrom tests.basic_env import TestDir\n\n\nclass TestGC(TestDvc):\n def setUp(self):\n super(TestGC, self).setUp()\n\n self.dvc.add(self.FOO)\n self.dvc.add(self.DATA_DIR)\n self.good_cache = [\n self.dvc.cache.local.get(md5) for md5 in self.dvc.cache.local.all()\n ]\n\n self.bad_cache = []\n for i in [\"123\", \"234\", \"345\"]:\n path = os.path.join(self.dvc.cache.local.cache_dir, i[0:2], i[2:])\n self.create(path, i)\n self.bad_cache.append(path)\n\n def test_api(self):\n self.dvc.gc()\n self._test_gc()\n\n def test_cli(self):\n ret = main([\"gc\", \"-f\"])\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/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/test_gc.py_TestGCBranchesTags_TestGCBranchesTags.test.self__check_cache_1_", "embedding": null, "metadata": {"file_path": "tests/test_gc.py", "file_name": "test_gc.py", "file_type": "text/x-python", "category": "test", "start_line": 47, "end_line": 104, "span_ids": ["TestGCBranchesTags.test", "TestGCBranchesTags", "TestGCBranchesTags._check_cache"], "tokens": 508}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestGCBranchesTags(TestDvc):\n def _check_cache(self, num):\n total = 0\n for root, dirs, files in os.walk(os.path.join(\".dvc\", \"cache\")):\n total += len(files)\n self.assertEqual(total, num)\n\n def test(self):\n fname = \"file\"\n\n with open(fname, \"w+\") as fobj:\n fobj.write(\"v1.0\")\n\n stages = self.dvc.add(fname)\n self.assertEqual(len(stages), 1)\n self.dvc.scm.add([\".gitignore\", stages[0].relpath])\n self.dvc.scm.commit(\"v1.0\")\n self.dvc.scm.tag(\"v1.0\")\n\n self.dvc.scm.checkout(\"test\", create_new=True)\n self.dvc.remove(stages[0].relpath, outs_only=True)\n with open(fname, \"w+\") as fobj:\n fobj.write(\"test\")\n stages = self.dvc.add(fname)\n self.assertEqual(len(stages), 1)\n self.dvc.scm.add([\".gitignore\", stages[0].relpath])\n self.dvc.scm.commit(\"test\")\n\n self.dvc.scm.checkout(\"master\")\n self.dvc.remove(stages[0].relpath, outs_only=True)\n with open(fname, \"w+\") as fobj:\n fobj.write(\"trash\")\n stages = self.dvc.add(fname)\n self.assertEqual(len(stages), 1)\n self.dvc.scm.add([\".gitignore\", stages[0].relpath])\n self.dvc.scm.commit(\"trash\")\n\n self.dvc.remove(stages[0].relpath, outs_only=True)\n with open(fname, \"w+\") as fobj:\n fobj.write(\"master\")\n stages = self.dvc.add(fname)\n self.assertEqual(len(stages), 1)\n self.dvc.scm.add([\".gitignore\", stages[0].relpath])\n self.dvc.scm.commit(\"master\")\n\n self._check_cache(4)\n\n self.dvc.gc(all_tags=True, all_branches=True)\n\n self._check_cache(3)\n\n self.dvc.gc(all_tags=False, all_branches=True)\n\n self._check_cache(2)\n\n self.dvc.gc(all_tags=True, all_branches=False)\n\n self._check_cache(1)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/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/test_gc.py_TestGCMultipleDvcRepos_TestGCMultipleDvcRepos.setUp.self.additional_dvc_7.DvcRepo_self_additional_p", "embedding": null, "metadata": {"file_path": "tests/test_gc.py", "file_name": "test_gc.py", "file_type": "text/x-python", "category": "test", "start_line": 107, "end_line": 129, "span_ids": ["TestGCMultipleDvcRepos", "TestGCMultipleDvcRepos.setUp", "TestGCMultipleDvcRepos._check_cache"], "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 TestGCMultipleDvcRepos(TestDvc):\n def _check_cache(self, num):\n total = 0\n for root, dirs, files in os.walk(os.path.join(\".dvc\", \"cache\")):\n total += len(files)\n self.assertEqual(total, num)\n\n def setUp(self):\n super(TestGCMultipleDvcRepos, self).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/test_gc.py_TestGCMultipleDvcRepos.test_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_gc.py_TestGCMultipleDvcRepos.test_", "embedding": null, "metadata": {"file_path": "tests/test_gc.py", "file_name": "test_gc.py", "file_type": "text/x-python", "category": "test", "start_line": 131, "end_line": 176, "span_ids": ["TestGCMultipleDvcRepos.test"], "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 TestGCMultipleDvcRepos(TestDvc):\n\n def test(self):\n\n # ADD FILE ONLY IN MAIN PROJECT\n fname = \"only_in_first\"\n with open(fname, \"w+\") as fobj:\n fobj.write(\"only in main repo\")\n\n stages = self.dvc.add(fname)\n self.assertEqual(len(stages), 1)\n\n # ADD FILE IN MAIN PROJECT THAT IS ALSO IN SECOND PROJECT\n fname = \"in_both\"\n with open(fname, \"w+\") as fobj:\n fobj.write(\"in both repos\")\n\n stages = self.dvc.add(fname)\n self.assertEqual(len(stages), 1)\n\n cwd = os.getcwd()\n os.chdir(self.additional_path)\n # ADD FILE ONLY IN SECOND PROJECT\n fname = os.path.join(self.additional_path, \"only_in_second\")\n with open(fname, \"w+\") as fobj:\n fobj.write(\"only in additional repo\")\n\n stages = self.additional_dvc.add(fname)\n self.assertEqual(len(stages), 1)\n\n # ADD FILE IN SECOND PROJECT THAT IS ALSO IN MAIN PROJECT\n fname = os.path.join(self.additional_path, \"in_both\")\n with open(fname, \"w+\") as fobj:\n fobj.write(\"in both repos\")\n\n stages = self.additional_dvc.add(fname)\n self.assertEqual(len(stages), 1)\n\n os.chdir(cwd)\n\n self._check_cache(3)\n\n self.dvc.gc(repos=[self.additional_path])\n self._check_cache(3)\n\n self.dvc.gc()\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/test_import.py_TestFailedImportMessage_TestFailedImportMessage._test.with_MockLoggerHandlers_l.self_assertIn_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_import.py_TestFailedImportMessage_TestFailedImportMessage._test.with_MockLoggerHandlers_l.self_assertIn_", "embedding": null, "metadata": {"file_path": "tests/test_import.py", "file_name": "test_import.py", "file_type": "text/x-python", "category": "test", "start_line": 48, "end_line": 70, "span_ids": ["TestFailedImportMessage.test", "TestFailedImportMessage._test", "TestFailedImportMessage"], "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 TestFailedImportMessage(TestDvc):\n def test(self):\n with ConsoleFontColorsRemover():\n self._test()\n\n @patch(\"dvc.command.imp.urlparse\")\n def _test(self, imp_urlparse_patch):\n with MockLoggerHandlers(logger.logger):\n reset_logger_error_output()\n page_address = \"http://somesite.com/file_name\"\n\n def dvc_exception(*args, **kwargs):\n raise DvcException(\"message\")\n\n imp_urlparse_patch.side_effect = dvc_exception\n main([\"import\", page_address])\n self.assertIn(\n \"Error: failed to import \"\n \"http://somesite.com/file_name. You could also try \"\n \"downloading it manually and adding it with `dvc add` \"\n \"command.\",\n logger.logger.handlers[1].stream.getvalue(),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_import.py_TestInterruptedDownload_TestInterruptedDownload._import_with_interrupt.with_patch_.with_patch_.self_assertEqual_result_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_import.py_TestInterruptedDownload_TestInterruptedDownload._import_with_interrupt.with_patch_.with_patch_.self_assertEqual_result_", "embedding": null, "metadata": {"file_path": "tests/test_import.py", "file_name": "test_import.py", "file_type": "text/x-python", "category": "test", "start_line": 76, "end_line": 106, "span_ids": ["TestInterruptedDownload._import_with_interrupt", "TestInterruptedDownload.remote", "TestInterruptedDownload._prepare_interrupted_download", "TestInterruptedDownload"], "tokens": 240}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestInterruptedDownload(TestDvc):\n @property\n def remote(self):\n return \"http://localhost:8000/\"\n\n def _prepare_interrupted_download(self):\n import_url = urljoin(self.remote, self.FOO)\n import_output = \"imported_file\"\n tmp_file_name = import_output + \".part\"\n tmp_file_path = os.path.realpath(\n os.path.join(self._root_dir, tmp_file_name)\n )\n self._import_with_interrupt(import_output, import_url)\n self.assertTrue(os.path.exists(tmp_file_name))\n self.assertFalse(os.path.exists(import_output))\n return import_output, import_url, tmp_file_path\n\n def _import_with_interrupt(self, import_output, import_url):\n def interrupting_generator():\n yield self.FOO[0].encode(\"utf8\")\n raise KeyboardInterrupt\n\n with patch(\n \"requests.models.Response.iter_content\",\n return_value=interrupting_generator(),\n ):\n with patch(\n \"dvc.remote.http.RemoteHTTP._content_length\", return_value=3\n ):\n result = main([\"import\", import_url, import_output])\n self.assertEqual(result, 252)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_import.py_TestShouldResumeDownload_TestShouldResumeDownload.test.m_handle_write_assert_has": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_import.py_TestShouldResumeDownload_TestShouldResumeDownload.test.m_handle_write_assert_has", "embedding": null, "metadata": {"file_path": "tests/test_import.py", "file_name": "test_import.py", "file_type": "text/x-python", "category": "test", "start_line": 109, "end_line": 126, "span_ids": ["TestShouldResumeDownload", "TestShouldResumeDownload.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 TestShouldResumeDownload(TestInterruptedDownload):\n @patch(\"dvc.remote.http.RemoteHTTP.CHUNK_SIZE\", 1)\n def test(self):\n with StaticFileServer():\n import_output, import_url, tmp_file_path = (\n self._prepare_interrupted_download()\n )\n\n m = mock_open()\n with patch(\"dvc.remote.http.open\", m):\n result = main(\n [\"import\", \"--resume\", import_url, import_output]\n )\n self.assertEqual(result, 0)\n m.assert_called_once_with(tmp_file_path, \"ab\")\n m_handle = m()\n expected_calls = [call(b\"o\"), call(b\"o\")]\n m_handle.write.assert_has_calls(expected_calls, any_order=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/test_init.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_init.py_os_", "embedding": null, "metadata": {"file_path": "tests/test_init.py", "file_name": "test_init.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 67, "span_ids": ["TestInitNoSCM._test_init", "TestInit", "TestInitNoSCMFail.test_api", "TestDoubleInit", "TestInit._test_init", "imports", "TestInitNoSCMFail", "TestInitNoSCMFail.test_cli", "TestInit.test_api", "TestInitNoSCM.test_api", "TestInitNoSCM", "TestDoubleInit.test", "TestInit.test_cli", "TestInitNoSCM.test_cli"], "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 os\n\nfrom dvc.main import main\nfrom dvc.repo import Repo as DvcRepo\nfrom dvc.exceptions import InitError\n\nfrom tests.basic_env import TestGit, TestDir\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\nclass TestInitNoSCM(TestDir):\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(no_scm=True)\n\n self._test_init()\n\n def test_cli(self):\n ret = main([\"init\", \"--no-scm\"])\n self.assertEqual(ret, 0)\n\n self._test_init()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_install.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_install.py_os_", "embedding": null, "metadata": {"file_path": "tests/test_install.py", "file_name": "test_install.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 34, "span_ids": ["TestInstall.test", "imports", "TestInstall"], "tokens": 206}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport sys\nimport unittest\n\nfrom dvc.main import main\n\nfrom tests.basic_env import TestDvc\n\n\n@unittest.skipIf(\n sys.platform == \"win32\", \"Git hooks aren't supported on Windows\"\n)\nclass TestInstall(TestDvc):\n def test(self):\n ret = main([\"install\"])\n self.assertEqual(ret, 0)\n\n ret = main([\"install\"])\n self.assertNotEqual(ret, 0)\n\n def hook(name):\n return os.path.join(\".git\", \"hooks\", name)\n\n self.assertTrue(os.path.isfile(hook(\"post-checkout\")))\n self.assertTrue(os.path.isfile(hook(\"pre-commit\")))\n\n self.dvc.add(self.FOO)\n self.dvc.scm.add([\".gitignore\", self.FOO + \".dvc\"])\n self.dvc.scm.commit(\"add\")\n os.unlink(self.FOO)\n\n self.dvc.scm.checkout(\"branch\", create_new=True)\n self.assertTrue(os.path.isfile(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/test_lock.py_from_dvc_lock_import_Lock_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_lock.py_from_dvc_lock_import_Lock_", "embedding": null, "metadata": {"file_path": "tests/test_lock.py", "file_name": "test_lock.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 22, "span_ids": ["TestLock.test_cli", "imports", "TestLock.test_with", "TestLock"], "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": "from dvc.lock import LockError\nfrom dvc.main import main\nfrom dvc.lock import Lock\n\nfrom tests.basic_env import TestDvc\n\n\nclass TestLock(TestDvc):\n def test_with(self):\n lock = Lock(self.dvc.dvc_dir)\n with lock:\n with self.assertRaises(LockError):\n lock2 = Lock(self.dvc.dvc_dir)\n with lock2:\n self.assertTrue(False)\n\n def test_cli(self):\n lock = Lock(self.dvc.dvc_dir)\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/test_logger.py_traceback_TestLogger.test_error_with_chained_exception_and_message.self_assertEqual_self_std": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_logger.py_traceback_TestLogger.test_error_with_chained_exception_and_message.self_assertEqual_self_std", "embedding": null, "metadata": {"file_path": "tests/test_logger.py", "file_name": "test_logger.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 111, "span_ids": ["TestLogger.test_error", "TestLogger.test_error_with_exception", "imports", "TestLogger", "TestLogger.test_debug", "TestLogger.tearDown", "TestLogger.test_error_with_chained_exception_and_message", "TestLogger.stderr", "TestLogger.setUp", "TestLogger.stdout", "TestLogger.test_info", "TestLogger.test_error_with_exception_and_message", "TestLogger.test_warning"], "tokens": 608}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import traceback\nfrom unittest import TestCase\n\nimport logging\nimport dvc.logger as logger\nfrom dvc.command.base import CmdBase\nfrom dvc.exceptions import DvcException\nfrom tests.utils import reset_logger_error_output, reset_logger_standard_output\nfrom tests.utils.logger import ConsoleFontColorsRemover\n\n\nclass TestLogger(TestCase):\n handlers = logger.logger.handlers\n\n def setUp(self):\n logger.logger.handlers = [\n logger.logging.StreamHandler(),\n logger.logging.StreamHandler(),\n ]\n reset_logger_standard_output()\n reset_logger_error_output()\n logger.set_default_level()\n\n self.consoleColorRemover = ConsoleFontColorsRemover()\n self.consoleColorRemover.__enter__()\n\n def tearDown(self):\n logger.logger.handlers = self.handlers\n logger.be_verbose()\n self.consoleColorRemover.__exit__()\n\n @property\n def stdout(self):\n return logger.logger.handlers[0].stream.getvalue()\n\n @property\n def stderr(self):\n return logger.logger.handlers[1].stream.getvalue()\n\n def test_info(self):\n logger.info(\"message\")\n\n self.assertEqual(self.stdout, \"message\\n\")\n\n def test_debug(self):\n with logger.verbose():\n logger.debug(\"message\")\n\n self.assertEqual(self.stdout, \"Debug: message\\n\")\n\n def test_warning(self):\n logger.warning(\"message\")\n\n self.assertEqual(self.stdout, \"Warning: message\\n\")\n\n def test_error(self):\n logger.error(\"message\")\n\n output = (\n \"Error: message\\n\"\n \"\\n\"\n \"Having any troubles? Hit us up at https://dvc.org/support,\"\n \" we are always happy to help!\\n\"\n )\n\n self.assertEqual(self.stderr, output)\n\n def test_error_with_exception(self):\n try:\n raise Exception(\"exception description\")\n except Exception:\n logger.error(\"\")\n\n output = (\n \"Error: exception description\\n\"\n \"\\n\"\n \"Having any troubles? Hit us up at https://dvc.org/support,\"\n \" we are always happy to help!\\n\"\n )\n\n self.assertEqual(self.stderr, output)\n\n def test_error_with_exception_and_message(self):\n try:\n raise Exception(\"exception description\")\n except Exception:\n logger.error(\"message\")\n\n output = (\n \"Error: message - exception description\\n\"\n \"\\n\"\n \"Having any troubles? Hit us up at https://dvc.org/support,\"\n \" we are always happy to help!\\n\"\n )\n\n self.assertEqual(self.stderr, output)\n\n def test_error_with_chained_exception_and_message(self):\n try:\n raise DvcException(\"exception\", cause=Exception(\"cause\"))\n except Exception:\n logger.error(\"message\")\n\n output = (\n \"Error: message - exception: cause\\n\"\n \"\\n\"\n \"Having any troubles? Hit us up at https://dvc.org/support,\"\n \" we are always happy to help!\\n\"\n )\n\n self.assertEqual(self.stderr, 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/test_logger.py_TestLogger.test_traceback_TestLogger.test_traceback.self_assertEqual_self_std": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_logger.py_TestLogger.test_traceback_TestLogger.test_traceback.self_assertEqual_self_std", "embedding": null, "metadata": {"file_path": "tests/test_logger.py", "file_name": "test_logger.py", "file_type": "text/x-python", "category": "test", "start_line": 112, "end_line": 146, "span_ids": ["TestLogger.test_traceback"], "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 TestLogger(TestCase):\n\n def test_traceback(self):\n stack_trace1 = \"stack_trace1\\n\"\n stack_trace2 = \"stack_trace2\\n\"\n try:\n exc1 = Exception(\"exception1\")\n exc2 = DvcException(\"exception2\", cause=exc1)\n exc2.cause_tb = stack_trace1\n exc3 = DvcException(\"exception3\", cause=exc2)\n exc3.cause_tb = stack_trace2\n raise exc3\n except Exception:\n stack_trace3 = traceback.format_exc()\n with logger.verbose():\n logger.error(\"message\")\n\n output = (\n \"Error: message - exception3: exception2: exception1\\n\"\n \"{line}\\n\"\n \"{stack_trace1}\"\n \"\\n\"\n \"{stack_trace2}\"\n \"\\n\"\n \"{stack_trace3}\"\n \"{line}\\n\"\n \"\\n\"\n \"Having any troubles? Hit us up at https://dvc.org/support,\"\n \" we are always happy to help!\\n\"\n ).format(\n line=\"-\" * 60,\n stack_trace1=stack_trace1,\n stack_trace2=stack_trace2,\n stack_trace3=stack_trace3,\n )\n\n self.assertEqual(self.stderr, 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/test_logger.py_TestLogger.test_box_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_logger.py_TestLogger.test_box_", "embedding": null, "metadata": {"file_path": "tests/test_logger.py", "file_name": "test_logger.py", "file_type": "text/x-python", "category": "test", "start_line": 148, "end_line": 190, "span_ids": ["TestLogger.test_level", "TestLogger.test_cli", "TestLogger.test_is_quiet", "TestLogger.test_is_verbose", "TestLogger.test_box"], "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 TestLogger(TestCase):\n\n def test_box(self):\n logger.box(\"message\")\n\n output = (\n \"+-----------------+\\n\"\n \"| |\\n\"\n \"| message |\\n\"\n \"| |\\n\"\n \"+-----------------+\\n\"\n \"\\n\"\n )\n\n self.assertEqual(self.stdout, output)\n\n def test_level(self):\n self.assertEqual(logger.level(), logging.INFO)\n\n def test_is_verbose(self):\n self.assertFalse(logger.is_verbose())\n\n with logger.verbose():\n self.assertTrue(logger.is_verbose())\n\n def test_is_quiet(self):\n self.assertFalse(logger.is_quiet())\n\n with logger.quiet():\n self.assertFalse(logger.is_verbose())\n\n def test_cli(self):\n class A(object):\n quiet = True\n verbose = False\n\n args = A()\n CmdBase.set_loglevel(args)\n self.assertEqual(logger.logger.getEffectiveLevel(), logging.CRITICAL)\n\n args.quiet = False\n args.verbose = True\n CmdBase.set_loglevel(args)\n self.assertEqual(logger.logger.getEffectiveLevel(), logging.DEBUG)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetrics.test_show_TestMetrics.test_show.None_23": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetrics.test_show_TestMetrics.test_show.None_23", "embedding": null, "metadata": {"file_path": "tests/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 59, "end_line": 104, "span_ids": ["TestMetrics.test_show"], "tokens": 512}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestMetrics(TestDvc):\n\n def test_show(self):\n ret = self.dvc.metrics.show(\"metric\", all_branches=True)\n self.assertEqual(len(ret), 3)\n self.assertEqual(ret[\"foo\"][\"metric\"], \"foo\")\n self.assertEqual(ret[\"bar\"][\"metric\"], \"bar\")\n self.assertEqual(ret[\"baz\"][\"metric\"], \"baz\")\n\n ret = self.dvc.metrics.show(\n \"metric_json\", typ=\"json\", xpath=\"branch\", all_branches=True\n )\n self.assertEqual(len(ret), 3)\n self.assertSequenceEqual(ret[\"foo\"][\"metric_json\"], [\"foo\"])\n self.assertSequenceEqual(ret[\"bar\"][\"metric_json\"], [\"bar\"])\n self.assertSequenceEqual(ret[\"baz\"][\"metric_json\"], [\"baz\"])\n\n ret = self.dvc.metrics.show(\n \"metric_tsv\", typ=\"tsv\", xpath=\"0,0\", all_branches=True\n )\n self.assertEqual(len(ret), 3)\n self.assertSequenceEqual(ret[\"foo\"][\"metric_tsv\"], [\"foo\"])\n self.assertSequenceEqual(ret[\"bar\"][\"metric_tsv\"], [\"bar\"])\n self.assertSequenceEqual(ret[\"baz\"][\"metric_tsv\"], [\"baz\"])\n\n ret = self.dvc.metrics.show(\n \"metric_htsv\", typ=\"htsv\", xpath=\"0,branch\", all_branches=True\n )\n self.assertEqual(len(ret), 3)\n self.assertSequenceEqual(ret[\"foo\"][\"metric_htsv\"], [\"foo\"])\n self.assertSequenceEqual(ret[\"bar\"][\"metric_htsv\"], [\"bar\"])\n self.assertSequenceEqual(ret[\"baz\"][\"metric_htsv\"], [\"baz\"])\n\n ret = self.dvc.metrics.show(\n \"metric_csv\", typ=\"csv\", xpath=\"0,0\", all_branches=True\n )\n self.assertEqual(len(ret), 3)\n self.assertSequenceEqual(ret[\"foo\"][\"metric_csv\"], [\"foo\"])\n self.assertSequenceEqual(ret[\"bar\"][\"metric_csv\"], [\"bar\"])\n self.assertSequenceEqual(ret[\"baz\"][\"metric_csv\"], [\"baz\"])\n\n ret = self.dvc.metrics.show(\n \"metric_hcsv\", typ=\"hcsv\", xpath=\"0,branch\", all_branches=True\n )\n self.assertEqual(len(ret), 3)\n self.assertSequenceEqual(ret[\"foo\"][\"metric_hcsv\"], [\"foo\"])\n self.assertSequenceEqual(ret[\"bar\"][\"metric_hcsv\"], [\"bar\"])\n self.assertSequenceEqual(ret[\"baz\"][\"metric_hcsv\"], [\"baz\"])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetrics.test_unknown_type_ignored_TestMetrics.test_xpath_all_with_header.for_b_in_foo_bar_.self_assertSequenceEqual_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetrics.test_unknown_type_ignored_TestMetrics.test_xpath_all_with_header.for_b_in_foo_bar_.self_assertSequenceEqual_", "embedding": null, "metadata": {"file_path": "tests/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 107, "end_line": 169, "span_ids": ["TestMetrics.test_type_case_normalized", "TestMetrics.test_unknown_type_ignored", "TestMetrics.test_xpath_is_empty", "TestMetrics.test_xpath_all_with_header", "TestMetrics.test_xpath_is_none", "TestMetrics.test_xpath_all_rows", "TestMetrics.test_xpath_all", "TestMetrics.test_xpath_all_columns"], "tokens": 608}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestMetrics(TestDvc):\n\n def test_unknown_type_ignored(self):\n ret = self.dvc.metrics.show(\n \"metric_hcsv\", typ=\"unknown\", xpath=\"0,branch\", all_branches=True\n )\n self.assertEqual(len(ret), 3)\n for b in [\"foo\", \"bar\", \"baz\"]:\n self.assertEqual(ret[b][\"metric_hcsv\"].split(), [\"branch\", b])\n\n def test_type_case_normalized(self):\n ret = self.dvc.metrics.show(\n \"metric_hcsv\", typ=\" hCSV \", xpath=\"0,branch\", all_branches=True\n )\n self.assertEqual(len(ret), 3)\n for b in [\"foo\", \"bar\", \"baz\"]:\n self.assertSequenceEqual(ret[b][\"metric_hcsv\"], [b])\n\n def test_xpath_is_empty(self):\n ret = self.dvc.metrics.show(\n \"metric_json\", typ=\"json\", xpath=\"\", all_branches=True\n )\n self.assertEqual(len(ret), 3)\n for b in [\"foo\", \"bar\", \"baz\"]:\n self.assertEqual(ret[b][\"metric_json\"], json.dumps({\"branch\": b}))\n\n def test_xpath_is_none(self):\n ret = self.dvc.metrics.show(\n \"metric_json\", typ=\"json\", xpath=None, all_branches=True\n )\n self.assertEqual(len(ret), 3)\n for b in [\"foo\", \"bar\", \"baz\"]:\n self.assertEqual(ret[b][\"metric_json\"], json.dumps({\"branch\": b}))\n\n def test_xpath_all_columns(self):\n ret = self.dvc.metrics.show(\n \"metric_hcsv\", typ=\"hcsv \", xpath=\"0,\", all_branches=True\n )\n self.assertEqual(len(ret), 3)\n for b in [\"foo\", \"bar\", \"baz\"]:\n self.assertSequenceEqual(ret[b][\"metric_hcsv\"], [b])\n\n def test_xpath_all_rows(self):\n ret = self.dvc.metrics.show(\n \"metric_csv\", typ=\"csv\", xpath=\",0\", all_branches=True\n )\n self.assertEqual(len(ret), 3)\n for b in [\"foo\", \"bar\", \"baz\"]:\n self.assertSequenceEqual(ret[b][\"metric_csv\"], [b])\n\n def test_xpath_all(self):\n ret = self.dvc.metrics.show(\n \"metric_csv\", typ=\"csv\", xpath=\",\", all_branches=True\n )\n self.assertEqual(len(ret), 3)\n for b in [\"foo\", \"bar\", \"baz\"]:\n self.assertSequenceEqual(ret[b][\"metric_csv\"], [[b]])\n\n def test_xpath_all_with_header(self):\n ret = self.dvc.metrics.show(\n \"metric_hcsv\", typ=\"hcsv\", xpath=\",\", all_branches=True\n )\n self.assertEqual(len(ret), 3)\n for b in [\"foo\", \"bar\", \"baz\"]:\n self.assertSequenceEqual(ret[b][\"metric_hcsv\"], [[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/test_metrics.py_TestMetricsRecursive_TestMetricsRecursive.setUp.self_dvc_scm_checkout_ma": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetricsRecursive_TestMetricsRecursive.setUp.self_dvc_scm_checkout_ma", "embedding": null, "metadata": {"file_path": "tests/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 285, "end_line": 328, "span_ids": ["TestMetricsRecursive", "TestMetricsRecursive.setUp"], "tokens": 249}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestMetricsRecursive(TestDvc):\n def setUp(self):\n super(TestMetricsRecursive, self).setUp()\n self.dvc.scm.commit(\"init\")\n\n self.dvc.scm.checkout(\"nested\", create_new=True)\n\n os.mkdir(\"nested\")\n os.mkdir(os.path.join(\"nested\", \"subnested\"))\n\n ret = main(\n [\n \"run\",\n \"-M\",\n os.path.join(\"nested\", \"metric_nested\"),\n \"echo\",\n \"nested\",\n \">>\",\n os.path.join(\"nested\", \"metric_nested\"),\n ]\n )\n\n self.assertEqual(ret, 0)\n\n ret = main(\n [\n \"run\",\n \"-M\",\n os.path.join(\"nested\", \"subnested\", \"metric_subnested\"),\n \"echo\",\n \"subnested\",\n \">>\",\n os.path.join(\"nested\", \"subnested\", \"metric_subnested\"),\n ]\n )\n\n self.assertEqual(ret, 0)\n\n self.dvc.scm.add(\n [\"nested\", \"metric_nested.dvc\", \"metric_subnested.dvc\"]\n )\n self.dvc.scm.commit(\"nested metrics\")\n\n self.dvc.scm.checkout(\"master\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetricsRecursive.test_TestMetricsRecursive.test.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetricsRecursive.test_TestMetricsRecursive.test.None_2", "embedding": null, "metadata": {"file_path": "tests/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 214, "end_line": 230, "span_ids": ["TestMetricsRecursive.test"], "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 TestMetricsRecursive(TestDvc):\n\n def test(self):\n with self.assertRaises(BadMetricError):\n self.dvc.metrics.show(\"nested\", all_branches=True, recursive=False)\n\n ret = self.dvc.metrics.show(\n \"nested\", all_branches=True, recursive=True\n )\n self.assertEqual(len(ret), 1)\n self.assertEqual(\n ret[\"nested\"][\n os.path.join(\"nested\", \"subnested\", \"metric_subnested\")\n ],\n \"subnested\",\n )\n self.assertEqual(\n ret[\"nested\"][os.path.join(\"nested\", \"metric_nested\")], \"nested\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetricsReproCLI_TestMetricsReproCLI.test_binary.with_self_assertRaises_Dv.self_dvc_run_metrics_no_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetricsReproCLI_TestMetricsReproCLI.test_binary.with_self_assertRaises_Dv.self_dvc_run_metrics_no_c", "embedding": null, "metadata": {"file_path": "tests/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 233, "end_line": 269, "span_ids": ["TestMetricsReproCLI.test_dir", "TestMetricsReproCLI.test", "TestMetricsReproCLI.test_binary", "TestMetricsReproCLI"], "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 TestMetricsReproCLI(TestDvc):\n def test(self):\n stage = self.dvc.run(\n metrics_no_cache=[\"metrics\"],\n cmd=\"python {} {} {}\".format(self.CODE, self.FOO, \"metrics\"),\n )\n\n ret = main([\"repro\", \"-m\", stage.path])\n self.assertEqual(ret, 0)\n\n ret = main([\"metrics\", \"remove\", \"metrics\"])\n self.assertEqual(ret, 0)\n\n ret = main([\"repro\", \"-f\", \"-m\", stage.path])\n self.assertNotEqual(ret, 0)\n\n ret = main([\"metrics\", \"add\", \"metrics\"])\n self.assertEqual(ret, 0)\n\n ret = main([\"metrics\", \"modify\", \"-t\", \"CSV\", \"-x\", \"0,0\", \"metrics\"])\n self.assertEqual(ret, 0)\n\n ret = main([\"repro\", \"-f\", \"-m\", stage.path])\n self.assertEqual(ret, 0)\n\n def test_dir(self):\n os.mkdir(\"metrics_dir\")\n\n with self.assertRaises(DvcException):\n self.dvc.run(metrics_no_cache=[\"metrics_dir\"])\n\n def test_binary(self):\n with open(\"metrics_bin\", \"w+\") as fd:\n fd.write(\"\\0\\0\\0\\0\\0\\0\\0\\0\")\n\n with self.assertRaises(DvcException):\n self.dvc.run(metrics_no_cache=[\"metrics_bin\"])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetricsCLI_TestMetricsCLI.test.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetricsCLI_TestMetricsCLI.test.None_5", "embedding": null, "metadata": {"file_path": "tests/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 272, "end_line": 326, "span_ids": ["TestMetricsCLI.test", "TestMetricsCLI"], "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 TestMetricsCLI(TestMetrics):\n def test(self):\n # FIXME check output\n ret = main([\"metrics\", \"show\", \"-a\", \"metric\", \"-v\"])\n self.assertEqual(ret, 0)\n\n ret = main(\n [\n \"metrics\",\n \"show\",\n \"-a\",\n \"metric_json\",\n \"-t\",\n \"json\",\n \"-x\",\n \"branch\",\n ]\n )\n self.assertEqual(ret, 0)\n ret = main(\n [\"metrics\", \"show\", \"-a\", \"metric_tsv\", \"-t\", \"tsv\", \"-x\", \"0,0\"]\n )\n self.assertEqual(ret, 0)\n ret = main(\n [\n \"metrics\",\n \"show\",\n \"-a\",\n \"metric_htsv\",\n \"-t\",\n \"htsv\",\n \"-x\",\n \"0,branch\",\n ]\n )\n self.assertEqual(ret, 0)\n\n ret = main(\n [\"metrics\", \"show\", \"-a\", \"metric_csv\", \"-t\", \"csv\", \"-x\", \"0,0\"]\n )\n self.assertEqual(ret, 0)\n\n ret = main(\n [\n \"metrics\",\n \"show\",\n \"-a\",\n \"metric_hcsv\",\n \"-t\",\n \"hcsv\",\n \"-x\",\n \"0,branch\",\n ]\n )\n self.assertEqual(ret, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetricsCLI.test_dir_TestMetricsCLI.test_non_existing.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetricsCLI.test_dir_TestMetricsCLI.test_non_existing.None_2", "embedding": null, "metadata": {"file_path": "tests/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 328, "end_line": 351, "span_ids": ["TestMetricsCLI.test_dir", "TestMetricsCLI.test_non_existing", "TestMetricsCLI.test_binary"], "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 TestMetricsCLI(TestMetrics):\n\n def test_dir(self):\n os.mkdir(\"metrics_dir\")\n\n with self.assertRaises(DvcException):\n self.dvc.run(outs_no_cache=[\"metrics_dir\"])\n self.dvc.metrics.add(\"metrics_dir\")\n\n def test_binary(self):\n with open(\"metrics_bin\", \"w+\") as fd:\n fd.write(\"\\0\\0\\0\\0\\0\\0\\0\\0\")\n\n with self.assertRaises(DvcException):\n self.dvc.run(outs_no_cache=[\"metrics_bin\"])\n self.dvc.metrics.add(\"metrics_bin\")\n\n def test_non_existing(self):\n ret = main([\"metrics\", \"add\", \"non-existing\"])\n self.assertNotEqual(ret, 0)\n\n ret = main([\"metrics\", \"modify\", \"non-existing\"])\n self.assertNotEqual(ret, 0)\n\n ret = main([\"metrics\", \"remove\", \"non-existing\"])\n self.assertNotEqual(ret, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetricsCLI.test_wrong_type_show_TestMetricsCLI.test_wrong_type_show.with_MockLoggerHandlers_l.self_assertIn_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetricsCLI.test_wrong_type_show_TestMetricsCLI.test_wrong_type_show.with_MockLoggerHandlers_l.self_assertIn_", "embedding": null, "metadata": {"file_path": "tests/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 531, "end_line": 556, "span_ids": ["TestMetricsCLI.test_wrong_type_show"], "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 TestMetricsCLI(TestMetrics):\n\n def test_wrong_type_show(self):\n with open(\"metric.unknown\", \"w+\") as fd:\n fd.write(\"unknown\")\n fd.flush()\n\n ret = main([\"run\", \"-m\", \"metric.unknown\"])\n self.assertEqual(ret, 0)\n\n with MockLoggerHandlers(logger.logger):\n reset_logger_standard_output()\n ret = main(\n [\n \"metrics\",\n \"show\",\n \"metric.unknown\",\n \"-t\",\n \"unknown\",\n \"-x\",\n \"0,0\",\n ]\n )\n self.assertEqual(ret, 0)\n self.assertIn(\n \"\\tmetric.unknown: unknown\",\n logger.logger.handlers[0].stream.getvalue(),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestNoMetrics_TestCachedMetrics._do_add.self_dvc_scm_commit_branc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestNoMetrics_TestCachedMetrics._do_add.self_dvc_scm_commit_branc", "embedding": null, "metadata": {"file_path": "tests/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 443, "end_line": 468, "span_ids": ["TestCachedMetrics._do_add", "TestNoMetrics", "TestNoMetrics.test_cli", "TestCachedMetrics", "TestNoMetrics.test"], "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 TestNoMetrics(TestDvc):\n def test(self):\n with self.assertRaises(NoMetricsError):\n self.dvc.metrics.show()\n\n def test_cli(self):\n ret = main([\"metrics\", \"show\"])\n self.assertNotEqual(ret, 0)\n\n\nclass TestCachedMetrics(TestDvc):\n def _do_add(self, branch):\n self.dvc.scm.checkout(branch)\n self.dvc.checkout(force=True)\n\n with open(\"metrics.json\", \"w+\") as fd:\n json.dump({\"metrics\": branch}, fd)\n\n stages = self.dvc.add(\"metrics.json\")\n self.dvc.metrics.add(\"metrics.json\", typ=\"json\", xpath=\"metrics\")\n self.assertEqual(len(stages), 1)\n stage = stages[0]\n self.assertIsNotNone(stage)\n\n self.dvc.scm.add([\".gitignore\", \"metrics.json.dvc\"])\n self.dvc.scm.commit(branch)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestCachedMetrics._do_run_TestCachedMetrics._do_run.self_dvc_scm_commit_branc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestCachedMetrics._do_run_TestCachedMetrics._do_run.self_dvc_scm_commit_branc", "embedding": null, "metadata": {"file_path": "tests/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 586, "end_line": 609, "span_ids": ["TestCachedMetrics._do_run"], "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 TestCachedMetrics(TestDvc):\n\n def _do_run(self, branch):\n self.dvc.scm.checkout(branch)\n self.dvc.checkout(force=True)\n\n with open(\"code.py\", \"w+\") as fobj:\n fobj.write(\"import sys\\n\")\n fobj.write(\"import os\\n\")\n fobj.write(\"import json\\n\")\n fobj.write(\n 'print(json.dumps({{\"metrics\": \"{branch}\"}}))\\n'.format(\n branch=branch\n )\n )\n\n stage = self.dvc.run(\n deps=[\"code.py\"],\n metrics=[\"metrics.json\"],\n cmd=\"python code.py metrics.json > metrics.json\",\n )\n self.assertIsNotNone(stage)\n self.assertEqual(stage.relpath, \"metrics.json.dvc\")\n\n self.dvc.scm.add([\"code.py\", \".gitignore\", \"metrics.json.dvc\"])\n self.dvc.scm.commit(branch)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestCachedMetrics._test_metrics_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestCachedMetrics._test_metrics_", "embedding": null, "metadata": {"file_path": "tests/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 611, "end_line": 658, "span_ids": ["TestCachedMetrics.test_run", "TestCachedMetrics._test_metrics", "TestCachedMetrics.test_add"], "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": "class TestCachedMetrics(TestDvc):\n\n def _test_metrics(self, func):\n self.dvc.scm.commit(\"init\")\n\n self.dvc.scm.branch(\"one\")\n self.dvc.scm.branch(\"two\")\n\n func(\"master\")\n func(\"one\")\n func(\"two\")\n\n # TestDvc currently is based on TestGit, so it is safe to use\n # scm.git for now\n self.dvc.scm.git.git.clean(\"-fd\")\n\n self.dvc = DvcRepo(\".\")\n\n res = self.dvc.metrics.show(\n \"metrics.json\", all_branches=True, typ=\"json\", xpath=\"metrics\"\n )\n\n self.assertEqual(\n res,\n {\n \"master\": {\"metrics.json\": [\"master\"]},\n \"one\": {\"metrics.json\": [\"one\"]},\n \"two\": {\"metrics.json\": [\"two\"]},\n },\n )\n\n res = self.dvc.metrics.show(\n \"\", all_branches=True, typ=\"json\", xpath=\"metrics\"\n )\n\n self.assertEqual(\n res,\n {\n \"master\": {\"metrics.json\": [\"master\"]},\n \"one\": {\"metrics.json\": [\"one\"]},\n \"two\": {\"metrics.json\": [\"two\"]},\n },\n )\n\n def test_add(self):\n self._test_metrics(self._do_add)\n\n def test_run(self):\n self._test_metrics(self._do_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/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/test_move.py_os_TestMoveNotDataSource.test.self_assertNotEqual_ret_", "embedding": null, "metadata": {"file_path": "tests/test_move.py", "file_name": "test_move.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 62, "span_ids": ["TestMove", "TestMoveNotDataSource", "TestMoveNonExistentFile", "imports", "TestCmdMove.test", "TestMoveNotDataSource.test", "TestMove.test", "TestMoveNonExistentFile.test", "TestMoveDirectory.test", "TestMoveDirectory", "TestCmdMove"], "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": "import os\n\nfrom dvc.main import main\nfrom dvc.exceptions import DvcException, MoveNotDataSourceError\nfrom dvc.stage import Stage\nfrom dvc.utils import load_stage_file\n\nfrom tests.basic_env import TestDvc\nfrom tests.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/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/test_move.py_TestMoveFileWithExtension_TestMoveFileWithExtension.test.None_7", "embedding": null, "metadata": {"file_path": "tests/test_move.py", "file_name": "test_move.py", "file_type": "text/x-python", "category": "test", "start_line": 64, "end_line": 80, "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/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/test_move.py_TestMoveFileToDirectory_TestMoveFileToDirectory.test.None_6", "embedding": null, "metadata": {"file_path": "tests/test_move.py", "file_name": "test_move.py", "file_type": "text/x-python", "category": "test", "start_line": 83, "end_line": 98, "span_ids": ["TestMoveFileToDirectory.test", "TestMoveFileToDirectory"], "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 TestMoveFileToDirectory(TestDvc):\n def test(self):\n foo_dvc_file = self.FOO + Stage.STAGE_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 + Stage.STAGE_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/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/test_move.py_TestMoveFileToDirectoryWithoutSpecifiedTargetName_TestMoveFileToDirectoryWithoutSpecifiedTargetName.test.self_assertEqual_self_FOO", "embedding": null, "metadata": {"file_path": "tests/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": 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 TestMoveFileToDirectoryWithoutSpecifiedTargetName(TestDvc):\n def test(self):\n foo_stage_file_path = self.FOO + Stage.STAGE_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 + Stage.STAGE_FILE_SUFFIX\n\n ret = main([\"move\", self.FOO, self.DATA_DIR])\n self.assertEqual(ret, 0)\n\n self.assertFalse(os.path.exists(self.FOO))\n self.assertFalse(os.path.exists(foo_stage_file_path))\n\n self.assertTrue(os.path.exists(target_foo_path))\n self.assertTrue(os.path.exists(target_foo_stage_file_path))\n\n new_stage = load_stage_file(target_foo_stage_file_path)\n self.assertEqual(self.FOO, new_stage[\"outs\"][0][\"path\"])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_move.py_TestMoveDirectoryShouldNotOverwriteExisting_TestMoveDirectoryShouldNotOverwriteExisting.test.self_assertEqual_os_listd": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_move.py_TestMoveDirectoryShouldNotOverwriteExisting_TestMoveDirectoryShouldNotOverwriteExisting.test.self_assertEqual_os_listd", "embedding": null, "metadata": {"file_path": "tests/test_move.py", "file_name": "test_move.py", "file_type": "text/x-python", "category": "test", "start_line": 124, "end_line": 142, "span_ids": ["TestMoveDirectoryShouldNotOverwriteExisting", "TestMoveDirectoryShouldNotOverwriteExisting.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 TestMoveDirectoryShouldNotOverwriteExisting(TestDvc):\n def test(self):\n new_dir_name = \"data_dir2\"\n os.mkdir(new_dir_name)\n ret = main([\"add\", self.DATA_DIR])\n self.assertEqual(ret, 0)\n\n ret = main([\"move\", self.DATA_DIR, new_dir_name])\n self.assertEqual(ret, 0)\n\n self.assertFalse(os.path.exists(self.DATA_DIR))\n self.assertFalse(\n os.path.exists(self.DATA_DIR + Stage.STAGE_FILE_SUFFIX)\n )\n\n self.assertTrue(os.path.exists(new_dir_name))\n self.assertTrue(os.path.isfile(new_dir_name + Stage.STAGE_FILE_SUFFIX))\n\n self.assertEqual(os.listdir(new_dir_name), [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/test_output.py_from_dvc_stage_import_Sta_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_output.py_from_dvc_stage_import_Sta_", "embedding": null, "metadata": {"file_path": "tests/test_output.py", "file_name": "test_output.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 31, "span_ids": ["imports", "TestOutScheme._get", "TestOutScheme", "TestOutScheme.test"], "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": "from dvc.stage import Stage\nfrom dvc.output import _get, OUTS_MAP\n\nfrom tests.basic_env import TestDvc\n\n\nclass TestOutScheme(TestDvc):\n MAP = OUTS_MAP\n\n TESTS = {\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 def _get(self, path):\n return _get(Stage(self.dvc), path, None, None, None, None)\n\n def test(self):\n for path, cls in self.TESTS.items():\n self.assertIsInstance(self._get(path), self.MAP[cls])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_pipeline.py_from_dvc_main_import_main_TestPipelineShowSingle.test_non_existing.self_assertNotEqual_ret_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_pipeline.py_from_dvc_main_import_main_TestPipelineShowSingle.test_non_existing.self_assertNotEqual_ret_", "embedding": null, "metadata": {"file_path": "tests/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 76, "span_ids": ["TestPipelineShowSingle.test_commands", "imports", "TestPipelineShowSingle.test_not_dvc_file", "TestPipelineShowSingle.test_outs", "TestPipelineShowSingle.test_non_existing", "TestPipelineShowSingle.test_tree", "TestPipelineShowSingle.test_dot_commands", "TestPipelineShowSingle", "TestPipelineShowSingle.setUp", "TestPipelineShowSingle.test", "TestPipelineShowSingle.test_ascii_outs", "TestPipelineShowSingle.test_ascii", "TestPipelineShowSingle.test_dot_outs", "TestPipelineShowSingle.test_dot", "TestPipelineShowSingle.test_ascii_commands"], "tokens": 534}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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.main import main\n\nfrom tests.basic_env import TestDvc\nfrom tests.test_repro import TestRepro, TestReproChangedDeepData\nimport os\n\n\nclass TestPipelineShowSingle(TestDvc):\n def setUp(self):\n super(TestPipelineShowSingle, self).setUp()\n self.stage = \"foo.dvc\"\n self.dotFile = \"graph.dot\"\n ret = main([\"add\", self.FOO])\n self.assertEqual(ret, 0)\n\n def test(self):\n ret = main([\"pipeline\", \"show\", self.stage])\n self.assertEqual(ret, 0)\n\n def test_commands(self):\n ret = main([\"pipeline\", \"show\", self.stage, \"--commands\"])\n self.assertEqual(ret, 0)\n\n def test_outs(self):\n ret = main([\"pipeline\", \"show\", self.stage, \"--outs\"])\n self.assertEqual(ret, 0)\n\n def test_ascii(self):\n ret = main([\"pipeline\", \"show\", \"--ascii\", self.stage])\n self.assertEqual(ret, 0)\n\n def test_dot(self):\n ret = main([\"pipeline\", \"show\", \"--dot\", self.dotFile, self.stage])\n self.assertEqual(ret, 0)\n self.assertTrue(os.path.isfile(self.dotFile))\n\n def test_tree(self):\n ret = main([\"pipeline\", \"show\", \"--tree\", self.stage])\n self.assertEqual(ret, 0)\n\n def test_ascii_commands(self):\n ret = main([\"pipeline\", \"show\", \"--ascii\", self.stage, \"--commands\"])\n self.assertEqual(ret, 0)\n\n def test_ascii_outs(self):\n ret = main([\"pipeline\", \"show\", \"--ascii\", self.stage, \"--outs\"])\n self.assertEqual(ret, 0)\n\n def test_dot_commands(self):\n ret = main(\n [\n \"pipeline\",\n \"show\",\n \"--dot\",\n self.dotFile,\n self.stage,\n \"--commands\",\n ]\n )\n self.assertEqual(ret, 0)\n self.assertTrue(os.path.isfile(self.dotFile))\n\n def test_dot_outs(self):\n ret = main(\n [\"pipeline\", \"show\", \"--dot\", self.dotFile, self.stage, \"--outs\"]\n )\n self.assertEqual(ret, 0)\n self.assertTrue(os.path.isfile(self.dotFile))\n\n def test_not_dvc_file(self):\n ret = main([\"pipeline\", \"show\", self.FOO])\n self.assertNotEqual(ret, 0)\n\n def test_non_existing(self):\n ret = main([\"pipeline\", \"show\", \"non-existing\"])\n self.assertNotEqual(ret, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_pipeline.py_TestPipelineShow_TestPipelineShow.test_non_existing.self_assertNotEqual_ret_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_pipeline.py_TestPipelineShow_TestPipelineShow.test_non_existing.self_assertNotEqual_ret_", "embedding": null, "metadata": {"file_path": "tests/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 75, "end_line": 147, "span_ids": ["TestPipelineShow.test_ascii_commands", "TestPipelineShow.test_commands", "TestPipelineShow", "TestPipelineShow.test_outs", "TestPipelineShow.test_non_existing", "TestPipelineShow.setUp", "TestPipelineShow.test_dot_commands", "TestPipelineShow.test_dot", "TestPipelineShow.test", "TestPipelineShow.test_dot_outs", "TestPipelineShow.test_ascii", "TestPipelineShow.test_not_dvc_file", "TestPipelineShow.test_ascii_outs"], "tokens": 473}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestPipelineShow(TestRepro):\n def setUp(self):\n super(TestPipelineShow, self).setUp()\n self.dotFile = \"graph.dot\"\n\n def test(self):\n ret = main([\"pipeline\", \"show\", self.file1_stage])\n self.assertEqual(ret, 0)\n\n def test_commands(self):\n ret = main([\"pipeline\", \"show\", self.file1_stage, \"--commands\"])\n self.assertEqual(ret, 0)\n\n def test_outs(self):\n ret = main([\"pipeline\", \"show\", self.file1_stage, \"--outs\"])\n self.assertEqual(ret, 0)\n\n def test_ascii(self):\n ret = main([\"pipeline\", \"show\", \"--ascii\", self.file1_stage])\n self.assertEqual(ret, 0)\n\n def test_dot(self):\n ret = main(\n [\"pipeline\", \"show\", \"--dot\", self.dotFile, self.file1_stage]\n )\n self.assertEqual(ret, 0)\n self.assertTrue(os.path.isfile(self.dotFile))\n\n def test_ascii_commands(self):\n ret = main(\n [\"pipeline\", \"show\", \"--ascii\", self.file1_stage, \"--commands\"]\n )\n self.assertEqual(ret, 0)\n\n def test_ascii_outs(self):\n ret = main([\"pipeline\", \"show\", \"--ascii\", self.file1_stage, \"--outs\"])\n self.assertEqual(ret, 0)\n\n def test_dot_commands(self):\n ret = main(\n [\n \"pipeline\",\n \"show\",\n \"--dot\",\n self.dotFile,\n self.file1_stage,\n \"--commands\",\n ]\n )\n self.assertEqual(ret, 0)\n self.assertTrue(os.path.isfile(self.dotFile))\n\n def test_dot_outs(self):\n ret = main(\n [\n \"pipeline\",\n \"show\",\n \"--dot\",\n self.dotFile,\n self.file1_stage,\n \"--outs\",\n ]\n )\n self.assertEqual(ret, 0)\n self.assertTrue(os.path.isfile(self.dotFile))\n\n def test_not_dvc_file(self):\n ret = main([\"pipeline\", \"show\", self.file1])\n self.assertNotEqual(ret, 0)\n\n def test_non_existing(self):\n ret = main([\"pipeline\", \"show\", \"non-existing\"])\n self.assertNotEqual(ret, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_pipeline.py_TestPipelineShowDeep_TestPipelineShowDeep.test_non_existing.self_assertNotEqual_ret_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_pipeline.py_TestPipelineShowDeep_TestPipelineShowDeep.test_non_existing.self_assertNotEqual_ret_", "embedding": null, "metadata": {"file_path": "tests/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 150, "end_line": 222, "span_ids": ["TestPipelineShowDeep.test_dot", "TestPipelineShowDeep.test_not_dvc_file", "TestPipelineShowDeep.test_non_existing", "TestPipelineShowDeep.test_dot_commands", "TestPipelineShowDeep.test_outs", "TestPipelineShowDeep.setUp", "TestPipelineShowDeep.test_ascii_commands", "TestPipelineShowDeep.test_ascii_outs", "TestPipelineShowDeep.test_dot_outs", "TestPipelineShowDeep", "TestPipelineShowDeep.test_ascii", "TestPipelineShowDeep.test", "TestPipelineShowDeep.test_commands"], "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": "class TestPipelineShowDeep(TestReproChangedDeepData):\n def setUp(self):\n super(TestPipelineShowDeep, self).setUp()\n self.dotFile = \"graph.dot\"\n\n def test(self):\n ret = main([\"pipeline\", \"show\", self.file1_stage])\n self.assertEqual(ret, 0)\n\n def test_commands(self):\n ret = main([\"pipeline\", \"show\", self.file1_stage, \"--commands\"])\n self.assertEqual(ret, 0)\n\n def test_outs(self):\n ret = main([\"pipeline\", \"show\", self.file1_stage, \"--outs\"])\n self.assertEqual(ret, 0)\n\n def test_ascii(self):\n ret = main([\"pipeline\", \"show\", \"--ascii\", self.file1_stage])\n self.assertEqual(ret, 0)\n\n def test_dot(self):\n ret = main(\n [\"pipeline\", \"show\", \"--dot\", self.dotFile, self.file1_stage]\n )\n self.assertEqual(ret, 0)\n self.assertTrue(os.path.isfile(self.dotFile))\n\n def test_ascii_commands(self):\n ret = main(\n [\"pipeline\", \"show\", \"--ascii\", self.file1_stage, \"--commands\"]\n )\n self.assertEqual(ret, 0)\n\n def test_ascii_outs(self):\n ret = main([\"pipeline\", \"show\", \"--ascii\", self.file1_stage, \"--outs\"])\n self.assertEqual(ret, 0)\n\n def test_dot_commands(self):\n ret = main(\n [\n \"pipeline\",\n \"show\",\n \"--dot\",\n self.dotFile,\n self.file1_stage,\n \"--commands\",\n ]\n )\n self.assertEqual(ret, 0)\n self.assertTrue(os.path.isfile(self.dotFile))\n\n def test_dot_outs(self):\n ret = main(\n [\n \"pipeline\",\n \"show\",\n \"--dot\",\n self.dotFile,\n self.file1_stage,\n \"--outs\",\n ]\n )\n self.assertEqual(ret, 0)\n self.assertTrue(os.path.isfile(self.dotFile))\n\n def test_not_dvc_file(self):\n ret = main([\"pipeline\", \"show\", self.file1])\n self.assertNotEqual(ret, 0)\n\n def test_non_existing(self):\n ret = main([\"pipeline\", \"show\", \"non-existing\"])\n self.assertNotEqual(ret, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_pipeline.py_TestPipelineListEmpty_TestDvcRepoPipeline.one_pipeline.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_pipeline.py_TestPipelineListEmpty_TestDvcRepoPipeline.one_pipeline.None_5", "embedding": null, "metadata": {"file_path": "tests/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 225, "end_line": 250, "span_ids": ["TestPipelineListEmpty", "TestPipelineListSingle.test", "TestDvcRepoPipeline.one_pipeline", "TestPipelineListSingle", "TestPipelineListEmpty.test", "TestDvcRepoPipeline", "TestDvcRepoPipeline.test_no_stages"], "tokens": 198}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestPipelineListEmpty(TestDvc):\n def test(self):\n ret = main([\"pipeline\", \"list\"])\n self.assertEqual(ret, 0)\n\n\nclass TestPipelineListSingle(TestPipelineShowDeep):\n def test(self):\n ret = main([\"pipeline\", \"list\"])\n self.assertEqual(ret, 0)\n\n\nclass TestDvcRepoPipeline(TestDvc):\n def test_no_stages(self):\n pipelines = self.dvc.pipelines()\n self.assertEqual(len(pipelines), 0)\n\n def one_pipeline(self):\n self.dvc.add(\"foo\")\n self.dvc.run(deps=[\"foo\"], outs=[\"bar\"], cmd=\"\")\n self.dvc.run(deps=[\"bar\"], outs=[\"baz\"], cmd=\"echo baz > baz\")\n pipelines = self.dvc.pipelines()\n\n self.assertEqual(len(pipelines), 1)\n self.assertEqual(pipelines[0].nodes, 3)\n self.assertEqual(pipelines[0].edges, 2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_pipeline.py_TestDvcRepoPipeline.two_pipelines_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_pipeline.py_TestDvcRepoPipeline.two_pipelines_", "embedding": null, "metadata": {"file_path": "tests/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 252, "end_line": 273, "span_ids": ["TestDvcRepoPipeline.two_pipelines", "TestDvcRepoPipeline.locked_stage"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestDvcRepoPipeline(TestDvc):\n\n def two_pipelines(self):\n self.dvc.add(\"foo\")\n self.dvc.run(deps=[\"foo\"], outs=[\"bar\"], cmd=\"\")\n self.dvc.run(deps=[\"bar\"], outs=[\"baz\"], cmd=\"echo baz > baz\")\n\n self.dvc.add(\"code.py\")\n\n pipelines = self.dvc.pipelines()\n\n self.assertEqual(len(pipelines), 2)\n self.assertEqual(pipelines[0].nodes, 3)\n self.assertEqual(pipelines[0].edges, 2)\n self.assertEqual(pipelines[1].nodes, 1)\n self.assertEqual(pipelines[1].edges, 0)\n\n def locked_stage(self):\n self.dvc.add(\"foo\")\n self.dvc.lock_stage(\"foo.dvc\")\n\n pipelines = self.dvc.pipelines()\n self.assertEqual(len(pipelines), 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_remote.py_os_TestRemote.test.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_remote.py_os_TestRemote.test.None_5", "embedding": null, "metadata": {"file_path": "tests/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 31, "span_ids": ["imports", "TestRemote.test", "TestRemote"], "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\nimport configobj\n\nfrom dvc.main import main\nfrom dvc.command.remote import CmdRemoteAdd\nfrom dvc.config import Config\n\nfrom tests.basic_env import TestDvc\nfrom tests.test_data_cloud import get_local_storagepath\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(main([\"remote\", \"remove\", remotes[0]]), 0)\n self.assertEqual(\n main([\"remote\", \"modify\", remotes[0], \"option\", \"value\"]), 0\n )\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/test_remote.py_TestRemote.test_failed_write_TestRemote.test_relative_path.self_assertEqual_config_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_remote.py_TestRemote.test_failed_write_TestRemote.test_relative_path.self_assertEqual_config_", "embedding": null, "metadata": {"file_path": "tests/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 33, "end_line": 58, "span_ids": ["TestRemote.test_relative_path", "TestRemote.test_failed_write"], "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 TestRemote(TestDvc):\n\n def test_failed_write(self):\n class A(object):\n system = False\n glob = False\n local = False\n name = \"myremote\"\n url = \"s3://remote\"\n unset = False\n\n args = A()\n cmd = CmdRemoteAdd(args)\n\n cmd.configobj.write = None\n ret = cmd.run()\n self.assertNotEqual(ret, 0)\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.config_file)\n self.assertEqual(config['remote \"mylocal\"'][\"url\"], rel)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_remote.py_TestRemoteRemoveDefault_TestRemoteRemoveDefault.test.None_1.self_assertTrue_Config_SE": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_remote.py_TestRemoteRemoveDefault_TestRemoteRemoveDefault.test.None_1.self_assertTrue_Config_SE", "embedding": null, "metadata": {"file_path": "tests/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 61, "end_line": 102, "span_ids": ["TestRemoteRemoveDefault.test", "TestRemoteRemoveDefault"], "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 TestRemoteRemoveDefault(TestDvc):\n def test(self):\n remote = \"mys3\"\n self.assertEqual(\n main([\"remote\", \"add\", \"--default\", remote, \"s3://bucket/name\"]), 0\n )\n self.assertEqual(\n main([\"remote\", \"modify\", remote, \"profile\", \"default\"]), 0\n )\n self.assertEqual(main([\"config\", \"--local\", \"core.remote\", remote]), 0)\n\n config = configobj.ConfigObj(\n os.path.join(self.dvc.dvc_dir, Config.CONFIG)\n )\n local_config = configobj.ConfigObj(\n os.path.join(self.dvc.dvc_dir, Config.CONFIG_LOCAL)\n )\n self.assertEqual(\n config[Config.SECTION_CORE][Config.SECTION_CORE_REMOTE], remote\n )\n self.assertEqual(\n local_config[Config.SECTION_CORE][Config.SECTION_CORE_REMOTE],\n remote,\n )\n\n self.assertEqual(main([\"remote\", \"remove\", remote]), 0)\n config = configobj.ConfigObj(\n os.path.join(self.dvc.dvc_dir, Config.CONFIG)\n )\n local_config = configobj.ConfigObj(\n os.path.join(self.dvc.dvc_dir, Config.CONFIG_LOCAL)\n )\n section = Config.SECTION_REMOTE_FMT.format(remote)\n self.assertTrue(section not in config.keys())\n\n core = config.get(Config.SECTION_CORE, None)\n if core is not None:\n self.assertTrue(Config.SECTION_CORE_REMOTE not in core.keys())\n\n core = local_config.get(Config.SECTION_CORE, None)\n if core is not None:\n self.assertTrue(Config.SECTION_CORE_REMOTE not in core.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/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/test_remote.py_TestRemoteRemove_TestRemoteDefault.test.None_4", "embedding": null, "metadata": {"file_path": "tests/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 105, "end_line": 139, "span_ids": ["TestRemoteDefault.test", "TestRemoteRemove", "TestRemoteDefault", "TestRemoteRemove.test"], "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 TestRemoteRemove(TestDvc):\n def test(self):\n ret = main([\"config\", \"core.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[Config.SECTION_CORE][Config.SECTION_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 core = config.get(Config.SECTION_CORE)\n if core is not None:\n default = core.get(Config.SECTION_CORE_REMOTE)\n else:\n default = None\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/test_remote.py_TestRemoteShouldHandleUppercaseRemoteName_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_remote.py_TestRemoteShouldHandleUppercaseRemoteName_", "embedding": null, "metadata": {"file_path": "tests/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 142, "end_line": 155, "span_ids": ["TestRemoteShouldHandleUppercaseRemoteName.test", "TestRemoteShouldHandleUppercaseRemoteName"], "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 TestRemoteShouldHandleUppercaseRemoteName(TestDvc):\n upper_case_remote_name = \"UPPERCASEREMOTE\"\n\n def test(self):\n remote_url = get_local_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/test_remove.py_os_TestRemove.test.None_8": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_remove.py_os_TestRemove.test.None_8", "embedding": null, "metadata": {"file_path": "tests/test_remove.py", "file_name": "test_remove.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 27, "span_ids": ["imports", "TestRemove", "TestRemove.test"], "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.main import main\nfrom dvc.stage import Stage, StageFileDoesNotExistError\nfrom dvc.exceptions import DvcException\n\nfrom tests.basic_env import TestDvc\nfrom mock import patch\n\n\nclass TestRemove(TestDvc):\n def test(self):\n stages = self.dvc.add(self.FOO)\n self.assertEqual(len(stages), 1)\n stage = stages[0]\n self.assertTrue(stage is not None)\n stage_removed = self.dvc.remove(stage.path, outs_only=True)\n\n self.assertIsInstance(stage_removed, Stage)\n self.assertEqual(stage.path, stage_removed.path)\n self.assertFalse(os.path.isfile(self.FOO))\n\n stage_removed = self.dvc.remove(stage.path)\n self.assertIsInstance(stage_removed, Stage)\n self.assertEqual(stage.path, stage_removed.path)\n self.assertFalse(os.path.isfile(self.FOO))\n self.assertFalse(os.path.exists(stage.path))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_remove.py_TestRemoveNonExistentFile_TestCmdRemove.test.self_assertNotEqual_ret_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_remove.py_TestRemoveNonExistentFile_TestCmdRemove.test.self_assertNotEqual_ret_", "embedding": null, "metadata": {"file_path": "tests/test_remove.py", "file_name": "test_remove.py", "file_type": "text/x-python", "category": "test", "start_line": 30, "end_line": 58, "span_ids": ["TestRemoveNonExistentFile.test", "TestCmdRemove.test", "TestRemoveDirectory.test", "TestRemoveDirectory", "TestRemoveNonExistentFile", "TestCmdRemove"], "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 TestRemoveNonExistentFile(TestDvc):\n def test(self):\n with self.assertRaises(StageFileDoesNotExistError):\n self.dvc.remove(\"non_existent_dvc_file\")\n\n\nclass TestRemoveDirectory(TestDvc):\n def test(self):\n stages = self.dvc.add(self.DATA_DIR)\n self.assertEqual(len(stages), 1)\n stage_add = stages[0]\n self.assertTrue(stage_add is not None)\n stage_removed = self.dvc.remove(stage_add.path)\n self.assertEqual(stage_add.path, stage_removed.path)\n self.assertFalse(os.path.exists(self.DATA_DIR))\n self.assertFalse(os.path.exists(stage_removed.path))\n\n\nclass TestCmdRemove(TestDvc):\n def test(self):\n stages = self.dvc.add(self.FOO)\n self.assertEqual(len(stages), 1)\n stage = stages[0]\n self.assertTrue(stage is not None)\n ret = main([\"remove\", stage.path])\n self.assertEqual(ret, 0)\n\n ret = main([\"remove\", \"non-existing-dvc-file\"])\n self.assertNotEqual(ret, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_remove.py_TestRemovePurge_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_remove.py_TestRemovePurge_", "embedding": null, "metadata": {"file_path": "tests/test_remove.py", "file_name": "test_remove.py", "file_type": "text/x-python", "category": "test", "start_line": 61, "end_line": 78, "span_ids": ["TestRemovePurge.test_force", "TestRemovePurge", "TestRemovePurge.test"], "tokens": 152}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRemovePurge(TestDvc):\n def test(self):\n dvcfile = self.dvc.add(self.FOO)[0].path\n ret = main([\"remove\", \"--purge\", \"--force\", dvcfile])\n\n self.assertEqual(ret, 0)\n self.assertFalse(os.path.exists(self.FOO))\n self.assertFalse(os.path.exists(dvcfile))\n\n @patch(\"dvc.prompt.confirm\", return_value=False)\n def test_force(self, mock_prompt):\n dvcfile = self.dvc.add(self.FOO)[0].path\n ret = main([\"remove\", \"--purge\", dvcfile])\n\n mock_prompt.assert_called()\n self.assertEqual(ret, 1)\n self.assertRaises(DvcException)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/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/test_repro.py_TestRepro_TestReproFail.test.self_assertNotEqual_ret_", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 38, "end_line": 62, "span_ids": ["TestRepro.setUp", "TestRepro", "TestReproFail.test", "TestReproFail"], "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 TestRepro(TestDvc):\n def setUp(self):\n super(TestRepro, self).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.dvc.run(\n fname=self.file1_stage,\n outs=[self.file1],\n deps=[self.FOO, self.CODE],\n cmd=\"python {} {} {}\".format(self.CODE, self.FOO, self.file1),\n )\n\n\nclass TestReproFail(TestRepro):\n def test(self):\n os.unlink(self.CODE)\n\n ret = main([\"repro\", self.file1_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/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/test_repro.py_TestReproCyclicGraph_TestReproCyclicGraph.test.with_self_assertRaises_Cy.self_dvc_reproduce_cycle", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 65, "end_line": 85, "span_ids": ["TestReproCyclicGraph.test", "TestReproCyclicGraph"], "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 TestReproCyclicGraph(TestDvc):\n def test(self):\n self.dvc.run(\n deps=[self.FOO], outs=[\"bar.txt\"], cmd=\"echo bar > bar.txt\"\n )\n\n self.dvc.run(\n deps=[\"bar.txt\"], outs=[\"baz.txt\"], cmd=\"echo baz > baz.txt\"\n )\n\n with open(\"cycle.dvc\", \"w\") as fd:\n stage_dump = {\n \"cmd\": \"echo baz > foo\",\n \"deps\": [{\"path\": \"baz.txt\"}],\n \"outs\": [{\"path\": self.FOO}],\n }\n\n yaml.safe_dump(stage_dump, fd, default_flow_style=False)\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/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/test_repro.py_TestReproWorkingDirectoryAsOutput_TestReproWorkingDirectoryAsOutput.test.with_self_assertRaises_St.self_dvc_reproduce_faulty", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 92, "end_line": 130, "span_ids": ["TestReproWorkingDirectoryAsOutput.test", "TestReproWorkingDirectoryAsOutput"], "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": "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 cwd=\"dir1\",\n outs=[\"../dir2\"],\n cmd=\"mkdir {path}\".format(path=os.path.join(\"..\", \"dir2\")),\n )\n\n faulty_stage_path = os.path.join(\"dir2\", \"something.dvc\")\n\n with open(faulty_stage_path, \"w\") as fd:\n output = os.path.join(\"..\", \"something\")\n stage_dump = {\n \"cmd\": \"echo something > {}\".format(output),\n \"outs\": [{\"path\": output}],\n }\n\n yaml.safe_dump(stage_dump, fd, default_flow_style=False)\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/test_repro.py_TestReproWorkingDirectoryAsOutput.test_nested_TestReproWorkingDirectoryAsOutput.test_nested.with_patch_object_DvcRepo.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/test_repro.py_TestReproWorkingDirectoryAsOutput.test_nested_TestReproWorkingDirectoryAsOutput.test_nested.with_patch_object_DvcRepo.with_self_assertRaises_St.self_dvc_reproduce_error_", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 132, "end_line": 180, "span_ids": ["TestReproWorkingDirectoryAsOutput.test_nested"], "tokens": 401}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproWorkingDirectoryAsOutput(TestDvc):\n\n def test_nested(self):\n from dvc.stage import Stage\n\n #\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 = os.path.relpath(nested_dir, dir1)\n\n nested_stage = self.dvc.run(\n cwd=dir1, # b\n outs=[out_dir], # ../a/nested\n cmd=\"mkdir {path}\".format(path=out_dir),\n )\n\n os.mkdir(os.path.join(nested_dir, \"dir\"))\n\n error_stage_path = os.path.join(nested_dir, \"dir\", \"error.dvc\")\n\n with open(error_stage_path, \"w\") as fd:\n output = os.path.join(\"..\", \"..\", \"something\")\n stage_dump = {\n \"cmd\": \"echo something > {}\".format(output),\n \"outs\": [{\"path\": output}],\n }\n\n yaml.safe_dump(stage_dump, fd, default_flow_style=False)\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 with patch.object(DvcRepo, \"stages\") as mock_stages:\n mock_stages.return_value = [\n nested_stage,\n Stage.load(self.dvc, error_stage_path),\n ]\n\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/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/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/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 176, "end_line": 200, "span_ids": ["TestReproWorkingDirectoryAsOutput.test_similar_paths"], "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 TestReproWorkingDirectoryAsOutput(TestDvc):\n\n def test_similar_paths(self):\n # File structure:\n #\n # .\n # |-- something.dvc (out.path == something)\n # |-- something\n # |__ something-1\n # |-- a\n # |__ a.dvc (stage.cwd == something-1)\n\n self.dvc.run(outs=[\"something\"], cmd=\"mkdir something\")\n\n os.mkdir(\"something-1\")\n\n stage = os.path.join(\"something-1\", \"a.dvc\")\n\n with open(stage, \"w\") as fd:\n stage_dump = {\"cmd\": \"echo a > a\", \"outs\": [{\"path\": \"a\"}]}\n\n yaml.safe_dump(stage_dump, fd, default_flow_style=False)\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/test_repro.py_TestReproDepUnderDir_TestReproDepUnderDir.test.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproDepUnderDir_TestReproDepUnderDir.test.None_7", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 203, "end_line": 226, "span_ids": ["TestReproDepUnderDir.test", "TestReproDepUnderDir"], "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 TestReproDepUnderDir(TestDvc):\n def test(self):\n stages = self.dvc.add(self.DATA_DIR)\n self.assertEqual(len(stages), 1)\n self.dir_stage = stages[0]\n self.assertTrue(self.dir_stage is not None)\n\n self.file1 = \"file1\"\n self.file1_stage = self.file1 + \".dvc\"\n self.dvc.run(\n fname=self.file1_stage,\n outs=[self.file1],\n deps=[self.DATA, self.CODE],\n cmd=\"python {} {} {}\".format(self.CODE, self.DATA, self.file1),\n )\n\n self.assertTrue(filecmp.cmp(self.file1, self.DATA, shallow=False))\n\n os.unlink(self.DATA)\n shutil.copyfile(self.FOO, self.DATA)\n\n stages = self.dvc.reproduce(self.file1_stage)\n self.assertEqual(len(stages), 2)\n self.assertTrue(filecmp.cmp(self.file1, self.FOO, shallow=False))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/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/test_repro.py_TestReproDepDirWithOutputsUnderIt_TestReproDepDirWithOutputsUnderIt.test.None_8", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 229, "end_line": 256, "span_ids": ["TestReproDepDirWithOutputsUnderIt", "TestReproDepDirWithOutputsUnderIt.test"], "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 TestReproDepDirWithOutputsUnderIt(TestDvc):\n def test(self):\n stages = self.dvc.add(self.DATA)\n self.assertEqual(len(stages), 1)\n self.assertTrue(stages[0] is not None)\n\n stages = self.dvc.add(self.DATA_SUB)\n self.assertEqual(len(stages), 1)\n self.assertTrue(stages[0] is not None)\n\n stage = self.dvc.run(fname=\"Dvcfile\", deps=[self.DATA, self.DATA_SUB])\n self.assertTrue(stage is not None)\n\n file1 = \"file1\"\n file1_stage = file1 + \".dvc\"\n stage = self.dvc.run(\n fname=file1_stage,\n deps=[self.DATA_DIR],\n outs=[file1],\n cmd=\"python {} {} {}\".format(self.CODE, self.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(file1_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/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/test_repro.py_TestReproNoDeps_TestReproNoDeps.test.self_assertEqual_len_stag", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 259, "end_line": 275, "span_ids": ["TestReproNoDeps", "TestReproNoDeps.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 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 self.dvc.run(\n fname=stage_file, outs=[out], cmd=\"python {}\".format(code_file)\n )\n\n stages = self.dvc.reproduce(stage_file)\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/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/test_repro.py_TestReproForce_TestReproChangedCode.swap_code.self_create_self_CODE_ne", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 278, "end_line": 299, "span_ids": ["TestReproChangedCode", "TestReproChangedCode.swap_code", "TestReproForce.test", "TestReproChangedCode.test", "TestReproForce"], "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 TestReproForce(TestRepro):\n def test(self):\n stages = self.dvc.reproduce(self.file1_stage, force=True)\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.file1_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/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/test_repro.py_TestReproChangedData_TestReproUpToDate.test.self_assertEqual_ret_0_", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 302, "end_line": 333, "span_ids": ["TestReproDry", "TestReproChangedData.swap_foo_with_bar", "TestReproDry.test", "TestReproChangedData", "TestReproChangedData.test", "TestReproUpToDate", "TestReproUpToDate.test"], "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 TestReproChangedData(TestRepro):\n def test(self):\n self.swap_foo_with_bar()\n\n stages = self.dvc.reproduce(self.file1_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(self.file1_stage, dry=True)\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.file1_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.file1_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/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/test_repro.py_TestReproDryNoExec_TestReproDryNoExec.test.None_1", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 336, "end_line": 370, "span_ids": ["TestReproDryNoExec.test", "TestReproDryNoExec"], "tokens": 221}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproDryNoExec(TestDvc):\n def test(self):\n deps = []\n for d in range(3):\n idir = \"idir{}\".format(d)\n odir = \"odir{}\".format(d)\n\n deps.append(\"-d\")\n deps.append(odir)\n\n os.mkdir(idir)\n\n f = os.path.join(idir, \"file\")\n with open(f, \"w+\") as fobj:\n fobj.write(str(d))\n\n ret = main(\n [\n \"run\",\n \"--no-exec\",\n \"-d\",\n idir,\n \"-o\",\n odir,\n \"python -c 'import shutil; \"\n 'shutil.copytree(\"{}\", \"{}\")\\''.format(idir, odir),\n ]\n )\n self.assertEqual(ret, 0)\n\n ret = main([\"run\", \"--no-exec\", \"-f\", \"Dvcfile\"] + deps)\n self.assertEqual(ret, 0)\n\n ret = main([\"repro\", \"--dry\"])\n self.assertEqual(ret, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/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/test_repro.py_TestReproChangedDeepData_TestReproChangedDeepData.test.self_assertEqual_len_stag", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 373, "end_line": 393, "span_ids": ["TestReproChangedDeepData.setUp", "TestReproChangedDeepData", "TestReproChangedDeepData.test"], "tokens": 177}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproChangedDeepData(TestReproChangedData):\n def setUp(self):\n super(TestReproChangedDeepData, self).setUp()\n\n self.file2 = \"file2\"\n self.file2_stage = self.file2 + \".dvc\"\n self.dvc.run(\n fname=self.file2_stage,\n outs=[self.file2],\n deps=[self.file1, self.CODE],\n cmd=\"python {} {} {}\".format(self.CODE, self.file1, self.file2),\n )\n\n def test(self):\n self.swap_foo_with_bar()\n\n stages = self.dvc.reproduce(self.file2_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/test_repro.py_TestReproIgnoreBuildCache_TestReproIgnoreBuildCache.test.self_assertEqual_stages_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproIgnoreBuildCache_TestReproIgnoreBuildCache.test.self_assertEqual_stages_1", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 396, "end_line": 439, "span_ids": ["TestReproIgnoreBuildCache.test", "TestReproIgnoreBuildCache"], "tokens": 378}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproIgnoreBuildCache(TestDvc):\n def test(self):\n stages = self.dvc.add(self.FOO)\n self.assertEqual(len(stages), 1)\n foo_stage = stages[0]\n self.assertTrue(foo_stage is not None)\n\n code1 = \"code1.py\"\n shutil.copyfile(self.CODE, code1)\n file1 = \"file1\"\n file1_stage = self.dvc.run(\n outs=[file1],\n deps=[self.FOO, code1],\n cmd=\"python {} {} {}\".format(code1, self.FOO, file1),\n )\n self.assertTrue(file1_stage is not None)\n\n code2 = \"code2.py\"\n shutil.copyfile(self.CODE, code2)\n file2 = \"file2\"\n file2_stage = self.dvc.run(\n outs=[file2],\n deps=[file1, code2],\n cmd=\"python {} {} {}\".format(code2, file1, file2),\n )\n self.assertTrue(file2_stage is not None)\n\n code3 = \"code3.py\"\n shutil.copyfile(self.CODE, code3)\n file3 = \"file3\"\n file3_stage = self.dvc.run(\n outs=[file3],\n deps=[file2, code3],\n cmd=\"python {} {} {}\".format(code3, file2, file3),\n )\n self.assertTrue(file3_stage is not None)\n\n with open(code2, \"a\") as fobj:\n fobj.write(\"\\n\\n\")\n\n stages = self.dvc.reproduce(file3_stage.path, ignore_build_cache=True)\n self.assertEqual(len(stages), 2)\n self.assertEqual(stages[0].path, file2_stage.path)\n self.assertEqual(stages[1].path, file3_stage.path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproPipeline_TestReproPipelines.setUp.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproPipeline_TestReproPipelines.setUp.None_6", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 442, "end_line": 484, "span_ids": ["TestReproPipelines", "TestReproPipelines.setUp", "TestReproPipeline", "TestReproPipeline.test_cli", "TestReproPipeline.test"], "tokens": 338}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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.file1_stage, force=True, pipeline=True\n )\n self.assertEqual(len(stages), 3)\n\n def test_cli(self):\n ret = main([\"repro\", \"--pipeline\", \"-f\", self.file1_stage])\n self.assertEqual(ret, 0)\n\n\nclass TestReproPipelines(TestDvc):\n def setUp(self):\n super(TestReproPipelines, self).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.file1 + \".dvc\"\n self.dvc.run(\n fname=self.file1_stage,\n outs=[self.file1],\n deps=[self.FOO, self.CODE],\n cmd=\"python {} {} {}\".format(self.CODE, self.FOO, self.file1),\n )\n\n self.file2 = \"file2\"\n self.file2_stage = self.file2 + \".dvc\"\n self.dvc.run(\n fname=self.file2_stage,\n outs=[self.file2],\n deps=[self.BAR, self.CODE],\n cmd=\"python {} {} {}\".format(self.CODE, self.BAR, self.file2),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproPipelines.test_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/test_repro.py_TestReproPipelines.test_TestReproPipelines.test_cli.self_assertEqual_ret_0_", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 486, "end_line": 497, "span_ids": ["TestReproPipelines.test", "TestReproPipelines.test_cli"], "tokens": 123}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproPipelines(TestDvc):\n\n def test(self):\n stages = self.dvc.reproduce(all_pipelines=True, force=True)\n self.assertEqual(len(stages), 4)\n names = [stage.relpath for stage in stages]\n self.assertTrue(self.foo_stage.relpath in names)\n self.assertTrue(self.bar_stage.relpath in names)\n self.assertTrue(self.file1_stage in names)\n self.assertTrue(self.file2_stage in names)\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/test_repro.py_TestReproLocked_TestReproLocked.test_non_existing.self_assertNotEqual_ret_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproLocked_TestReproLocked.test_non_existing.self_assertNotEqual_ret_", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 500, "end_line": 530, "span_ids": ["TestReproLocked.test_non_existing", "TestReproLocked", "TestReproLocked.test"], "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 TestReproLocked(TestReproChangedData):\n def test(self):\n file2 = \"file2\"\n file2_stage = file2 + \".dvc\"\n self.dvc.run(\n fname=file2_stage,\n outs=[file2],\n deps=[self.file1, self.CODE],\n cmd=\"python {} {} {}\".format(self.CODE, self.file1, file2),\n )\n\n self.swap_foo_with_bar()\n\n ret = main([\"lock\", file2_stage])\n self.assertEqual(ret, 0)\n stages = self.dvc.reproduce(file2_stage)\n self.assertEqual(len(stages), 0)\n\n ret = main([\"unlock\", file2_stage])\n self.assertEqual(ret, 0)\n stages = self.dvc.reproduce(file2_stage)\n self.assertTrue(filecmp.cmp(self.file1, self.BAR, shallow=False))\n self.assertTrue(filecmp.cmp(file2, self.BAR, shallow=False))\n self.assertEqual(len(stages), 3)\n\n def test_non_existing(self):\n with self.assertRaises(StageFileDoesNotExistError):\n self.dvc.lock_stage(\"non-existing-stage\")\n\n ret = main([\"lock\", \"non-existing-stage\"])\n self.assertNotEqual(ret, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproLockedCallback_TestReproLockedUnchanged.test.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproLockedCallback_TestReproLockedUnchanged.test.None_3", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 533, "end_line": 570, "span_ids": ["TestReproLockedCallback.test", "TestReproLockedCallback", "TestReproLockedUnchanged.test", "TestReproLockedUnchanged"], "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 TestReproLockedCallback(TestDvc):\n def test(self):\n file1 = \"file1\"\n file1_stage = file1 + \".dvc\"\n # NOTE: purposefully not specifying dependencies\n # to create a callbacs stage.\n stage = self.dvc.run(\n fname=file1_stage,\n outs=[file1],\n cmd=\"python {} {} {}\".format(self.CODE, self.FOO, file1),\n )\n self.assertTrue(stage is not None)\n self.assertEqual(stage.relpath, file1_stage)\n\n stages = self.dvc.reproduce(file1_stage)\n self.assertEqual(len(stages), 1)\n\n self.dvc.lock_stage(file1_stage)\n stages = self.dvc.reproduce(file1_stage)\n self.assertEqual(len(stages), 0)\n\n self.dvc.lock_stage(file1_stage, unlock=True)\n stages = self.dvc.reproduce(file1_stage)\n self.assertEqual(len(stages), 1)\n\n\nclass TestReproLockedUnchanged(TestRepro):\n def test(self):\n \"\"\"\n Check that locking/unlocking doesn't affect stage state\n \"\"\"\n self.dvc.lock_stage(self.file1_stage)\n stages = self.dvc.reproduce(self.file1_stage)\n self.assertEqual(len(stages), 0)\n\n self.dvc.lock_stage(self.file1_stage, unlock=True)\n stages = self.dvc.reproduce(self.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/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/test_repro.py_TestReproMetricsAddUnchanged_TestReproMetricsAddUnchanged.test.None_7", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 573, "end_line": 600, "span_ids": ["TestReproMetricsAddUnchanged.test", "TestReproMetricsAddUnchanged"], "tokens": 221}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproMetricsAddUnchanged(TestDvc):\n def test(self):\n \"\"\"\n Check that adding/removing metrics doesn't affect stage state\n \"\"\"\n stages = self.dvc.add(self.FOO)\n self.assertEqual(len(stages), 1)\n self.assertTrue(stages[0] is not None)\n\n file1 = \"file1\"\n file1_stage = file1 + \".dvc\"\n self.dvc.run(\n fname=file1_stage,\n outs_no_cache=[file1],\n deps=[self.FOO, self.CODE],\n cmd=\"python {} {} {}\".format(self.CODE, self.FOO, file1),\n )\n\n stages = self.dvc.reproduce(file1_stage)\n self.assertEqual(len(stages), 0)\n\n self.dvc.metrics.add(file1)\n stages = self.dvc.reproduce(file1_stage)\n self.assertEqual(len(stages), 0)\n\n self.dvc.metrics.remove(file1)\n stages = self.dvc.reproduce(file1_stage)\n self.assertEqual(len(stages), 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/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/test_repro.py_TestReproPhony_TestReproDataSource.test.self_assertEqual_stages_0", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 603, "end_line": 629, "span_ids": ["TestReproDataSource.test", "TestReproDataSource", "TestReproPhony", "TestReproPhony.test", "TestNonExistingOutput", "TestNonExistingOutput.test"], "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 TestReproPhony(TestReproChangedData):\n def test(self):\n stage = self.dvc.run(deps=[self.file1])\n\n self.swap_foo_with_bar()\n\n self.dvc.reproduce(stage.path)\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.file1_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/test_repro.py_TestReproChangedDir_TestReproChangedDir.test.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproChangedDir_TestReproChangedDir.test.None_5", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 632, "end_line": 662, "span_ids": ["TestReproChangedDir", "TestReproChangedDir.test"], "tokens": 218}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproChangedDir(TestDvc):\n def test(self):\n file_name = \"file\"\n shutil.copyfile(self.FOO, file_name)\n\n stage_name = \"dir.dvc\"\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 self.dvc.run(\n fname=stage_name,\n outs=[dir_name],\n deps=[file_name, dir_code],\n cmd=\"python {}\".format(dir_code),\n )\n\n stages = self.dvc.reproduce(stage_name)\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(stage_name)\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/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/test_repro.py_TestReproChangedDirData_TestReproChangedDirData.test.None_9", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 665, "end_line": 703, "span_ids": ["TestReproChangedDirData.test", "TestReproChangedDirData"], "tokens": 323}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproChangedDirData(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.dvc.run(\n outs=[dir_name],\n deps=[self.DATA_DIR, dir_code],\n cmd=\"python {} {} {}\".format(dir_code, self.DATA_DIR, dir_name),\n )\n self.assertTrue(stage is not None)\n\n stages = self.dvc.reproduce(stage.path)\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(stage.path)\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(stage.path)\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(stage.path)\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/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/test_repro.py_TestReproMissingMd5InStageFile_TestCmdRepro.test.self_assertNotEqual_ret_", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 712, "end_line": 738, "span_ids": ["TestReproMissingMd5InStageFile.test", "TestCmdRepro.test", "TestReproMissingMd5InStageFile", "TestCmdRepro"], "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 TestReproMissingMd5InStageFile(TestRepro):\n def test(self):\n with open(self.file1_stage, \"r\") as fd:\n d = yaml.load(fd)\n\n del d[Stage.PARAM_OUTS][0][RemoteLOCAL.PARAM_CHECKSUM]\n del d[Stage.PARAM_DEPS][0][RemoteLOCAL.PARAM_CHECKSUM]\n\n with open(self.file1_stage, \"w\") as fd:\n yaml.dump(d, fd)\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.file1_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/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/test_repro.py_TestCmdReproChdir_TestCmdReproChdir.test.None_11", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 773, "end_line": 808, "span_ids": ["TestCmdReproChdir.test", "TestCmdReproChdir"], "tokens": 258}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCmdReproChdir(TestDvc):\n def test(self):\n dname = \"dir\"\n os.mkdir(dname)\n foo = os.path.join(dname, self.FOO)\n bar = os.path.join(dname, self.BAR)\n code = os.path.join(dname, self.CODE)\n shutil.copyfile(self.FOO, foo)\n shutil.copyfile(self.CODE, code)\n\n ret = main(\n [\n \"run\",\n \"-f\",\n \"{}/Dvcfile\".format(dname),\n \"-w\",\n \"{}\".format(dname),\n \"-d\",\n self.FOO,\n \"-o\",\n self.BAR,\n \"python {} {} {}\".format(self.CODE, self.FOO, self.BAR),\n ]\n )\n self.assertEqual(ret, 0)\n self.assertTrue(os.path.isfile(foo))\n self.assertTrue(os.path.isfile(bar))\n self.assertTrue(filecmp.cmp(foo, bar, shallow=False))\n\n os.unlink(bar)\n\n ret = main([\"repro\", \"-c\", dname])\n self.assertEqual(ret, 0)\n self.assertTrue(os.path.isfile(foo))\n self.assertTrue(os.path.isfile(bar))\n self.assertTrue(filecmp.cmp(foo, bar, shallow=False))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproExternalBase_TestReproExternalBase.check_already_cached.with_self_dvc_state_.with_patch_download_as_mo.with_patch_checkout_as_mo.with_patch_run_as_mock_ru.mock_checkout_assert_call": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproExternalBase_TestReproExternalBase.check_already_cached.with_self_dvc_state_.with_patch_download_as_mo.with_patch_checkout_as_mo.with_patch_run_as_mock_ru.mock_checkout_assert_call", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 773, "end_line": 814, "span_ids": ["TestReproExternalBase", "TestReproExternalBase.scheme", "TestReproExternalBase.check_already_cached", "TestReproExternalBase.should_test", "TestReproExternalBase.scheme_sep", "TestReproExternalBase.cache_scheme", "TestReproExternalBase.sep"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproExternalBase(TestDvc):\n def should_test(self):\n return False\n\n @property\n def cache_scheme(self):\n return self.scheme\n\n @property\n def scheme(self):\n return None\n\n @property\n def scheme_sep(self):\n return \"://\"\n\n @property\n def sep(self):\n return \"/\"\n\n def check_already_cached(self, stage):\n stage.outs[0].remove()\n\n patch_download = patch.object(\n stage.deps[0], \"download\", wraps=stage.deps[0].download\n )\n\n patch_checkout = patch.object(\n stage.outs[0], \"checkout\", wraps=stage.outs[0].checkout\n )\n\n patch_run = patch.object(stage, \"_run\", wraps=stage._run)\n\n with self.dvc.state:\n with patch_download as mock_download:\n with patch_checkout as mock_checkout:\n with patch_run as mock_run:\n stage.run()\n\n mock_run.assert_not_called()\n mock_download.assert_not_called()\n mock_checkout.assert_called_once()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproExternalBase.corrupted_cache_TestReproExternalBase.corrupted_cache.with_self_dvc_state_.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/test_repro.py_TestReproExternalBase.corrupted_cache_TestReproExternalBase.corrupted_cache.with_self_dvc_state_.with_patch_checkout_as_mo.with_patch_run_as_mock_ru.mock_checkout_assert_not_", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 816, "end_line": 838, "span_ids": ["TestReproExternalBase.corrupted_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 TestReproExternalBase(TestDvc):\n\n def corrupted_cache(self):\n os.unlink(\"bar.dvc\")\n\n stage = self.dvc.run(\n deps=[self.FOO], outs=[self.BAR], cmd=\"echo bar > bar\"\n )\n\n with open(self.BAR, \"w\") as fd:\n fd.write(\"corrupting the cache\")\n\n patch_checkout = patch.object(\n stage.outs[0], \"checkout\", wraps=stage.outs[0].checkout\n )\n\n patch_run = patch.object(stage, \"_run\", wraps=stage._run)\n\n with self.dvc.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/test_repro.py_TestReproExternalBase.test_TestReproExternalBase.test.self_corrupted_cache_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproExternalBase.test_TestReproExternalBase.test.self_corrupted_cache_", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 840, "end_line": 939, "span_ids": ["TestReproExternalBase.test"], "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 TestReproExternalBase(TestDvc):\n\n @patch(\"dvc.prompt.confirm\", return_value=True)\n def test(self, mock_prompt):\n if not self.should_test():\n return\n\n cache = (\n self.scheme\n + self.scheme_sep\n + self.bucket\n + self.sep\n + str(uuid.uuid4())\n )\n\n ret = main([\"config\", \"cache.\" + self.cache_scheme, \"myrepo\"])\n self.assertEqual(ret, 0)\n ret = main([\"remote\", \"add\", \"myrepo\", cache])\n self.assertEqual(ret, 0)\n ret = main([\"remote\", \"modify\", \"myrepo\", \"type\", \"hardlink\"])\n self.assertEqual(ret, 0)\n\n remote_name = \"myremote\"\n remote_key = str(uuid.uuid4())\n remote = (\n self.scheme + self.scheme_sep + self.bucket + self.sep + remote_key\n )\n\n ret = main([\"remote\", \"add\", remote_name, remote])\n self.assertEqual(ret, 0)\n ret = main([\"remote\", \"modify\", remote_name, \"type\", \"hardlink\"])\n self.assertEqual(ret, 0)\n\n self.dvc = DvcRepo(\".\")\n\n foo_key = remote_key + self.sep + self.FOO\n bar_key = remote_key + self.sep + self.BAR\n\n foo_path = (\n self.scheme + self.scheme_sep + self.bucket + self.sep + foo_key\n )\n bar_path = (\n self.scheme + self.scheme_sep + self.bucket + self.sep + bar_key\n )\n\n # Using both plain and remote notation\n out_foo_path = \"remote://\" + remote_name + \"/\" + self.FOO\n out_bar_path = bar_path\n\n self.write(self.bucket, foo_key, self.FOO_CONTENTS)\n\n import_stage = self.dvc.imp(out_foo_path, \"import\")\n\n self.assertTrue(os.path.exists(\"import\"))\n self.assertTrue(filecmp.cmp(\"import\", self.FOO, shallow=False))\n self.assertEqual(self.dvc.status(import_stage.path), {})\n self.check_already_cached(import_stage)\n\n import_remote_stage = self.dvc.imp(\n out_foo_path, out_foo_path + \"_imported\"\n )\n self.assertEqual(self.dvc.status(import_remote_stage.path), {})\n\n cmd_stage = self.dvc.run(\n outs=[out_bar_path],\n deps=[out_foo_path],\n cmd=self.cmd(foo_path, bar_path),\n )\n\n self.assertEqual(self.dvc.status(cmd_stage.path), {})\n self.assertEqual(self.dvc.status(), {})\n self.check_already_cached(cmd_stage)\n\n self.write(self.bucket, foo_key, self.BAR_CONTENTS)\n\n self.assertNotEqual(self.dvc.status(), {})\n\n stages = self.dvc.reproduce(import_stage.path)\n self.assertEqual(len(stages), 1)\n self.assertTrue(os.path.exists(\"import\"))\n self.assertTrue(filecmp.cmp(\"import\", self.BAR, shallow=False))\n self.assertEqual(self.dvc.status(import_stage.path), {})\n\n stages = self.dvc.reproduce(import_remote_stage.path)\n self.assertEqual(len(stages), 1)\n self.assertEqual(self.dvc.status(import_remote_stage.path), {})\n\n stages = self.dvc.reproduce(cmd_stage.path)\n self.assertEqual(len(stages), 1)\n self.assertEqual(self.dvc.status(cmd_stage.path), {})\n\n self.assertEqual(self.dvc.status(), {})\n self.dvc.gc()\n self.assertEqual(self.dvc.status(), {})\n\n self.dvc.remove(cmd_stage.path, outs_only=True)\n self.assertNotEqual(self.dvc.status(cmd_stage.path), {})\n\n self.dvc.checkout(cmd_stage.path, force=True)\n self.assertEqual(self.dvc.status(cmd_stage.path), {})\n\n self.corrupted_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/test_repro.py_TestReproExternalS3_TestReproExternalGS.write.bucket_blob_key_upload_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproExternalS3_TestReproExternalGS.write.bucket_blob_key_upload_f", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 942, "end_line": 980, "span_ids": ["TestReproExternalS3.write", "TestReproExternalS3.should_test", "TestReproExternalS3", "TestReproExternalS3.cmd", "TestReproExternalGS.write", "TestReproExternalS3.bucket", "TestReproExternalGS.cmd", "TestReproExternalGS.scheme", "TestReproExternalGS.should_test", "TestReproExternalGS.bucket", "TestReproExternalGS", "TestReproExternalS3.scheme"], "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 TestReproExternalS3(TestReproExternalBase):\n def should_test(self):\n return _should_test_aws()\n\n @property\n def scheme(self):\n return \"s3\"\n\n @property\n def bucket(self):\n return TEST_AWS_REPO_BUCKET\n\n def cmd(self, i, o):\n return \"aws s3 cp {} {}\".format(i, o)\n\n def write(self, bucket, key, body):\n s3 = boto3.resource(\"s3\")\n s3.Bucket(bucket).put_object(Key=key, Body=body)\n\n\nclass TestReproExternalGS(TestReproExternalBase):\n def should_test(self):\n return _should_test_gcp()\n\n @property\n def scheme(self):\n return \"gs\"\n\n @property\n def bucket(self):\n return TEST_GCP_REPO_BUCKET\n\n def cmd(self, i, o):\n return \"gsutil cp {} {}\".format(i, o)\n\n def write(self, bucket, key, body):\n client = gc.Client()\n bucket = client.bucket(bucket)\n bucket.blob(key).upload_from_string(body)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproExternalHDFS_TestReproExternalHDFS.write.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproExternalHDFS_TestReproExternalHDFS.write.None_2", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 983, "end_line": 1039, "span_ids": ["TestReproExternalHDFS.scheme", "TestReproExternalHDFS.should_test", "TestReproExternalHDFS.bucket", "TestReproExternalHDFS.cmd", "TestReproExternalHDFS.write", "TestReproExternalHDFS"], "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": "class TestReproExternalHDFS(TestReproExternalBase):\n def should_test(self):\n return _should_test_hdfs()\n\n @property\n def scheme(self):\n return \"hdfs\"\n\n @property\n def bucket(self):\n return \"{}@127.0.0.1\".format(getpass.getuser())\n\n def cmd(self, i, o):\n return \"hadoop fs -cp {} {}\".format(i, o)\n\n def write(self, bucket, key, body):\n url = self.scheme + \"://\" + bucket + \"/\" + key\n p = Popen(\n \"hadoop fs -rm -f {}\".format(url),\n shell=True,\n executable=os.getenv(\"SHELL\"),\n stdin=PIPE,\n stdout=PIPE,\n stderr=PIPE,\n )\n p.communicate()\n\n p = Popen(\n \"hadoop fs -mkdir -p {}\".format(posixpath.dirname(url)),\n shell=True,\n executable=os.getenv(\"SHELL\"),\n stdin=PIPE,\n stdout=PIPE,\n stderr=PIPE,\n )\n out, err = p.communicate()\n if p.returncode != 0:\n print(out)\n print(err)\n self.assertEqual(p.returncode, 0)\n\n with open(\"tmp\", \"w+\") as fd:\n fd.write(body)\n\n p = Popen(\n \"hadoop fs -copyFromLocal {} {}\".format(\"tmp\", url),\n shell=True,\n executable=os.getenv(\"SHELL\"),\n stdin=PIPE,\n stdout=PIPE,\n stderr=PIPE,\n )\n out, err = p.communicate()\n if p.returncode != 0:\n print(out)\n print(err)\n self.assertEqual(p.returncode, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproExternalSSH_TestReproExternalSSH.cmd.return._scp_format_i_o_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproExternalSSH_TestReproExternalSSH.cmd.return._scp_format_i_o_", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1042, "end_line": 1062, "span_ids": ["TestReproExternalSSH.scheme", "TestReproExternalSSH", "TestReproExternalSSH.cmd", "TestReproExternalSSH.bucket", "TestReproExternalSSH.should_test"], "tokens": 148}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@flaky(max_runs=3, min_passes=1)\nclass TestReproExternalSSH(TestReproExternalBase):\n _dir = None\n\n def should_test(self):\n return _should_test_ssh()\n\n @property\n def scheme(self):\n return \"ssh\"\n\n @property\n def bucket(self):\n if not self._dir:\n self._dir = TestDvc.mkdtemp()\n return \"{}@127.0.0.1:{}\".format(getpass.getuser(), self._dir)\n\n def cmd(self, i, o):\n i = i.strip(\"ssh://\")\n o = o.strip(\"ssh://\")\n return \"scp {} {}\".format(i, o)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproExternalSSH.write_TestReproExternalSSH.write.with_sftp_open_path_w_.fobj_write_body_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproExternalSSH.write_TestReproExternalSSH.write.with_sftp_open_path_w_.fobj_write_body_", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1064, "end_line": 1085, "span_ids": ["TestReproExternalSSH.write"], "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": "@flaky(max_runs=3, min_passes=1)\nclass TestReproExternalSSH(TestReproExternalBase):\n\n def write(self, bucket, key, body):\n path = posixpath.join(self._dir, key)\n\n ssh = paramiko.SSHClient()\n ssh.load_system_host_keys()\n ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())\n ssh.connect(\"127.0.0.1\")\n\n sftp = ssh.open_sftp()\n try:\n sftp.stat(path)\n sftp.remove(path)\n except IOError:\n pass\n\n stdin, stdout, stderr = ssh.exec_command(\n \"mkdir -p $(dirname {})\".format(path)\n )\n self.assertEqual(stdout.channel.recv_exit_status(), 0)\n\n with sftp.open(path, \"w+\") as fobj:\n fobj.write(body)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproExternalLOCAL_TestReproExternalLOCAL.write.with_open_path_w_as_.fd_write_body_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproExternalLOCAL_TestReproExternalLOCAL.write.with_open_path_w_as_.fd_write_body_", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1088, "end_line": 1132, "span_ids": ["TestReproExternalLOCAL.bucket", "TestReproExternalLOCAL.write", "TestReproExternalLOCAL.setUp", "TestReproExternalLOCAL.scheme_sep", "TestReproExternalLOCAL.cache_scheme", "TestReproExternalLOCAL", "TestReproExternalLOCAL.cmd", "TestReproExternalLOCAL.should_test", "TestReproExternalLOCAL.scheme", "TestReproExternalLOCAL.sep"], "tokens": 253}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproExternalLOCAL(TestReproExternalBase):\n def setUp(self):\n super(TestReproExternalLOCAL, self).setUp()\n self.tmpdir = TestDvc.mkdtemp()\n ret = main([\"config\", \"cache.type\", \"hardlink\"])\n self.assertEqual(ret, 0)\n self.dvc = DvcRepo(\".\")\n\n def should_test(self):\n return True\n\n @property\n def cache_scheme(self):\n return \"local\"\n\n @property\n def scheme(self):\n return \"\"\n\n @property\n def scheme_sep(self):\n return \"\"\n\n @property\n def sep(self):\n return os.sep\n\n @property\n def bucket(self):\n return self.tmpdir\n\n def cmd(self, i, o):\n if os.name == \"nt\":\n return \"copy {} {}\".format(i, o)\n return \"cp {} {}\".format(i, o)\n\n def write(self, bucket, key, body):\n path = os.path.join(bucket, key)\n dname = os.path.dirname(path)\n\n if not os.path.exists(dname):\n os.makedirs(dname)\n\n with open(path, \"w+\") as fd:\n fd.write(body)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproExternalHTTP_TestReproExternalHTTP.test.None_12": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproExternalHTTP_TestReproExternalHTTP.test.None_12", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1135, "end_line": 1212, "span_ids": ["TestReproExternalHTTP.external_cache_id", "TestReproExternalHTTP.test", "TestReproExternalHTTP", "TestReproExternalHTTP.local_cache", "TestReproExternalHTTP.external_cache", "TestReproExternalHTTP.remote"], "tokens": 547}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproExternalHTTP(TestReproExternalBase):\n _external_cache_id = None\n\n @property\n def remote(self):\n return \"http://localhost:8000/\"\n\n @property\n def local_cache(self):\n return os.path.join(self.dvc.dvc_dir, \"cache\")\n\n @property\n def external_cache_id(self):\n if not self._external_cache_id:\n self._external_cache_id = str(uuid.uuid4())\n\n return self._external_cache_id\n\n @property\n def external_cache(self):\n return urljoin(self.remote, self.external_cache_id)\n\n def test(self):\n ret1 = main([\"remote\", \"add\", \"mycache\", self.external_cache])\n ret2 = main([\"remote\", \"add\", \"myremote\", self.remote])\n self.assertEqual(ret1, 0)\n self.assertEqual(ret2, 0)\n\n self.dvc = DvcRepo(\".\")\n\n # Import\n with StaticFileServer():\n import_url = urljoin(self.remote, self.FOO)\n import_output = \"imported_file\"\n import_stage = self.dvc.imp(import_url, import_output)\n\n self.assertTrue(os.path.exists(import_output))\n self.assertTrue(filecmp.cmp(import_output, self.FOO, shallow=False))\n\n self.dvc.remove(\"imported_file.dvc\")\n\n with StaticFileServer(handler=\"Content-MD5\"):\n import_url = urljoin(self.remote, self.FOO)\n import_output = \"imported_file\"\n import_stage = self.dvc.imp(import_url, import_output)\n\n self.assertTrue(os.path.exists(import_output))\n self.assertTrue(filecmp.cmp(import_output, self.FOO, shallow=False))\n\n # Run --deps\n with StaticFileServer():\n run_dependency = urljoin(self.remote, self.BAR)\n run_output = \"remote_file\"\n cmd = 'open(\"{}\", \"w+\")'.format(run_output)\n\n with open(\"create-output.py\", \"w\") as fd:\n fd.write(cmd)\n\n run_stage = self.dvc.run(\n deps=[run_dependency],\n outs=[run_output],\n cmd=\"python create-output.py\",\n )\n self.assertTrue(run_stage is not None)\n\n self.assertTrue(os.path.exists(run_output))\n\n # Pull\n self.dvc.remove(import_stage.path, outs_only=True)\n self.assertFalse(os.path.exists(import_output))\n\n shutil.move(self.local_cache, self.external_cache_id)\n self.assertFalse(os.path.exists(self.local_cache))\n\n with StaticFileServer():\n self.dvc.pull(import_stage.path, remote=\"mycache\")\n\n self.assertTrue(os.path.exists(import_output))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproShell_TestReproNoSCM.test.self_assertEqual_ret_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproShell_TestReproNoSCM.test.self_assertEqual_ret_0_", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1215, "end_line": 1242, "span_ids": ["TestReproShell.test", "TestReproNoSCM.test", "TestReproNoSCM", "TestReproShell"], "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 TestReproShell(TestDvc):\n def test(self):\n if os.name == \"nt\":\n return\n\n fname = \"shell.txt\"\n stage = fname + \".dvc\"\n\n self.dvc.run(\n fname=stage, outs=[fname], cmd=\"echo $SHELL > {}\".format(fname)\n )\n\n with open(fname, \"r\") as fd:\n self.assertEqual(os.getenv(\"SHELL\"), fd.read().strip())\n\n os.unlink(fname)\n\n self.dvc.reproduce(stage)\n\n with open(fname, \"r\") as fd:\n self.assertEqual(os.getenv(\"SHELL\"), fd.read().strip())\n\n\nclass TestReproNoSCM(TestRepro):\n def test(self):\n shutil.rmtree(self.dvc.scm.dir)\n ret = main([\"repro\", self.file1_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/test_run.py_os_from_tests_basic_env_impo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_os_from_tests_basic_env_impo", "embedding": null, "metadata": {"file_path": "tests/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 26, "span_ids": ["imports"], "tokens": 156}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport uuid\n\nimport mock\nimport shutil\nimport filecmp\nimport subprocess\nimport yaml\n\nfrom dvc.main import main\nfrom dvc.output import OutputBase\nfrom dvc.utils import file_md5, load_stage_file\nfrom dvc.system import System\nfrom dvc.stage import Stage, StagePathNotFoundError, StagePathNotDirectoryError\nfrom dvc.stage import StageFileBadNameError, MissingDep\nfrom dvc.stage import StagePathOutsideError, StageFileAlreadyExistsError\nfrom dvc.exceptions import (\n OutputDuplicationError,\n CircularDependencyError,\n CyclicGraphError,\n ArgumentDuplicationError,\n StagePathAsOutputError,\n OverlappingOutputPathsError,\n)\n\nfrom tests.basic_env import TestDvc", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.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/test_run.py_TestRun_TestRun.test.with_self_assertRaises_Ou.self_dvc_run_", "embedding": null, "metadata": {"file_path": "tests/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 26, "end_line": 62, "span_ids": ["TestRun.test", "TestRun"], "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 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 cwd = os.curdir\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 cwd=cwd,\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].path, 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 cwd=cwd,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunEmpty_TestRunMissingDep.test.with_self_assertRaises_Mi.self_dvc_run_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunEmpty_TestRunMissingDep.test.with_self_assertRaises_Mi.self_dvc_run_", "embedding": null, "metadata": {"file_path": "tests/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 65, "end_line": 87, "span_ids": ["TestRunEmpty", "TestRunMissingDep", "TestRunEmpty.test", "TestRunMissingDep.test"], "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 TestRunEmpty(TestDvc):\n def test(self):\n self.dvc.run(\n cmd=\"\",\n deps=[],\n outs=[],\n outs_no_cache=[],\n fname=\"empty.dvc\",\n cwd=os.curdir,\n )\n\n\nclass TestRunMissingDep(TestDvc):\n def test(self):\n with self.assertRaises(MissingDep):\n self.dvc.run(\n cmd=\"\",\n deps=[\"non-existing-dep\"],\n outs=[],\n outs_no_cache=[],\n fname=\"empty.dvc\",\n cwd=os.curdir,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunBadStageFilename_TestRunNoExec.test.self_assertFalse_os_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunBadStageFilename_TestRunNoExec.test.self_assertFalse_os_path_", "embedding": null, "metadata": {"file_path": "tests/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 90, "end_line": 119, "span_ids": ["TestRunNoExec", "TestRunNoExec.test", "TestRunBadStageFilename.test", "TestRunBadStageFilename"], "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 TestRunBadStageFilename(TestDvc):\n def test(self):\n with self.assertRaises(StageFileBadNameError):\n self.dvc.run(\n cmd=\"\",\n deps=[],\n outs=[],\n outs_no_cache=[],\n fname=\"empty\",\n cwd=os.curdir,\n )\n\n with self.assertRaises(StageFileBadNameError):\n self.dvc.run(\n cmd=\"\",\n deps=[],\n outs=[],\n outs_no_cache=[],\n fname=os.path.join(self.DATA_DIR, \"empty.dvc\"),\n cwd=os.curdir,\n )\n\n\nclass TestRunNoExec(TestDvc):\n def test(self):\n self.dvc.run(\n cmd=\"python {} {} {}\".format(self.CODE, self.FOO, \"out\"),\n no_exec=True,\n )\n self.assertFalse(os.path.exists(\"out\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunCircularDependency_TestRunCircularDependency.test_graph.with_self_assertRaises_Cy.self_dvc_run_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunCircularDependency_TestRunCircularDependency.test_graph.with_self_assertRaises_Cy.self_dvc_run_", "embedding": null, "metadata": {"file_path": "tests/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 122, "end_line": 162, "span_ids": ["TestRunCircularDependency.test", "TestRunCircularDependency.test_non_normalized_paths", "TestRunCircularDependency.test_graph", "TestRunCircularDependency.test_outs_no_cache", "TestRunCircularDependency"], "tokens": 262}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRunCircularDependency(TestDvc):\n def test(self):\n with self.assertRaises(CircularDependencyError):\n self.dvc.run(\n cmd=\"\",\n deps=[self.FOO],\n outs=[self.FOO],\n fname=\"circular-dependency.dvc\",\n )\n\n def test_outs_no_cache(self):\n with self.assertRaises(CircularDependencyError):\n self.dvc.run(\n cmd=\"\",\n deps=[self.FOO],\n outs_no_cache=[self.FOO],\n fname=\"circular-dependency.dvc\",\n )\n\n def test_non_normalized_paths(self):\n with self.assertRaises(CircularDependencyError):\n self.dvc.run(\n cmd=\"\",\n deps=[\"./foo\"],\n outs=[\"foo\"],\n fname=\"circular-dependency.dvc\",\n )\n\n def test_graph(self):\n self.dvc.run(\n deps=[self.FOO], outs=[\"bar.txt\"], cmd=\"echo bar > bar.txt\"\n )\n\n self.dvc.run(\n deps=[\"bar.txt\"], outs=[\"baz.txt\"], cmd=\"echo baz > baz.txt\"\n )\n\n with self.assertRaises(CyclicGraphError):\n self.dvc.run(\n deps=[\"baz.txt\"], outs=[self.FOO], cmd=\"echo baz > foo\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.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/test_run.py_TestRunDuplicatedArguments_TestRunDuplicatedArguments.test_non_normalized_paths.with_self_assertRaises_Ar.self_dvc_run_", "embedding": null, "metadata": {"file_path": "tests/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 165, "end_line": 191, "span_ids": ["TestRunDuplicatedArguments.test", "TestRunDuplicatedArguments.test_non_normalized_paths", "TestRunDuplicatedArguments", "TestRunDuplicatedArguments.test_outs_no_cache"], "tokens": 171}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRunDuplicatedArguments(TestDvc):\n def test(self):\n with self.assertRaises(ArgumentDuplicationError):\n self.dvc.run(\n cmd=\"\",\n deps=[],\n outs=[self.FOO, self.FOO],\n fname=\"circular-dependency.dvc\",\n )\n\n def test_outs_no_cache(self):\n with self.assertRaises(ArgumentDuplicationError):\n self.dvc.run(\n cmd=\"\",\n outs=[self.FOO],\n outs_no_cache=[self.FOO],\n fname=\"circular-dependency.dvc\",\n )\n\n def test_non_normalized_paths(self):\n with self.assertRaises(ArgumentDuplicationError):\n self.dvc.run(\n cmd=\"\",\n deps=[],\n outs=[\"foo\", \"./foo\"],\n fname=\"circular-dependency.dvc\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.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/test_run.py_TestRunBadName_TestRunBadName.test_not_found.with_self_assertRaises_St.self_dvc_run_", "embedding": null, "metadata": {"file_path": "tests/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 246, "end_line": 271, "span_ids": ["TestRunBadName.test", "TestRunBadName", "TestRunBadName.test_not_found", "TestRunBadName.test_same_prefix"], "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 TestRunBadName(TestDvc):\n def test(self):\n with self.assertRaises(StagePathOutsideError):\n self.dvc.run(\n cmd=\"\",\n fname=os.path.join(\n self.mkdtemp(), self.FOO + Stage.STAGE_FILE_SUFFIX\n ),\n )\n\n def test_same_prefix(self):\n with self.assertRaises(StagePathOutsideError):\n path = \"{}-{}\".format(self._root_dir, uuid.uuid4())\n os.mkdir(path)\n self.dvc.run(\n cmd=\"\",\n fname=os.path.join(path, self.FOO + Stage.STAGE_FILE_SUFFIX),\n )\n\n def test_not_found(self):\n with self.assertRaises(StagePathNotFoundError):\n path = os.path.join(self._root_dir, str(uuid.uuid4()))\n self.dvc.run(\n cmd=\"\",\n fname=os.path.join(path, self.FOO + Stage.STAGE_FILE_SUFFIX),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestCmdRun_TestCmdRun.test_run.self_assertEqual_stage_cm": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestCmdRun_TestCmdRun.test_run.self_assertEqual_stage_cm", "embedding": null, "metadata": {"file_path": "tests/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 274, "end_line": 300, "span_ids": ["TestCmdRun", "TestCmdRun.test_run"], "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 TestCmdRun(TestDvc):\n def test_run(self):\n ret = main(\n [\n \"run\",\n \"-d\",\n self.FOO,\n \"-d\",\n self.CODE,\n \"-o\",\n \"out\",\n \"-f\",\n \"out.dvc\",\n \"python\",\n self.CODE,\n self.FOO,\n \"out\",\n ]\n )\n\n stage = Stage.load(self.dvc, fname=\"out.dvc\")\n\n self.assertEqual(ret, 0)\n self.assertTrue(os.path.isfile(\"out\"))\n self.assertTrue(os.path.isfile(\"out.dvc\"))\n self.assertTrue(filecmp.cmp(self.FOO, \"out\", shallow=False))\n self.assertEqual(stage.cmd, \"python code.py foo 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/test_run.py_TestCmdRun.test_run_args_from_cli_TestCmdRun.test_keyboard_interrupt.self_assertEqual_ret_252": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestCmdRun.test_run_args_from_cli_TestCmdRun.test_keyboard_interrupt.self_assertEqual_ret_252", "embedding": null, "metadata": {"file_path": "tests/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 311, "end_line": 330, "span_ids": ["TestCmdRun.test_keyboard_interrupt", "TestCmdRun.test_run_bad_command", "TestCmdRun.test_run_args_with_spaces", "TestCmdRun.test_run_args_from_cli"], "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 TestCmdRun(TestDvc):\n\n def test_run_args_from_cli(self):\n ret = main([\"run\", \"echo\", \"foo\"])\n stage = Stage.load(self.dvc, fname=\"Dvcfile\")\n self.assertEqual(ret, 0)\n self.assertEqual(stage.cmd, \"echo foo\")\n\n def test_run_bad_command(self):\n ret = main([\"run\", \"non-existing-command\"])\n self.assertNotEqual(ret, 0)\n\n def test_run_args_with_spaces(self):\n ret = main([\"run\", \"echo\", \"foo bar\"])\n stage = Stage.load(self.dvc, fname=\"Dvcfile\")\n self.assertEqual(ret, 0)\n self.assertEqual(stage.cmd, 'echo \"foo bar\"')\n\n @mock.patch.object(subprocess, \"Popen\", side_effect=KeyboardInterrupt)\n def test_keyboard_interrupt(self, _):\n ret = main([\"run\", \"mycmd\"])\n self.assertEqual(ret, 252)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunRemoveOuts_TestRunRemoveOuts.test.self_assertEqual_ret_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunRemoveOuts_TestRunRemoveOuts.test.self_assertEqual_ret_0_", "embedding": null, "metadata": {"file_path": "tests/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 324, "end_line": 346, "span_ids": ["TestRunRemoveOuts", "TestRunRemoveOuts.test"], "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 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 ret = main(\n [\n \"run\",\n \"--remove-outs\",\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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunUnprotectOutsCopy_TestRunUnprotectOutsCopy.test.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunUnprotectOutsCopy_TestRunUnprotectOutsCopy.test.None_7", "embedding": null, "metadata": {"file_path": "tests/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 355, "end_line": 400, "span_ids": ["TestRunUnprotectOutsCopy.test", "TestRunUnprotectOutsCopy"], "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 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.protected\", \"true\"])\n self.assertEqual(ret, 0)\n\n ret = main([\"config\", \"cache.type\", \"copy\"])\n self.assertEqual(ret, 0)\n\n ret = main(\n [\n \"run\",\n \"-d\",\n self.CODE,\n \"-o\",\n self.FOO,\n \"python\",\n self.CODE,\n self.FOO,\n ]\n )\n self.assertEqual(ret, 0)\n self.assertFalse(os.access(self.FOO, os.W_OK))\n self.assertEqual(open(self.FOO, \"r\").read(), \"foo\")\n\n ret = main(\n [\n \"run\",\n \"--overwrite-dvcfile\",\n \"--ignore-build-cache\",\n \"-d\",\n self.CODE,\n \"-o\",\n self.FOO,\n \"python\",\n self.CODE,\n self.FOO,\n ]\n )\n self.assertEqual(ret, 0)\n self.assertFalse(os.access(self.FOO, os.W_OK))\n self.assertEqual(open(self.FOO, \"r\").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/test_run.py_TestRunUnprotectOutsSymlink_TestRunUnprotectOutsSymlink.test.None_10": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunUnprotectOutsSymlink_TestRunUnprotectOutsSymlink.test.None_10", "embedding": null, "metadata": {"file_path": "tests/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 403, "end_line": 452, "span_ids": ["TestRunUnprotectOutsSymlink", "TestRunUnprotectOutsSymlink.test"], "tokens": 338}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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.protected\", \"true\"])\n self.assertEqual(ret, 0)\n\n ret = main([\"config\", \"cache.type\", \"symlink\"])\n self.assertEqual(ret, 0)\n\n self.assertEqual(ret, 0)\n ret = main(\n [\n \"run\",\n \"-d\",\n self.CODE,\n \"-o\",\n self.FOO,\n \"python\",\n self.CODE,\n self.FOO,\n ]\n )\n self.assertEqual(ret, 0)\n self.assertFalse(os.access(self.FOO, os.W_OK))\n self.assertTrue(System.is_symlink(self.FOO))\n self.assertEqual(open(self.FOO, \"r\").read(), \"foo\")\n\n ret = main(\n [\n \"run\",\n \"--overwrite-dvcfile\",\n \"--ignore-build-cache\",\n \"-d\",\n self.CODE,\n \"-o\",\n self.FOO,\n \"python\",\n self.CODE,\n self.FOO,\n ]\n )\n self.assertEqual(ret, 0)\n self.assertFalse(os.access(self.FOO, os.W_OK))\n self.assertTrue(System.is_symlink(self.FOO))\n self.assertEqual(open(self.FOO, \"r\").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/test_run.py_TestRunUnprotectOutsHardlink_TestRunUnprotectOutsHardlink.test.None_10": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunUnprotectOutsHardlink_TestRunUnprotectOutsHardlink.test.None_10", "embedding": null, "metadata": {"file_path": "tests/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 455, "end_line": 504, "span_ids": ["TestRunUnprotectOutsHardlink", "TestRunUnprotectOutsHardlink.test"], "tokens": 338}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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.protected\", \"true\"])\n self.assertEqual(ret, 0)\n\n ret = main([\"config\", \"cache.type\", \"hardlink\"])\n self.assertEqual(ret, 0)\n\n self.assertEqual(ret, 0)\n ret = main(\n [\n \"run\",\n \"-d\",\n self.CODE,\n \"-o\",\n self.FOO,\n \"python\",\n self.CODE,\n self.FOO,\n ]\n )\n self.assertEqual(ret, 0)\n self.assertFalse(os.access(self.FOO, os.W_OK))\n self.assertTrue(System.is_hardlink(self.FOO))\n self.assertEqual(open(self.FOO, \"r\").read(), \"foo\")\n\n ret = main(\n [\n \"run\",\n \"--overwrite-dvcfile\",\n \"--ignore-build-cache\",\n \"-d\",\n self.CODE,\n \"-o\",\n self.FOO,\n \"python\",\n self.CODE,\n self.FOO,\n ]\n )\n self.assertEqual(ret, 0)\n self.assertFalse(os.access(self.FOO, os.W_OK))\n self.assertTrue(System.is_hardlink(self.FOO))\n self.assertEqual(open(self.FOO, \"r\").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/test_run.py_TestCmdRunOverwrite_TestCmdRunOverwrite.test.None_9": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestCmdRunOverwrite_TestCmdRunOverwrite.test.None_9", "embedding": null, "metadata": {"file_path": "tests/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 503, "end_line": 593, "span_ids": ["TestCmdRunOverwrite.test", "TestCmdRunOverwrite"], "tokens": 507}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCmdRunOverwrite(TestDvc):\n def test(self):\n # NOTE: using sleep() is a workaround for filesystems\n # with low mtime resolution. We have to use mtime since\n # comparing mtime's is the only way to check that the stage\n # file didn't change(size and inode in the first test down\n # below don't change).\n import time\n\n ret = main(\n [\n \"run\",\n \"-d\",\n self.FOO,\n \"-d\",\n self.CODE,\n \"-o\",\n \"out\",\n \"-f\",\n \"out.dvc\",\n \"python\",\n self.CODE,\n self.FOO,\n \"out\",\n ]\n )\n self.assertEqual(ret, 0)\n\n stage_mtime = os.path.getmtime(\"out.dvc\")\n\n time.sleep(1)\n\n ret = main(\n [\n \"run\",\n \"-d\",\n self.FOO,\n \"-d\",\n self.CODE,\n \"-o\",\n \"out\",\n \"-f\",\n \"out.dvc\",\n \"python\",\n self.CODE,\n self.FOO,\n \"out\",\n ]\n )\n self.assertEqual(ret, 0)\n\n # NOTE: check that dvcfile was NOT overwritten\n self.assertEqual(stage_mtime, os.path.getmtime(\"out.dvc\"))\n stage_mtime = os.path.getmtime(\"out.dvc\")\n\n time.sleep(1)\n\n ret = main(\n [\n \"run\",\n \"-d\",\n self.FOO,\n \"-d\",\n self.CODE,\n \"--overwrite-dvcfile\",\n \"--ignore-build-cache\",\n \"-o\",\n \"out\",\n \"-f\",\n \"out.dvc\",\n \"python\",\n self.CODE,\n self.FOO,\n \"out\",\n ]\n )\n self.assertEqual(ret, 0)\n\n # NOTE: check that dvcfile was overwritten\n self.assertNotEqual(stage_mtime, os.path.getmtime(\"out.dvc\"))\n stage_mtime = os.path.getmtime(\"out.dvc\")\n\n time.sleep(1)\n\n ret = main(\n [\"run\", \"--overwrite-dvcfile\", \"-f\", \"out.dvc\", \"-d\", self.BAR]\n )\n self.assertEqual(ret, 0)\n\n # NOTE: check that dvcfile was overwritten\n self.assertNotEqual(stage_mtime, os.path.getmtime(\"out.dvc\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestCmdRunCliMetrics_TestCmdRunCliMetrics.test_not_cached.self_assertEqual_open_me": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestCmdRunCliMetrics_TestCmdRunCliMetrics.test_not_cached.self_assertEqual_open_me", "embedding": null, "metadata": {"file_path": "tests/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 596, "end_line": 605, "span_ids": ["TestCmdRunCliMetrics", "TestCmdRunCliMetrics.test_cached", "TestCmdRunCliMetrics.test_not_cached"], "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 TestCmdRunCliMetrics(TestDvc):\n def test_cached(self):\n ret = main([\"run\", \"-m\", \"metrics.txt\", \"echo test > metrics.txt\"])\n self.assertEqual(ret, 0)\n self.assertEqual(open(\"metrics.txt\", \"r\").read().rstrip(), \"test\")\n\n def test_not_cached(self):\n ret = main([\"run\", \"-M\", \"metrics.txt\", \"echo test > metrics.txt\"])\n self.assertEqual(ret, 0)\n self.assertEqual(open(\"metrics.txt\", \"r\").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/test_run.py_TestRunDeterministicBase_TestRunDeterministicBase._run.self.stage.self_dvc_run_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunDeterministicBase_TestRunDeterministicBase._run.self.stage.self_dvc_run_", "embedding": null, "metadata": {"file_path": "tests/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 608, "end_line": 629, "span_ids": ["TestRunDeterministicBase._run", "TestRunDeterministicBase", "TestRunDeterministicBase.setUp"], "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 TestRunDeterministicBase(TestDvc):\n def setUp(self):\n super(TestRunDeterministicBase, self).setUp()\n self.out_file = \"out\"\n self.stage_file = self.out_file + \".dvc\"\n self.cmd = \"python {} {} {}\".format(self.CODE, self.FOO, self.out_file)\n self.deps = [self.FOO, self.CODE]\n self.outs = [self.out_file]\n self.overwrite = False\n self.ignore_build_cache = False\n\n self._run()\n\n def _run(self):\n self.stage = self.dvc.run(\n cmd=self.cmd,\n fname=self.stage_file,\n overwrite=self.overwrite,\n ignore_build_cache=self.ignore_build_cache,\n deps=self.deps,\n outs=self.outs,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunDeterministic_TestRunDeterministicChangedCmd.test.with_self_assertRaises_St.self__run_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunDeterministic_TestRunDeterministicChangedCmd.test.with_self_assertRaises_St.self__run_", "embedding": null, "metadata": {"file_path": "tests/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 632, "end_line": 693, "span_ids": ["TestRunDeterministicRemoveDep", "TestRunDeterministicNewDep.test", "TestRunDeterministicChangedCmd.test", "TestRunDeterministicChangedOut", "TestRunDeterministic.test", "TestRunDeterministicOverwrite.test", "TestRunDeterministic", "TestRunDeterministicChangedDep", "TestRunDeterministicRemoveDep.test", "TestRunDeterministicNewDep", "TestRunDeterministicChangedDepsList", "TestRunDeterministicChangedCmd", "TestRunDeterministicCallback", "TestRunDeterministicChangedDepsList.test", "TestRunDeterministicCallback.test", "TestRunDeterministicOverwrite", "TestRunDeterministicChangedOut.test", "TestRunDeterministicChangedDep.test"], "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 TestRunDeterministic(TestRunDeterministicBase):\n def test(self):\n self._run()\n\n\nclass TestRunDeterministicOverwrite(TestRunDeterministicBase):\n def test(self):\n self.overwrite = True\n self.ignore_build_cache = True\n self._run()\n\n\nclass TestRunDeterministicCallback(TestRunDeterministicBase):\n def test(self):\n self.stage.remove()\n self.deps = []\n self._run()\n self._run()\n\n\nclass TestRunDeterministicChangedDep(TestRunDeterministicBase):\n def test(self):\n os.unlink(self.FOO)\n shutil.copy(self.BAR, self.FOO)\n with self.assertRaises(StageFileAlreadyExistsError):\n self._run()\n\n\nclass TestRunDeterministicChangedDepsList(TestRunDeterministicBase):\n def test(self):\n self.deps = [self.BAR, self.CODE]\n with self.assertRaises(StageFileAlreadyExistsError):\n self._run()\n\n\nclass TestRunDeterministicNewDep(TestRunDeterministicBase):\n def test(self):\n self.deps = [self.FOO, self.BAR, self.CODE]\n with self.assertRaises(StageFileAlreadyExistsError):\n self._run()\n\n\nclass TestRunDeterministicRemoveDep(TestRunDeterministicBase):\n def test(self):\n self.deps = [self.CODE]\n with self.assertRaises(StageFileAlreadyExistsError):\n self._run()\n\n\nclass TestRunDeterministicChangedOut(TestRunDeterministicBase):\n def test(self):\n os.unlink(self.out_file)\n self.out_file_mtime = None\n with self.assertRaises(StageFileAlreadyExistsError):\n self._run()\n\n\nclass TestRunDeterministicChangedCmd(TestRunDeterministicBase):\n def test(self):\n self.cmd += \" arg\"\n with self.assertRaises(StageFileAlreadyExistsError):\n self._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/test_stage.py_TestSchemaDepsOuts_TestSchemaDepsOuts.test_empty_list.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_stage.py_TestSchemaDepsOuts_TestSchemaDepsOuts.test_empty_list.None_1", "embedding": null, "metadata": {"file_path": "tests/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 32, "end_line": 52, "span_ids": ["TestSchemaDepsOuts.test_none", "TestSchemaDepsOuts.test_empty_list", "TestSchemaDepsOuts", "TestSchemaDepsOuts.test_object"], "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 TestSchemaDepsOuts(TestSchema):\n def test_object(self):\n d = {Stage.PARAM_DEPS: {}}\n self._validate_fail(d)\n\n d = {Stage.PARAM_OUTS: {}}\n self._validate_fail(d)\n\n def test_none(self):\n d = {Stage.PARAM_DEPS: None}\n Stage.validate(d)\n\n d = {Stage.PARAM_OUTS: None}\n Stage.validate(d)\n\n def test_empty_list(self):\n d = {Stage.PARAM_DEPS: []}\n Stage.validate(d)\n\n d = {Stage.PARAM_OUTS: []}\n Stage.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/test_stage.py_TestSchemaDepsOuts.test_list_TestSchemaDepsOuts.test_list.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_stage.py_TestSchemaDepsOuts.test_list_TestSchemaDepsOuts.test_list.None_1", "embedding": null, "metadata": {"file_path": "tests/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 54, "end_line": 66, "span_ids": ["TestSchemaDepsOuts.test_list"], "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 TestSchemaDepsOuts(TestSchema):\n\n def test_list(self):\n lst = [\n {OutputLOCAL.PARAM_PATH: \"foo\", RemoteLOCAL.PARAM_CHECKSUM: \"123\"},\n {OutputLOCAL.PARAM_PATH: \"bar\", RemoteLOCAL.PARAM_CHECKSUM: None},\n {OutputLOCAL.PARAM_PATH: \"baz\"},\n ]\n d = {Stage.PARAM_DEPS: lst}\n Stage.validate(d)\n\n lst[0][OutputLOCAL.PARAM_CACHE] = True\n lst[1][OutputLOCAL.PARAM_CACHE] = False\n d = {Stage.PARAM_OUTS: lst}\n Stage.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/test_state.py_os_TestState.test_update.with_state_.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_state.py_os_TestState.test_update.with_state_.None_2", "embedding": null, "metadata": {"file_path": "tests/test_state.py", "file_name": "test_state.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 31, "span_ids": ["imports", "TestState.test_update", "TestState"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport mock\n\nfrom dvc.utils.compat import str\n\nfrom dvc.state import State\nfrom dvc.utils import file_md5\nfrom dvc.main import main\nfrom dvc.utils.fs import get_inode\n\nfrom tests.basic_env import TestDvc\n\n\nclass TestState(TestDvc):\n def test_update(self):\n path = os.path.join(self.dvc.root_dir, self.FOO)\n md5 = file_md5(path)[0]\n\n state = State(self.dvc, self.dvc.config.config)\n\n with state:\n entry_md5 = state.update(path)\n self.assertEqual(entry_md5, md5)\n\n os.unlink(path)\n with open(path, \"a\") as fd:\n fd.write(\"1\")\n\n md5 = file_md5(path)[0]\n entry_md5 = state.update(path)\n self.assertEqual(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/test_status.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_status.py_os_", "embedding": null, "metadata": {"file_path": "tests/test_status.py", "file_name": "test_status.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 26, "span_ids": ["imports", "TestStatus.test_implied_cloud", "TestStatus.test_quiet", "TestStatus"], "tokens": 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 dvc.main import main\n\nfrom tests.basic_env import TestDvc\nfrom mock import patch\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/test_system.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_system.py__", "embedding": null, "metadata": {"file_path": "tests/test_system.py", "file_name": "test_system.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 20, "span_ids": ["TestSystem", "imports", "TestSystem.test_getdirinfo"], "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\n\nfrom dvc.system import System\nfrom tests.basic_env import TestDir\n\n\nclass TestSystem(TestDir):\n def test_getdirinfo(self):\n if os.name != \"nt\":\n return\n\n # simulate someone holding an exclussive access\n locked = \"locked\"\n fd = os.open(locked, os.O_WRONLY | os.O_CREAT | os.O_EXCL)\n\n # should not raise WinError\n System.getdirinfo(locked)\n\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/test_unprotect.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_unprotect.py_os_", "embedding": null, "metadata": {"file_path": "tests/test_unprotect.py", "file_name": "test_unprotect.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 36, "span_ids": ["imports", "TestUnprotect", "TestUnprotect.test"], "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\n\nfrom dvc.main import main\n\nfrom tests.basic_env import TestDvc\n\n\nclass TestUnprotect(TestDvc):\n def test(self):\n ret = main([\"config\", \"cache.protected\", \"true\"])\n self.assertEqual(ret, 0)\n\n ret = main([\"add\", self.FOO])\n self.assertEqual(ret, 0)\n\n self.assertNotEqual(\n os.stat(self.FOO).st_mode\n & (stat.S_IREAD | stat.S_IRGRP | stat.S_IROTH),\n 0,\n )\n self.assertEqual(\n os.stat(self.FOO).st_mode\n & (stat.S_IWRITE | stat.S_IWGRP | stat.S_IWOTH),\n 0,\n )\n\n ret = main([\"unprotect\", self.FOO])\n self.assertEqual(ret, 0)\n\n self.assertNotEqual(\n os.stat(self.FOO).st_mode\n & (stat.S_IREAD | stat.S_IRGRP | stat.S_IROTH | stat.S_IWRITE),\n 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/tests/test_updater.py_os_TestUpdater.test.os.environ.env_copy_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_updater.py_os_TestUpdater.test.os.environ.env_copy_", "embedding": null, "metadata": {"file_path": "tests/test_updater.py", "file_name": "test_updater.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 25, "span_ids": ["imports", "TestUpdater.test", "TestUpdater"], "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 os\n\nfrom tests.basic_env import TestDvc\n\n\nclass TestUpdater(TestDvc):\n def test(self):\n # NOTE: only test on travis CRON to avoid generating too much logs\n travis = os.getenv(\"TRAVIS\") == \"true\"\n if not travis:\n return\n\n cron = os.getenv(\"TRAVIS_EVENT_TYPE\") == \"cron\"\n if not cron:\n return\n\n env = os.environ.copy()\n if os.getenv(\"CI\"):\n del os.environ[\"CI\"]\n\n self.dvc.updater.check()\n self.dvc.updater.check()\n self.dvc.updater.check()\n\n os.environ = env.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/test_updater.py_TestUpdater.test_check_version_newer_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_updater.py_TestUpdater.test_check_version_newer_", "embedding": null, "metadata": {"file_path": "tests/test_updater.py", "file_name": "test_updater.py", "file_type": "text/x-python", "category": "test", "start_line": 27, "end_line": 44, "span_ids": ["TestUpdater.test_check_version_outdated", "TestUpdater.test_check_version_newer", "TestUpdater.test_check_version_equal"], "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 TestUpdater(TestDvc):\n\n def test_check_version_newer(self):\n self.dvc.updater.latest = \"0.20.8\"\n self.dvc.updater.current = \"0.21.0\"\n\n self.assertFalse(self.dvc.updater._is_outdated())\n\n def test_check_version_equal(self):\n self.dvc.updater.latest = \"0.20.8\"\n self.dvc.updater.current = \"0.20.8\"\n\n self.assertFalse(self.dvc.updater._is_outdated())\n\n def test_check_version_outdated(self):\n self.dvc.updater.latest = \"0.21.0\"\n self.dvc.updater.current = \"0.20.8\"\n\n self.assertTrue(self.dvc.updater._is_outdated())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_utils.py_os_TestUtils.test_file_md5_crlf.self_assertEqual_utils_fi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_utils.py_os_TestUtils.test_file_md5_crlf.self_assertEqual_utils_fi", "embedding": null, "metadata": {"file_path": "tests/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 38, "span_ids": ["imports", "TestUtils.test_file_md5_crlf", "TestUtils.test_copyfile", "TestUtils"], "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": "import os\nimport shutil\nimport filecmp\n\nfrom dvc import utils\nfrom tests.basic_env import TestDvc\n\n\nclass TestUtils(TestDvc):\n def test_copyfile(self):\n src = \"file1\"\n dest = \"file2\"\n dest_dir = \"testdir\"\n\n with open(src, \"w+\") as f:\n f.write(\"file1contents\")\n\n os.mkdir(dest_dir)\n\n utils.copyfile(src, dest)\n self.assertTrue(filecmp.cmp(src, dest, shallow=False))\n\n utils.copyfile(src, dest_dir)\n self.assertTrue(\n filecmp.cmp(src, \"{}/{}\".format(dest_dir, src), shallow=False)\n )\n\n shutil.rmtree(dest_dir)\n os.remove(src)\n os.remove(dest)\n\n def test_file_md5_crlf(self):\n with open(\"cr\", \"wb+\") as fd:\n fd.write(b\"a\\nb\\nc\")\n with open(\"crlf\", \"wb+\") as fd:\n fd.write(b\"a\\r\\nb\\r\\nc\")\n\n self.assertEqual(utils.file_md5(\"cr\")[0], utils.file_md5(\"crlf\")[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/test_utils.py_TestUtils.test_dict_md5_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_utils.py_TestUtils.test_dict_md5_", "embedding": null, "metadata": {"file_path": "tests/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 40, "end_line": 61, "span_ids": ["TestUtils.test_dict_md5"], "tokens": 210}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestUtils(TestDvc):\n\n def test_dict_md5(self):\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 self.assertEqual(md5, utils.dict_md5(d, exclude=[\"metric\", \"locked\"]))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/utils/httpd.py_hashlib_ContentMD5Handler.end_headers.SimpleHTTPRequestHandler_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/utils/httpd.py_hashlib_ContentMD5Handler.end_headers.SimpleHTTPRequestHandler_", "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": 29, "span_ids": ["ETagHandler.end_headers", "imports", "ContentMD5Handler.end_headers", "ETagHandler", "ContentMD5Handler"], "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": "import hashlib\nimport os\nimport threading\n\nfrom dvc.utils.compat import HTTPServer, SimpleHTTPRequestHandler\n\n\nclass ETagHandler(SimpleHTTPRequestHandler):\n def end_headers(self):\n file = self.translate_path(self.path)\n\n if not os.path.isdir(file) and os.path.exists(file):\n with open(file, \"r\") as fd:\n etag = hashlib.md5(fd.read().encode(\"utf8\")).hexdigest()\n self.send_header(\"ETag\", etag)\n\n SimpleHTTPRequestHandler.end_headers(self)\n\n\nclass ContentMD5Handler(SimpleHTTPRequestHandler):\n def end_headers(self):\n file = self.translate_path(self.path)\n\n if not os.path.isdir(file) and os.path.exists(file):\n with open(file, \"r\") as fd:\n md5 = hashlib.md5(fd.read().encode(\"utf8\")).hexdigest()\n self.send_header(\"Content-MD5\", md5)\n\n SimpleHTTPRequestHandler.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_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": 32, "end_line": 64, "span_ids": ["StaticFileServer.__exit__", "StaticFileServer.__init__", "StaticFileServer.__enter__", "StaticFileServer", "StaticFileServer.bind_port_by_any_means"], "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 StaticFileServer:\n _server_lock = threading.Lock()\n\n def __init__(self, handler=\"etag\"):\n self._server_lock.acquire()\n handler_class = ETagHandler if handler == \"etag\" else ContentMD5Handler\n self.bind_port_by_any_means(handler_class)\n\n def bind_port_by_any_means(self, handler_class):\n import time\n\n # shutdowning/closing socket/server does not unbind port in time,\n # locking the server also does not bring results, hence\n # this method\n for i in range(10000):\n try:\n self.httpd = HTTPServer((\"localhost\", 8000), handler_class)\n except Exception:\n time.sleep(0.01)\n continue\n break\n\n def __enter__(self):\n self.server_thread = threading.Thread(target=self.httpd.serve_forever)\n self.server_thread.daemon = True\n self.server_thread.start()\n\n def __exit__(self, *args):\n self.httpd.socket.close()\n self.httpd.shutdown()\n self.httpd.server_close()\n self._server_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/tests/utils/logger.py_logging_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/utils/logger.py_logging_", "embedding": null, "metadata": {"file_path": "tests/utils/logger.py", "file_name": "logger.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 36, "span_ids": ["MockLoggerHandlers.__exit__", "imports", "ConsoleFontColorsRemover", "ConsoleFontColorsRemover.__exit__", "ConsoleFontColorsRemover.__enter__", "MockLoggerHandlers", "MockLoggerHandlers.__init__", "ConsoleFontColorsRemover.__init__", "MockLoggerHandlers.__enter__"], "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 logging\nfrom mock import patch\nimport dvc.logger as logger\n\n\nclass MockLoggerHandlers(object):\n def __init__(self, l, num=2):\n self._logger = l\n self._handlers = l.handlers\n self._num = num\n\n def __enter__(self):\n self._logger.handlers = [\n logging.FileHandler(\"tmp{}.log\".format(i))\n for i in range(self._num)\n ]\n return self\n\n def __exit__(self, exc_type=None, exc_val=None, exc_tb=None):\n for h in self._logger.handlers:\n h.close()\n self._logger.handlers = self._handlers\n\n\nclass ConsoleFontColorsRemover(object):\n def __init__(self):\n self.color_patch = patch.object(\n logger, \"colorize\", new=lambda x, color=\"\": x\n )\n\n def __enter__(self):\n self.color_patch.start()\n\n def __exit__(self, exc_type=None, exc_val=None, exc_tb=None):\n self.color_patch.stop()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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.py_Stage.validate_Stage._check_stage_path.if_not_real_path_os_pa.raise_StagePathOutsideErr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage.validate_Stage._check_stage_path.if_not_real_path_os_pa.raise_StagePathOutsideErr", "embedding": null, "metadata": {"file_path": "dvc/stage.py", "file_name": "stage.py", "file_type": "text/x-python", "category": "implementation", "start_line": 298, "end_line": 349, "span_ids": ["Stage._stage_fname", "Stage._expand_to_path_on_add_local", "Stage.validate", "Stage._check_stage_path"], "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": "class Stage(object):\n\n @staticmethod\n def validate(d, fname=None):\n from dvc.utils import convert_to_unicode\n\n try:\n Schema(Stage.SCHEMA).validate(convert_to_unicode(d))\n except SchemaError as exc:\n raise StageFileFormatError(fname, exc)\n\n @classmethod\n def _stage_fname(cls, fname, outs, add):\n if fname:\n return fname\n\n if not outs:\n return cls.STAGE_FILE\n\n out = outs[0]\n path_handler = out.remote.ospath\n\n fname = path_handler.basename(out.path) + cls.STAGE_FILE_SUFFIX\n\n fname = Stage._expand_to_path_on_add_local(\n add, fname, out, path_handler\n )\n\n return fname\n\n @staticmethod\n def _expand_to_path_on_add_local(add, fname, out, path_handler):\n if (\n add\n and out.is_local\n and not contains_symlink_up_to(out.path, out.repo.root_dir)\n ):\n fname = path_handler.join(path_handler.dirname(out.path), fname)\n return fname\n\n @staticmethod\n def _check_stage_path(repo, path):\n assert repo is not None\n\n real_path = os.path.realpath(path)\n if not os.path.exists(real_path):\n raise StagePathNotFoundError(path)\n\n if not os.path.isdir(real_path):\n raise StagePathNotDirectoryError(path)\n\n proj_dir = os.path.realpath(repo.root_dir) + os.path.sep\n if not (real_path + os.path.sep).startswith(proj_dir):\n raise StagePathOutsideError(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.py_Stage._compute_md5_Stage._compute_md5.return.m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage._compute_md5_Stage._compute_md5.return.m", "embedding": null, "metadata": {"file_path": "dvc/stage.py", "file_name": "stage.py", "file_type": "text/x-python", "category": "implementation", "start_line": 623, "end_line": 651, "span_ids": ["Stage._compute_md5"], "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 Stage(object):\n\n def _compute_md5(self):\n from dvc.output.local import OutputLOCAL\n\n d = self.dumpd()\n\n # NOTE: removing md5 manually in order to not affect md5s in deps/outs\n if self.PARAM_MD5 in d.keys():\n del d[self.PARAM_MD5]\n\n # Ignore the wdir default value. In this case stage 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 stage files.\n if d.get(self.PARAM_WDIR) == \".\":\n del d[self.PARAM_WDIR]\n\n # NOTE: excluding parameters that don't affect the state of the\n # pipeline. Not excluding `OutputLOCAL.PARAM_CACHE`, because if\n # it has changed, we might not have that output in our cache.\n m = dict_md5(\n d,\n exclude=[\n self.PARAM_LOCKED,\n OutputLOCAL.PARAM_METRIC,\n OutputLOCAL.PARAM_TAGS,\n ],\n )\n logger.debug(\"Computed stage '{}' md5: '{}'\".format(self.relpath, m))\n return m", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py__Helpers_for_other_modu_dos2unix.return.data_replace_b_r_n_b_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py__Helpers_for_other_modu_dos2unix.return.data_replace_b_r_n_b_", "embedding": null, "metadata": {"file_path": "dvc/utils/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 26, "span_ids": ["dos2unix", "docstring"], "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": "\"\"\"Helpers for other modules.\"\"\"\n\nfrom __future__ import unicode_literals\n\nimport yaml\nfrom dvc.utils.compat import str, builtin_str, open, cast_bytes_py2\n\nimport os\nimport sys\nimport stat\nimport math\nimport json\nimport shutil\nimport hashlib\nimport nanotime\nimport time\n\nfrom yaml.scanner import ScannerError\n\nLOCAL_CHUNK_SIZE = 1024 * 1024\nLARGE_FILE_SIZE = 1024 * 1024 * 1024\nLARGE_DIR_SIZE = 100\n\n\ndef dos2unix(data):\n return data.replace(b\"\\r\\n\", b\"\\n\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_file_md5_file_md5.if_os_path_exists_fname_.else_.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.if_os_path_exists_fname_.else_.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": 27, "end_line": 67, "span_ids": ["file_md5"], "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": "def file_md5(fname):\n \"\"\" get the (md5 hexdigest, md5 digest) of a file \"\"\"\n import dvc.logger as logger\n from dvc.progress import progress\n from dvc.istextfile import istextfile\n\n if os.path.exists(fname):\n hash_md5 = hashlib.md5()\n binary = not istextfile(fname)\n size = os.path.getsize(fname)\n bar = False\n if size >= LARGE_FILE_SIZE:\n bar = True\n msg = \"Computing md5 for a large file {}. This is only done once.\"\n logger.info(msg.format(os.path.relpath(fname)))\n name = os.path.relpath(fname)\n total = 0\n\n with open(fname, \"rb\") as fobj:\n while True:\n data = fobj.read(LOCAL_CHUNK_SIZE)\n if not data:\n break\n\n if bar:\n total += len(data)\n progress.update_target(name, total, size)\n\n if binary:\n chunk = data\n else:\n chunk = dos2unix(data)\n\n hash_md5.update(chunk)\n\n if bar:\n progress.finish_target(name)\n\n return (hash_md5.hexdigest(), hash_md5.digest())\n else:\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/fs.py_from___future___import_un_get_mtime_and_size.return.str_int_nanotime_timestam": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/fs.py_from___future___import_un_get_mtime_and_size.return.str_int_nanotime_timestam", "embedding": null, "metadata": {"file_path": "dvc/utils/fs.py", "file_name": "fs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 34, "span_ids": ["get_mtime_and_size", "imports", "get_inode"], "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": "from __future__ import unicode_literals\n\nimport nanotime\nimport os\n\nimport dvc.logger as logger\nfrom dvc.exceptions import DvcException\nfrom dvc.system import System\nfrom dvc.utils.compat import str\n\n\ndef get_inode(path):\n inode = System.inode(path)\n logger.debug(\"Path {} inode {}\".format(path, inode))\n return inode\n\n\ndef get_mtime_and_size(path):\n size = os.path.getsize(path)\n mtime = os.path.getmtime(path)\n\n if os.path.isdir(path):\n for root, dirs, files in os.walk(str(path)):\n for name in dirs + files:\n entry = os.path.join(root, name)\n stat = os.stat(entry)\n size += stat.st_size\n entry_mtime = stat.st_mtime\n if entry_mtime > mtime:\n mtime = entry_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(int(nanotime.timestamp(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_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/fs.py_BasePathNotInCheckedPathException_", "embedding": null, "metadata": {"file_path": "dvc/utils/fs.py", "file_name": "fs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 37, "end_line": 56, "span_ids": ["BasePathNotInCheckedPathException.__init__", "BasePathNotInCheckedPathException", "contains_symlink_up_to"], "tokens": 146}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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(DvcException, self).__init__(msg)\n\n\ndef contains_symlink_up_to(path, base_path):\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/tests/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/test_add.py_TestAddLocalRemoteFile_TestAddLocalRemoteFile.test.None_4", "embedding": null, "metadata": {"file_path": "tests/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 170, "end_line": 195, "span_ids": ["TestAddLocalRemoteFile.test", "TestAddLocalRemoteFile"], "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 TestAddLocalRemoteFile(TestDvc):\n def test(self):\n \"\"\"\n Making sure that 'remote' syntax is handled properly for local outs.\n \"\"\"\n cwd = os.getcwd()\n remote = \"myremote\"\n\n ret = main([\"remote\", \"add\", remote, cwd])\n self.assertEqual(ret, 0)\n\n self.dvc = DvcRepo()\n\n foo = \"remote://{}/{}\".format(remote, self.FOO)\n ret = main([\"add\", foo])\n self.assertEqual(ret, 0)\n\n d = load_stage_file(\"foo.dvc\")\n self.assertEqual(d[\"outs\"][0][\"path\"], foo)\n\n bar = os.path.join(cwd, self.BAR)\n ret = main([\"add\", bar])\n self.assertEqual(ret, 0)\n\n d = load_stage_file(\"bar.dvc\")\n self.assertEqual(d[\"outs\"][0][\"path\"], 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/test_add.py_TestShouldNotCheckCacheForDirIfCacheMetadataDidNotChange_TestShouldNotCheckCacheForDirIfCacheMetadataDidNotChange.test.with_patch_object_.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestShouldNotCheckCacheForDirIfCacheMetadataDidNotChange_TestShouldNotCheckCacheForDirIfCacheMetadataDidNotChange.test.with_patch_object_.None_4", "embedding": null, "metadata": {"file_path": "tests/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 280, "end_line": 300, "span_ids": ["TestShouldNotCheckCacheForDirIfCacheMetadataDidNotChange.test", "TestShouldNotCheckCacheForDirIfCacheMetadataDidNotChange"], "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 TestShouldNotCheckCacheForDirIfCacheMetadataDidNotChange(TestDvc):\n def test(self):\n remote_local_loader_spy = spy(\n dvc.remote.local.RemoteLOCAL.load_dir_cache\n )\n with patch.object(\n dvc.remote.local.RemoteLOCAL,\n \"load_dir_cache\",\n remote_local_loader_spy,\n ):\n\n ret = main([\"config\", \"cache.type\", \"copy\"])\n self.assertEqual(ret, 0)\n\n ret = main([\"add\", self.DATA_DIR])\n self.assertEqual(ret, 0)\n self.assertEqual(1, remote_local_loader_spy.mock.call_count)\n\n ret = main([\"status\", \"{}.dvc\".format(self.DATA_DIR)])\n self.assertEqual(ret, 0)\n self.assertEqual(1, remote_local_loader_spy.mock.call_count)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestShouldCollectDirCacheOnlyOnce_TestShouldCollectDirCacheOnlyOnce.test.self_assertEqual_1_colle": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestShouldCollectDirCacheOnlyOnce_TestShouldCollectDirCacheOnlyOnce.test.self_assertEqual_1_colle", "embedding": null, "metadata": {"file_path": "tests/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 303, "end_line": 332, "span_ids": ["TestShouldCollectDirCacheOnlyOnce", "TestShouldCollectDirCacheOnlyOnce.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 TestShouldCollectDirCacheOnlyOnce(TestDvc):\n NEW_LARGE_DIR_SIZE = 1\n\n @patch(\"dvc.remote.local.LARGE_DIR_SIZE\", NEW_LARGE_DIR_SIZE)\n def test(self):\n from dvc.remote.local import RemoteLOCAL\n\n collect_dir_counter = spy(RemoteLOCAL.collect_dir_cache)\n with patch.object(\n RemoteLOCAL, \"collect_dir_cache\", collect_dir_counter\n ):\n\n LARGE_DIR_FILES_NUM = self.NEW_LARGE_DIR_SIZE + 1\n data_dir = \"dir\"\n\n os.makedirs(data_dir)\n\n for i in range(LARGE_DIR_FILES_NUM):\n with open(os.path.join(data_dir, str(i)), \"w+\") as f:\n f.write(str(i))\n\n ret = main([\"add\", data_dir])\n self.assertEqual(0, ret)\n\n ret = main([\"status\"])\n self.assertEqual(0, ret)\n\n ret = main([\"status\"])\n self.assertEqual(0, ret)\n self.assertEqual(1, collect_dir_counter.mock.call_count)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/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/test_add.py_SymlinkAddTestBase_SymlinkAddTestBase._test.self_assertEqual_relative", "embedding": null, "metadata": {"file_path": "tests/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 335, "end_line": 363, "span_ids": ["SymlinkAddTestBase._test", "SymlinkAddTestBase", "SymlinkAddTestBase._prepare_external_data", "SymlinkAddTestBase._get_data_dir"], "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 SymlinkAddTestBase(TestDvc):\n def _get_data_dir(self):\n raise NotImplementedError\n\n def _prepare_external_data(self):\n data_dir = self._get_data_dir()\n\n self.data_file_name = \"data_file\"\n external_data_path = os.path.join(data_dir, self.data_file_name)\n with open(external_data_path, \"w+\") as f:\n f.write(\"data\")\n\n self.link_name = \"data_link\"\n System.symlink(data_dir, self.link_name)\n\n def _test(self):\n self._prepare_external_data()\n\n ret = main([\"add\", os.path.join(self.link_name, self.data_file_name)])\n self.assertEqual(0, ret)\n\n stage_file = self.data_file_name + Stage.STAGE_FILE_SUFFIX\n self.assertTrue(os.path.exists(stage_file))\n\n d = load_stage_file(stage_file)\n relative_data_path = posixpath.join(\n self.link_name, self.data_file_name\n )\n self.assertEqual(relative_data_path, d[\"outs\"][0][\"path\"])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestCmdReproChdirCwdBackwardCompatible_TestCmdReproChdirCwdBackwardCompatible.test.None_11": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestCmdReproChdirCwdBackwardCompatible_TestCmdReproChdirCwdBackwardCompatible.test.None_11", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 735, "end_line": 770, "span_ids": ["TestCmdReproChdirCwdBackwardCompatible.test", "TestCmdReproChdirCwdBackwardCompatible"], "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 TestCmdReproChdirCwdBackwardCompatible(TestDvc):\n def test(self):\n dname = \"dir\"\n os.mkdir(dname)\n foo = os.path.join(dname, self.FOO)\n bar = os.path.join(dname, self.BAR)\n code = os.path.join(dname, self.CODE)\n shutil.copyfile(self.FOO, foo)\n shutil.copyfile(self.CODE, code)\n\n ret = main(\n [\n \"run\",\n \"-f\",\n \"Dvcfile\",\n \"-c\",\n dname,\n \"-d\",\n self.FOO,\n \"-o\",\n self.BAR,\n \"python {} {} {}\".format(self.CODE, self.FOO, self.BAR),\n ]\n )\n self.assertEqual(ret, 0)\n self.assertTrue(os.path.isfile(foo))\n self.assertTrue(os.path.isfile(bar))\n self.assertTrue(filecmp.cmp(foo, bar, shallow=False))\n\n os.unlink(bar)\n\n ret = main([\"repro\", \"-c\", dname])\n self.assertEqual(ret, 0)\n self.assertTrue(os.path.isfile(foo))\n self.assertTrue(os.path.isfile(bar))\n self.assertTrue(filecmp.cmp(foo, bar, shallow=False))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunStageInsideOutput_TestRunBadCwd.test_same_prefix.with_self_assertRaises_St.self_dvc_run_cmd_cwd_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunStageInsideOutput_TestRunBadCwd.test_same_prefix.with_self_assertRaises_St.self_dvc_run_cmd_cwd_", "embedding": null, "metadata": {"file_path": "tests/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 197, "end_line": 224, "span_ids": ["TestRunStageInsideOutput.test_cwd", "TestRunBadCwd.test", "TestRunStageInsideOutput", "TestRunStageInsideOutput.test_file_name", "TestRunBadCwd", "TestRunBadCwd.test_same_prefix"], "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 TestRunStageInsideOutput(TestDvc):\n def test_cwd(self):\n self.dvc.run(cmd=\"\", deps=[], outs=[self.DATA_DIR])\n\n with self.assertRaises(StagePathAsOutputError):\n self.dvc.run(cmd=\"\", cwd=self.DATA_DIR, fname=\"inside-cwd.dvc\")\n\n def test_file_name(self):\n self.dvc.run(cmd=\"\", deps=[], outs=[self.DATA_DIR])\n\n with self.assertRaises(StagePathAsOutputError):\n self.dvc.run(\n cmd=\"\",\n outs=[self.FOO],\n fname=os.path.join(self.DATA_DIR, \"inside-cwd.dvc\"),\n )\n\n\nclass TestRunBadCwd(TestDvc):\n def test(self):\n with self.assertRaises(StagePathOutsideError):\n self.dvc.run(cmd=\"\", cwd=self.mkdtemp())\n\n def test_same_prefix(self):\n with self.assertRaises(StagePathOutsideError):\n path = \"{}-{}\".format(self._root_dir, uuid.uuid4())\n os.mkdir(path)\n self.dvc.run(cmd=\"\", cwd=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/test_run.py_TestRunBadWdir_TestRunBadWdir.test_not_dir.with_self_assertRaises_St.self_dvc_run_cmd_wdir": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunBadWdir_TestRunBadWdir.test_not_dir.with_self_assertRaises_St.self_dvc_run_cmd_wdir", "embedding": null, "metadata": {"file_path": "tests/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 230, "end_line": 252, "span_ids": ["TestRunBadWdir.test_same_prefix", "TestRunBadWdir.test", "TestRunBadWdir", "TestRunBadWdir.test_not_found", "TestRunBadWdir.test_not_dir"], "tokens": 203}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRunBadWdir(TestDvc):\n def test(self):\n with self.assertRaises(StagePathOutsideError):\n self.dvc.run(cmd=\"\", wdir=self.mkdtemp())\n\n def test_same_prefix(self):\n with self.assertRaises(StagePathOutsideError):\n path = \"{}-{}\".format(self._root_dir, uuid.uuid4())\n os.mkdir(path)\n self.dvc.run(cmd=\"\", wdir=path)\n\n def test_not_found(self):\n with self.assertRaises(StagePathNotFoundError):\n path = os.path.join(self._root_dir, str(uuid.uuid4()))\n self.dvc.run(cmd=\"\", wdir=path)\n\n def test_not_dir(self):\n with self.assertRaises(StagePathNotDirectoryError):\n path = os.path.join(self._root_dir, str(uuid.uuid4()))\n os.mkdir(path)\n path = os.path.join(path, str(uuid.uuid4()))\n open(path, \"a\").close()\n self.dvc.run(cmd=\"\", wdir=path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestCmdRunWorkingDirectory_TestCmdRunWorkingDirectory.test_default_wdir_is_written.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestCmdRunWorkingDirectory_TestCmdRunWorkingDirectory.test_default_wdir_is_written.None_1", "embedding": null, "metadata": {"file_path": "tests/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 617, "end_line": 631, "span_ids": ["TestCmdRunWorkingDirectory", "TestCmdRunWorkingDirectory.test_default_wdir_is_written"], "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 TestCmdRunWorkingDirectory(TestDvc):\n def test_default_wdir_is_written(self):\n stage = self.dvc.run(\n cmd=\"echo test > {}\".format(self.FOO), outs=[self.FOO], wdir=\".\"\n )\n with open(stage.relpath, \"r\") as fobj:\n d = yaml.safe_load(fobj)\n self.assertEqual(d[Stage.PARAM_WDIR], \".\")\n\n stage = self.dvc.run(\n cmd=\"echo test > {}\".format(self.BAR), outs=[self.BAR]\n )\n with open(stage.relpath, \"r\") as fobj:\n d = yaml.safe_load(fobj)\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/test_run.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/test_run.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/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 633, "end_line": 649, "span_ids": ["TestCmdRunWorkingDirectory.test_fname_changes_path_and_wdir"], "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 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\" + Stage.STAGE_FILE_SUFFIX)\n stage = self.dvc.run(\n cmd=\"echo test > {}\".format(foo), outs=[foo], fname=fname\n )\n self.assertEqual(stage.wdir, os.path.realpath(self._root_dir))\n self.assertEqual(\n stage.path, os.path.join(os.path.realpath(self._root_dir), fname)\n )\n\n # Check that it is dumped properly (relative to fname)\n with open(stage.relpath, \"r\") as fobj:\n d = yaml.safe_load(fobj)\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/test_run.py_TestCmdRunWorkingDirectory.test_cwd_is_ignored_TestCmdRunWorkingDirectory.test_cwd_is_ignored.self_assertEqual_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestCmdRunWorkingDirectory.test_cwd_is_ignored_TestCmdRunWorkingDirectory.test_cwd_is_ignored.self_assertEqual_", "embedding": null, "metadata": {"file_path": "tests/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 651, "end_line": 666, "span_ids": ["TestCmdRunWorkingDirectory.test_cwd_is_ignored"], "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 TestCmdRunWorkingDirectory(TestDvc):\n\n def test_cwd_is_ignored(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(\"stage\" + Stage.STAGE_FILE_SUFFIX)\n stage = self.dvc.run(\n cmd=\"echo test > {}\".format(foo),\n outs=[foo],\n cwd=dname,\n wdir=\".\",\n fname=fname,\n )\n self.assertEqual(stage.wdir, os.path.realpath(self._root_dir))\n self.assertEqual(\n stage.path, os.path.join(os.path.realpath(self._root_dir), fname)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_stage.py_yaml_TestSchemaCmd.test_cmd_str.Stage_validate_d_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_stage.py_yaml_TestSchemaCmd.test_cmd_str.Stage_validate_d_", "embedding": null, "metadata": {"file_path": "tests/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 32, "span_ids": ["TestSchema", "TestSchemaCmd.test_cmd_none", "imports", "TestSchemaCmd", "TestSchemaCmd.test_cmd_object", "TestSchema._validate_fail", "TestSchemaCmd.test_cmd_str", "TestSchemaCmd.test_no_cmd"], "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 yaml\n\nfrom dvc.output.local import OutputLOCAL\nfrom dvc.remote.local import RemoteLOCAL\nfrom dvc.stage import Stage, StageFileFormatError\nfrom dvc.utils import load_stage_file\n\nfrom tests.basic_env import TestDvc\n\n\nclass TestSchema(TestDvc):\n def _validate_fail(self, d):\n with self.assertRaises(StageFileFormatError):\n Stage.validate(d)\n\n\nclass TestSchemaCmd(TestSchema):\n def test_cmd_object(self):\n d = {Stage.PARAM_CMD: {}}\n self._validate_fail(d)\n\n def test_cmd_none(self):\n d = {Stage.PARAM_CMD: None}\n Stage.validate(d)\n\n def test_no_cmd(self):\n d = {}\n Stage.validate(d)\n\n def test_cmd_str(self):\n d = {Stage.PARAM_CMD: \"cmd\"}\n Stage.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/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/test_stage.py_TestReload_TestReload.test.self_assertEqual_d_stage_", "embedding": null, "metadata": {"file_path": "tests/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 72, "end_line": 95, "span_ids": ["TestReload.test", "TestReload"], "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 TestReload(TestDvc):\n def test(self):\n import yaml\n\n stages = self.dvc.add(self.FOO)\n self.assertEqual(len(stages), 1)\n stage = stages[0]\n self.assertTrue(stage is not None)\n\n d = load_stage_file(stage.relpath)\n\n # NOTE: checking that reloaded stage didn't change its checksum\n md5 = \"11111111111111111111111111111111\"\n d[stage.PARAM_MD5] = md5\n\n with open(stage.relpath, \"w\") as fobj:\n yaml.safe_dump(d, fobj, default_flow_style=False)\n\n stage = Stage.load(self.dvc, stage.relpath)\n self.assertTrue(stage is not None)\n stage.dump()\n\n d = load_stage_file(stage.relpath)\n self.assertEqual(d[stage.PARAM_MD5], md5)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_stage.py_TestDefaultWorkingDirectory_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_stage.py_TestDefaultWorkingDirectory_", "embedding": null, "metadata": {"file_path": "tests/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 98, "end_line": 124, "span_ids": ["TestDefaultWorkingDirectory", "TestDefaultWorkingDirectory.test_ignored_in_checksum"], "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 TestDefaultWorkingDirectory(TestDvc):\n def test_ignored_in_checksum(self):\n stage = self.dvc.run(\n cmd=\"echo test > {}\".format(self.FOO),\n deps=[self.BAR],\n outs=[self.FOO],\n )\n\n d = stage.dumpd()\n self.assertEqual(d[stage.PARAM_WDIR], \".\")\n\n with open(stage.relpath, \"r\") as fobj:\n d = yaml.safe_load(fobj)\n self.assertEqual(d[stage.PARAM_WDIR], \".\")\n\n del d[stage.PARAM_WDIR]\n with open(stage.relpath, \"w\") as fobj:\n yaml.safe_dump(d, fobj, default_flow_style=False)\n\n with open(stage.relpath, \"r\") as fobj:\n d = yaml.safe_load(fobj)\n self.assertIsNone(d.get(stage.PARAM_WDIR))\n\n with self.dvc.state:\n stage = Stage.load(self.dvc, stage.relpath)\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/dvc/command/add.py_from___future___import_un_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_from___future___import_un_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": 27, "span_ids": ["imports", "CmdAdd", "CmdAdd.run"], "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": "from __future__ import unicode_literals\n\nimport argparse\n\nimport dvc.logger as logger\nfrom dvc.exceptions import DvcException\nfrom dvc.command.base import CmdBase, append_doc_link\n\n\nclass CmdAdd(CmdBase):\n def run(self):\n try:\n if len(self.args.targets) > 1 and self.args.file:\n raise DvcException(\"can't use '--file' with multiple targets\")\n\n for target in self.args.targets:\n self.repo.add(\n target,\n recursive=self.args.recursive,\n no_commit=self.args.no_commit,\n fname=self.args.file,\n )\n\n except DvcException:\n logger.error(\"failed to add file\")\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/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": 30, "end_line": 67, "span_ids": ["add_parser"], "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": "def add_parser(subparsers, parent_parser):\n ADD_HELP = \"Take data files or directories under DVC control.\"\n\n add_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 add_parser.add_argument(\n \"-R\",\n \"--recursive\",\n action=\"store_true\",\n default=False,\n help=\"Recursively add each file under the directory.\",\n )\n add_parser.add_argument(\n \"--no-commit\",\n action=\"store_true\",\n default=False,\n help=\"Don't put files/directories into cache.\",\n )\n add_parser.add_argument(\n \"-f\",\n \"--file\",\n help=\"Specify name of the stage file. It should be \"\n \"either 'Dvcfile' or have a '.dvc' suffix (e.g. \"\n \"'prepare.dvc', 'clean.dvc', etc) in order for \"\n \"dvc to be able to find it later. By default \"\n \"the output basename + .dvc is used as a stage filename. \"\n \"(NOTE: It can't be used when specifying multiple targets)\",\n )\n add_parser.add_argument(\n \"targets\", nargs=\"+\", help=\"Input files/directories.\"\n )\n add_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/remote/hdfs.py_RemoteHDFS.upload_RemoteHDFS.upload.for_from_info_to_info_n.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_RemoteHDFS.upload_RemoteHDFS.upload.for_from_info_to_info_n.None_2", "embedding": null, "metadata": {"file_path": "dvc/remote/hdfs.py", "file_name": "hdfs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 111, "end_line": 136, "span_ids": ["RemoteHDFS.upload"], "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 RemoteHDFS(RemoteBase):\n\n def upload(self, from_infos, to_infos, names=None):\n names = self._verify_path_args(to_infos, from_infos, names)\n\n for from_info, to_info, name in zip(from_infos, to_infos, names):\n if to_info[\"scheme\"] != \"hdfs\":\n raise NotImplementedError\n\n if from_info[\"scheme\"] != \"local\":\n raise NotImplementedError\n\n self.hadoop_fs(\n \"mkdir -p {}\".format(posixpath.dirname(to_info[\"path\"])),\n user=to_info[\"user\"],\n )\n\n tmp_file = tmp_fname(to_info[\"path\"])\n\n self.hadoop_fs(\n \"copyFromLocal {} {}\".format(from_info[\"path\"], tmp_file),\n user=to_info[\"user\"],\n )\n\n self.hadoop_fs(\n \"mv {} {}\".format(tmp_file, to_info[\"path\"]),\n user=to_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/http.py_RemoteHTTP._download_to_RemoteHTTP._download_to.move_partial_file_target": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP._download_to_RemoteHTTP._download_to.move_partial_file_target", "embedding": null, "metadata": {"file_path": "dvc/remote/http.py", "file_name": "http.py", "file_type": "text/x-python", "category": "implementation", "start_line": 137, "end_line": 151, "span_ids": ["RemoteHTTP._download_to"], "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 RemoteHTTP(RemoteBase):\n\n def _download_to(self, url, target_file, callback=None, resume=False):\n request = self._request(\"GET\", url, stream=True)\n partial_file = target_file + \".part\"\n\n mode, transferred_bytes = self._determine_mode_get_transferred_bytes(\n partial_file, resume\n )\n\n self._validate_existing_file_size(transferred_bytes, partial_file)\n\n self._write_request_content(\n mode, partial_file, request, transferred_bytes, callback\n )\n\n move(partial_file, target_file)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.download_RemoteLOCAL.download.for_to_info_from_info_n.try_.except_Exception_.continue": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.download_RemoteLOCAL.download.for_to_info_from_info_n.try_.except_Exception_.continue", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 501, "end_line": 545, "span_ids": ["RemoteLOCAL.download"], "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 RemoteLOCAL(RemoteBase):\n\n def download(\n self,\n from_infos,\n to_infos,\n no_progress_bar=False,\n names=None,\n resume=False,\n ):\n names = self._verify_path_args(from_infos, to_infos, names)\n\n for to_info, from_info, name in zip(to_infos, from_infos, names):\n if from_info[\"scheme\"] != \"local\":\n raise NotImplementedError\n\n if to_info[\"scheme\"] != \"local\":\n raise NotImplementedError\n\n logger.debug(\n \"Downloading '{}' to '{}'\".format(\n from_info[\"path\"], to_info[\"path\"]\n )\n )\n\n if not name:\n name = os.path.basename(to_info[\"path\"])\n\n makedirs(os.path.dirname(to_info[\"path\"]), exist_ok=True)\n tmp_file = tmp_fname(to_info[\"path\"])\n try:\n copyfile(\n from_info[\"path\"],\n tmp_file,\n no_progress_bar=no_progress_bar,\n name=name,\n )\n\n move(tmp_file, to_info[\"path\"])\n except Exception:\n logger.error(\n \"failed to download '{}' to '{}'\".format(\n from_info[\"path\"], to_info[\"path\"]\n )\n )\n\n continue", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_from___future___import_un_from_tests_utils_logger_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_from___future___import_un_from_tests_utils_logger_i", "embedding": null, "metadata": {"file_path": "tests/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 24, "span_ids": ["imports"], "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": "from __future__ import unicode_literals\n\nimport os\n\nimport dvc\nimport time\nimport shutil\nimport filecmp\nimport posixpath\n\nfrom dvc.logger import logger\nfrom dvc.system import System\nfrom mock import patch\n\nfrom dvc.main import main\nfrom dvc.utils import file_md5, load_stage_file\nfrom dvc.stage import Stage\nfrom dvc.exceptions import DvcException, RecursiveAddingWhileUsingFilename\nfrom dvc.output.base import OutputAlreadyTrackedError\nfrom dvc.repo import Repo as DvcRepo\n\nfrom tests.basic_env import TestDvc\nfrom tests.utils import spy, reset_logger_error_output, get_gitignore_content\nfrom tests.utils.logger import MockLoggerHandlers, ConsoleFontColorsRemover", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestAdd_TestAdd.test_unicode.self_assertTrue_os_path_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestAdd_TestAdd.test_unicode.self_assertTrue_os_path_i", "embedding": null, "metadata": {"file_path": "tests/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 28, "end_line": 52, "span_ids": ["TestAdd.test_unicode", "TestAdd", "TestAdd.test"], "tokens": 176}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestAdd(TestDvc):\n def test(self):\n md5 = file_md5(self.FOO)[0]\n\n stages = self.dvc.add(self.FOO)\n self.assertEqual(len(stages), 1)\n stage = stages[0]\n self.assertTrue(stage is not None)\n\n self.assertIsInstance(stage, Stage)\n self.assertTrue(os.path.isfile(stage.path))\n self.assertEqual(len(stage.outs), 1)\n self.assertEqual(len(stage.deps), 0)\n self.assertEqual(stage.cmd, None)\n self.assertEqual(stage.outs[0].info[\"md5\"], md5)\n\n def test_unicode(self):\n fname = \"\\xe1\"\n\n with open(fname, \"w\") as fobj:\n fobj.write(\"something\")\n\n stage = self.dvc.add(fname)[0]\n\n self.assertTrue(os.path.isfile(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/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/test_add.py_TestShouldAddDataFromExternalSymlink_TestShouldPlaceStageInDataDirIfRepositoryBelowSymlink.test.with_patch_object_.self_assertTrue_os_path_e", "embedding": null, "metadata": {"file_path": "tests/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 369, "end_line": 407, "span_ids": ["TestShouldAddDataFromInternalSymlink.test", "TestShouldAddDataFromInternalSymlink._get_data_dir", "TestShouldAddDataFromExternalSymlink._get_data_dir", "TestShouldPlaceStageInDataDirIfRepositoryBelowSymlink.test", "TestShouldAddDataFromInternalSymlink", "TestShouldAddDataFromExternalSymlink", "TestShouldAddDataFromExternalSymlink.test", "TestShouldPlaceStageInDataDirIfRepositoryBelowSymlink"], "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 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) + Stage.STAGE_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 + Stage.STAGE_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/test_add.py_TestShouldThrowProperExceptionOnCorruptedStageFile_TestShouldThrowProperExceptionOnCorruptedStageFile.test.with_MockLoggerHandlers_l.self_assertIn_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestShouldThrowProperExceptionOnCorruptedStageFile_TestShouldThrowProperExceptionOnCorruptedStageFile.test.with_MockLoggerHandlers_l.self_assertIn_", "embedding": null, "metadata": {"file_path": "tests/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 409, "end_line": 430, "span_ids": ["TestShouldThrowProperExceptionOnCorruptedStageFile", "TestShouldThrowProperExceptionOnCorruptedStageFile.test"], "tokens": 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 TestShouldThrowProperExceptionOnCorruptedStageFile(TestDvc):\n def test(self):\n with MockLoggerHandlers(logger), ConsoleFontColorsRemover():\n reset_logger_error_output()\n\n ret = main([\"add\", self.FOO])\n self.assertEqual(0, ret)\n\n foo_stage = os.path.relpath(self.FOO + Stage.STAGE_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 ret = main([\"add\", self.BAR])\n self.assertEqual(1, ret)\n\n self.assertIn(\n \"unable to read stage file: {} \"\n \"YAML file structure is corrupted\".format(foo_stage),\n logger.handlers[1].stream.getvalue(),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestWarnOnOutdatedStage_TestWarnOnOutdatedStage.test.with_ConsoleFontColorsRem.self__test_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestWarnOnOutdatedStage_TestWarnOnOutdatedStage.test.with_ConsoleFontColorsRem.self__test_", "embedding": null, "metadata": {"file_path": "tests/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 622, "end_line": 653, "span_ids": ["TestWarnOnOutdatedStage.test", "TestWarnOnOutdatedStage._test", "TestWarnOnOutdatedStage.main", "TestWarnOnOutdatedStage"], "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 TestWarnOnOutdatedStage(TestDvc):\n def main(self, args):\n ret = main(args)\n self.assertEqual(ret, 0)\n\n def _test(self):\n url = get_local_url()\n self.main([\"remote\", \"add\", \"-d\", TEST_REMOTE, url])\n\n stage = self.dvc.run(outs=[\"bar\"], cmd=\"echo bar > bar\")\n self.main([\"push\"])\n\n stage_file_path = stage.relpath\n content = load_stage_file(stage_file_path)\n del content[\"outs\"][0][\"md5\"]\n with open(stage_file_path, \"w\") as stage_file:\n yaml.dump(content, stage_file)\n\n with MockLoggerHandlers(logger):\n reset_logger_standard_output()\n self.main([\"status\", \"-c\"])\n self.assertIn(\n \"Warning: Output 'bar'(Stage: 'bar.dvc') is \"\n \"missing version info. Cache for it will not be \"\n \"collected. Use dvc repro to get your pipeline up to \"\n \"date.\",\n logger.handlers[0].stream.getvalue(),\n )\n\n def test(self):\n with ConsoleFontColorsRemover():\n self._test()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproAllPipelines_TestReproNoCommit.test.self_assertEqual_len_os_l": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestReproAllPipelines_TestReproNoCommit.test.self_assertEqual_len_os_l", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1284, "end_line": 1321, "span_ids": ["TestReproAllPipelines", "TestReproAllPipelines.test", "TestReproNoCommit.test", "TestReproNoCommit"], "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 TestReproAllPipelines(TestDvc):\n def test(self):\n self.dvc.run(\n fname=\"start.dvc\", outs=[\"start.txt\"], cmd=\"echo start > start.txt\"\n )\n\n self.dvc.run(\n fname=\"middle.dvc\",\n deps=[\"start.txt\"],\n outs=[\"middle.txt\"],\n cmd=\"echo middle > middle.txt\",\n )\n\n self.dvc.run(\n fname=\"final.dvc\",\n deps=[\"middle.txt\"],\n outs=[\"final.txt\"],\n cmd=\"echo final > final.txt\",\n )\n\n self.dvc.run(\n fname=\"disconnected.dvc\",\n outs=[\"disconnected.txt\"],\n cmd=\"echo other > disconnected.txt\",\n )\n\n with patch.object(Stage, \"reproduce\") as mock_reproduce:\n ret = main([\"repro\", \"--all-pipelines\"])\n self.assertEqual(ret, 0)\n self.assertEqual(mock_reproduce.call_count, 4)\n\n\nclass TestReproNoCommit(TestRepro):\n def test(self):\n shutil.rmtree(self.dvc.cache.local.cache_dir)\n ret = main([\"repro\", self.file1_stage, \"--no-commit\"])\n self.assertEqual(ret, 0)\n self.assertEqual(len(os.listdir(self.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/test_repro.py_TestReproAlreadyCached_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/test_repro.py_TestReproAlreadyCached_TestReproAlreadyCached.test_force_with_dependencies.self_assertNotEqual_run_o", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1324, "end_line": 1350, "span_ids": ["TestReproAlreadyCached.test_force_with_dependencies", "TestReproAlreadyCached", "TestReproAlreadyCached.test"], "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": "class TestReproAlreadyCached(TestRepro):\n def test(self):\n run_out = self.dvc.run(\n fname=\"datetime.dvc\",\n deps=[],\n outs=[\"datetime.txt\"],\n cmd='python -c \"import time; print(time.time())\" > datetime.txt',\n ).outs[0]\n\n repro_out = self.dvc.reproduce(target=\"datetime.dvc\")[0].outs[0]\n\n self.assertNotEqual(run_out.checksum, repro_out.checksum)\n\n def test_force_with_dependencies(self):\n run_out = self.dvc.run(\n fname=\"datetime.dvc\",\n deps=[self.FOO],\n outs=[\"datetime.txt\"],\n cmd='python -c \"import time; print(time.time())\" > datetime.txt',\n ).outs[0]\n\n ret = main([\"repro\", \"--force\", \"datetime.dvc\"])\n self.assertEqual(ret, 0)\n\n repro_out = Stage.load(self.dvc, \"datetime.dvc\").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/dvc/analytics.py_Analytics.collect_cmd_Analytics._is_enabled_config.return.core_get_Config_SECTION_C": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/analytics.py_Analytics.collect_cmd_Analytics._is_enabled_config.return.core_get_Config_SECTION_C", "embedding": null, "metadata": {"file_path": "dvc/analytics.py", "file_name": "analytics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 179, "end_line": 209, "span_ids": ["Analytics.collect_cmd", "Analytics._is_enabled_config", "Analytics.dump"], "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 Analytics(object):\n\n def collect_cmd(self, args, ret):\n \"\"\"Collect analytics info from a CLI command.\"\"\"\n from dvc.command.daemon import CmdDaemonAnalytics\n\n assert isinstance(ret, int) or ret is None\n\n if ret is not None:\n self.info[self.PARAM_CMD_RETURN_CODE] = ret\n\n if args is not None and hasattr(args, \"func\"):\n assert args.func != CmdDaemonAnalytics\n self.info[self.PARAM_CMD_CLASS] = args.func.__name__\n\n def dump(self):\n \"\"\"Save analytics report to a temporary file.\n\n Returns:\n str: path to the temporary file that contains the analytics report.\n \"\"\"\n import tempfile\n\n with tempfile.NamedTemporaryFile(delete=False, mode=\"w\") as fobj:\n json.dump(self.info, fobj)\n return fobj.name\n\n @staticmethod\n def _is_enabled_config(config):\n from dvc.config import Config\n\n core = config.config.get(Config.SECTION_CORE, {})\n return core.get(Config.SECTION_CORE_ANALYTICS, 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/base.py_from___future___import_un_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_from___future___import_un_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": 33, "span_ids": ["imports", "fix_subparsers", "append_doc_link"], "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": "from __future__ import unicode_literals\n\nimport colorama\n\nimport dvc.logger as logger\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 from dvc.utils.compat import is_py3\n\n if is_py3: # pragma: no cover\n subparsers.required = True\n subparsers.dest = \"cmd\"\n\n\ndef append_doc_link(help_message, path):\n if not path:\n return help_message\n doc_base = \"https://man.dvc.org/\"\n return \"{message}\\ndocumentation: {blue}{base}{path}{nc}\".format(\n message=help_message,\n base=doc_base,\n path=path,\n blue=colorama.Fore.CYAN,\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/command/data_sync.py_add_parser_add_parser.None_15": {"__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.None_15", "embedding": null, "metadata": {"file_path": "dvc/command/data_sync.py", "file_name": "data_sync.py", "file_type": "text/x-python", "category": "implementation", "start_line": 119, "end_line": 241, "span_ids": ["add_parser"], "tokens": 747}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 = \"Pull data files from a DVC 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 repository to pull from.\"\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 \"-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 \"-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 \"-R\",\n \"--recursive\",\n action=\"store_true\",\n default=False,\n help=\"Pull cache for subdirectories of the specified directory.\",\n )\n pull_parser.set_defaults(func=CmdDataPull)\n\n # Push\n PUSH_HELP = \"Push data files to a DVC 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 repository to push to.\"\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 \"-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 from subdirectories of specified directory.\",\n )\n push_parser.set_defaults(func=CmdDataPush)\n\n # Fetch\n FETCH_HELP = \"Fetch data files from a DVC remote storage.\"\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\", \"--remote\", help=\"Remote repository to fetch from.\"\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 # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_add_parser.None_16_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_add_parser.None_16_", "embedding": null, "metadata": {"file_path": "dvc/command/data_sync.py", "file_name": "data_sync.py", "file_type": "text/x-python", "category": "implementation", "start_line": 242, "end_line": 315, "span_ids": ["add_parser"], "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 add_parser(subparsers, _parent_parser):\n # ... other code\n fetch_parser.add_argument(\n \"-d\",\n \"--with-deps\",\n action=\"store_true\",\n default=False,\n help=\"Fetch cache for all dependencies of the \" \"specified target.\",\n )\n fetch_parser.add_argument(\n \"-R\",\n \"--recursive\",\n action=\"store_true\",\n default=False,\n help=\"Fetch cache for subdirectories of specified directory.\",\n )\n fetch_parser.set_defaults(func=CmdDataFetch)\n\n # Status\n STATUS_HELP = (\n \"Show changed stages, compare local cache and a remote storage.\"\n )\n\n status_parser = subparsers.add_parser(\n \"status\",\n parents=[shared_parent_parser()],\n description=append_doc_link(STATUS_HELP, \"status\"),\n help=STATUS_HELP,\n conflict_handler=\"resolve\",\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n status_parser.add_argument(\n \"-q\",\n \"--quiet\",\n action=\"store_true\",\n default=False,\n help=(\n \"Suppresses all output.\"\n \" Exit with 0 if pipeline is 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\", \"--remote\", help=\"Remote repository to compare local cache to.\"\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 \"-d\",\n \"--with-deps\",\n action=\"store_true\",\n default=False,\n help=\"Show status for all dependencies of the specified target.\",\n )\n status_parser.set_defaults(func=CmdDataStatus)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/init.py_from___future___import_un_CmdInit.run_cmd.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/init.py_from___future___import_un_CmdInit.run_cmd.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_cmd", "CmdInit.__init__", "CmdInit"], "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": "from __future__ import unicode_literals\n\nimport argparse\n\nimport dvc.logger as logger\nfrom dvc.command.base import append_doc_link\n\n\nclass CmdInit(object):\n def __init__(self, args):\n self.args = args\n\n def run_cmd(self):\n from dvc.repo import Repo\n from dvc.exceptions import InitError\n\n try:\n self.repo = Repo.init(\n \".\", no_scm=self.args.no_scm, force=self.args.force\n )\n self.config = self.repo.config\n except InitError:\n logger.error(\"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/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": 28, "end_line": 61, "span_ids": ["add_parser"], "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 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.set_defaults(func=CmdInit)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/lock.py_from___future___import_un_CmdUnlock.run.return.self__run_True_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/lock.py_from___future___import_un_CmdUnlock.run.return.self__run_True_", "embedding": null, "metadata": {"file_path": "dvc/command/lock.py", "file_name": "lock.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 33, "span_ids": ["imports", "CmdLockBase._run", "CmdUnlock.run", "CmdUnlock", "CmdLockBase", "CmdLock", "CmdLock.run"], "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": "from __future__ import unicode_literals\n\nimport argparse\n\nimport dvc.logger as logger\nfrom dvc.exceptions import DvcException\nfrom dvc.command.base import CmdBase, append_doc_link\n\n\nclass CmdLockBase(CmdBase):\n def _run(self, unlock):\n for target in self.args.targets:\n try:\n self.repo.lock_stage(target, unlock=unlock)\n except DvcException:\n logger.error(\n \"failed to {}lock '{}'\".format(\n \"un\" if unlock else \"\", target\n )\n )\n\n return 1\n return 0\n\n\nclass CmdLock(CmdLockBase):\n def run(self):\n return self._run(False)\n\n\nclass CmdUnlock(CmdLockBase):\n def run(self):\n return self._run(True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_from___future___import_un_show_metrics.for_branch_val_in_metric.for_fname_metric_in_val_.if_len_lines_1_.else_.logger_info_t_fo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_from___future___import_un_show_metrics.for_branch_val_in_metric.for_fname_metric_in_val_.if_len_lines_1_.else_.logger_info_t_fo", "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": 30, "span_ids": ["imports", "show_metrics"], "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": "from __future__ import unicode_literals\n\nimport argparse\n\nimport dvc.logger as logger\nfrom dvc.exceptions import DvcException\nfrom dvc.command.base import CmdBase, fix_subparsers, append_doc_link\n\n\ndef show_metrics(metrics, all_branches=False, all_tags=False):\n \"\"\"\n Args:\n metrics (list): Where each element is either a `list`\n if an xpath was specified, otherwise a `str`\n \"\"\"\n for branch, val in metrics.items():\n if all_branches or all_tags:\n logger.info(\"{branch}:\".format(branch=branch))\n\n for fname, metric in val.items():\n lines = metric if type(metric) is list else metric.splitlines()\n\n if len(lines) > 1:\n logger.info(\"\\t{fname}:\".format(fname=fname))\n\n for line in lines:\n logger.info(\"\\t\\t{content}\".format(content=line))\n\n else:\n logger.info(\"\\t{}: {}\".format(fname, metric))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": 33, "end_line": 52, "span_ids": ["CmdMetricsShow", "CmdMetricsShow.run"], "tokens": 120}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CmdMetricsShow(CmdBase):\n def run(self):\n typ = self.args.type\n xpath = self.args.xpath\n try:\n metrics = self.repo.metrics.show(\n self.args.path,\n typ=typ,\n xpath=xpath,\n all_branches=self.args.all_branches,\n all_tags=self.args.all_tags,\n recursive=self.args.recursive,\n )\n\n show_metrics(metrics, self.args.all_branches, self.args.all_tags)\n except DvcException:\n logger.error(\"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/pipeline.py_CmdPipelineShow.__build_graph_CmdPipelineShow.__build_graph.return.nodes_edges_networkx_is": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pipeline.py_CmdPipelineShow.__build_graph_CmdPipelineShow.__build_graph.return.nodes_edges_networkx_is", "embedding": null, "metadata": {"file_path": "dvc/command/pipeline.py", "file_name": "pipeline.py", "file_type": "text/x-python", "category": "implementation", "start_line": 33, "end_line": 76, "span_ids": ["CmdPipelineShow.__build_graph"], "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 CmdPipelineShow(CmdBase):\n\n def __build_graph(self, target, commands, outs):\n import networkx\n from dvc.stage import Stage\n\n stage = Stage.load(self.repo, target)\n node = os.path.relpath(stage.path, self.repo.root_dir)\n\n pipelines = list(\n filter(lambda g: node in g.nodes(), self.repo.pipelines())\n )\n\n assert len(pipelines) == 1\n G = pipelines[0]\n stages = networkx.get_node_attributes(G, \"stage\")\n\n nodes = []\n for n in G.nodes():\n stage = stages[n]\n if commands:\n if stage.cmd is None:\n continue\n nodes.append(stage.cmd)\n elif outs:\n for out in stage.outs:\n nodes.append(str(out))\n else:\n nodes.append(stage.relpath)\n\n edges = []\n for e in G.edges():\n from_stage = stages[e[0]]\n to_stage = stages[e[1]]\n if commands:\n if to_stage.cmd is None:\n continue\n edges.append((from_stage.cmd, to_stage.cmd))\n elif outs:\n for from_out in from_stage.outs:\n for to_out in to_stage.outs:\n edges.append((str(from_out), str(to_out)))\n else:\n edges.append((from_stage.relpath, to_stage.relpath))\n\n return nodes, edges, networkx.is_tree(G)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pipeline.py_CmdPipelineShow._show_ascii_CmdPipelineShow._show_dependencies_tree.tree_show_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pipeline.py_CmdPipelineShow._show_ascii_CmdPipelineShow._show_dependencies_tree.tree_show_", "embedding": null, "metadata": {"file_path": "dvc/command/pipeline.py", "file_name": "pipeline.py", "file_type": "text/x-python", "category": "implementation", "start_line": 78, "end_line": 110, "span_ids": ["CmdPipelineShow._show_dependencies_tree", "CmdPipelineShow._show_ascii"], "tokens": 247}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CmdPipelineShow(CmdBase):\n\n def _show_ascii(self, target, commands, outs):\n from dvc.dagascii import draw\n\n nodes, edges, _ = self.__build_graph(target, commands, outs)\n\n if not nodes:\n return\n\n draw(nodes, edges)\n\n def _show_dependencies_tree(self, target, commands, outs):\n from treelib import Tree\n\n nodes, edges, is_tree = self.__build_graph(target, commands, outs)\n if not nodes:\n return\n if not is_tree:\n raise DvcException(\n \"DAG is not a tree, can not print it in tree-structure way, \"\n \"please use --ascii instead\"\n )\n\n tree = Tree()\n tree.create_node(target, target) # Root node\n observe_list = [target]\n while len(observe_list) > 0:\n current_root = observe_list[0]\n for edge in edges:\n if edge[0] == current_root:\n tree.create_node(edge[1], edge[1], parent=current_root)\n observe_list.append(edge[1])\n observe_list.pop(0)\n tree.show()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pipeline.py_CmdPipelineShow.__write_dot_CmdPipelineList.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pipeline.py_CmdPipelineShow.__write_dot_CmdPipelineList.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/pipeline.py", "file_name": "pipeline.py", "file_type": "text/x-python", "category": "implementation", "start_line": 112, "end_line": 166, "span_ids": ["CmdPipelineShow.__write_dot", "CmdPipelineList", "CmdPipelineShow.run", "CmdPipelineList.run"], "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 CmdPipelineShow(CmdBase):\n\n def __write_dot(self, target, commands, outs, filename):\n import networkx\n from networkx.drawing.nx_pydot import write_dot\n\n _, edges, _ = self.__build_graph(target, commands, outs)\n edges = [edge[::-1] for edge in edges]\n\n simple_g = networkx.DiGraph()\n simple_g.add_edges_from(edges)\n write_dot(simple_g, filename)\n\n def run(self, unlock=False):\n if not self.args.targets:\n self.args.targets = self.default_targets\n\n for target in self.args.targets:\n try:\n if self.args.ascii:\n self._show_ascii(\n target, self.args.commands, self.args.outs\n )\n elif self.args.dot:\n self.__write_dot(\n target,\n self.args.commands,\n self.args.outs,\n self.args.dot,\n )\n elif self.args.tree:\n self._show_dependencies_tree(\n target, self.args.commands, self.args.outs\n )\n else:\n self._show(target, self.args.commands, self.args.outs)\n except DvcException:\n msg = \"failed to show pipeline for '{}'\".format(target)\n logger.error(msg)\n return 1\n return 0\n\n\nclass CmdPipelineList(CmdBase):\n def run(self):\n import networkx\n\n pipelines = self.repo.pipelines()\n for p in pipelines:\n stages = networkx.get_node_attributes(p, \"stage\")\n for stage in stages:\n logger.info(stage)\n if len(stages) != 0:\n logger.info(\"=\" * 80)\n logger.info(\"{} pipeline(s) total\".format(len(pipelines)))\n\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pkg.py_from___future___import_un_CmdPkg.run.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pkg.py_from___future___import_un_CmdPkg.run.pass", "embedding": null, "metadata": {"file_path": "dvc/command/pkg.py", "file_name": "pkg.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 26, "span_ids": ["imports", "CmdPkg", "CmdPkg.run"], "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": "from __future__ import unicode_literals\n\nimport argparse\n\nimport dvc.logger as logger\nfrom dvc.exceptions import DvcException\nfrom dvc.command.base import CmdBase, fix_subparsers, append_doc_link\nfrom dvc.repo.pkg import PackageParams\n\n\nclass CmdPkg(CmdBase):\n def run(self, unlock=False):\n try:\n pkg_params = PackageParams(\n self.args.address,\n self.args.target_dir,\n self.args.select,\n self.args.file,\n )\n return self.repo.install_pkg(pkg_params)\n except DvcException:\n logger.error(\n \"failed to install package '{}'\".format(self.args.address)\n )\n return 1\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/command/pkg.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pkg.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/pkg.py", "file_name": "pkg.py", "file_type": "text/x-python", "category": "implementation", "start_line": 29, "end_line": 90, "span_ids": ["add_parser"], "tokens": 452}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 PKG_HELP = \"Manage DVC packages.\"\n pkg_parser = subparsers.add_parser(\n \"pkg\",\n parents=[parent_parser],\n description=append_doc_link(PKG_HELP, \"pkg\"),\n help=PKG_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n add_help=False,\n )\n\n pkg_subparsers = pkg_parser.add_subparsers(\n dest=\"cmd\", help=\"Use dvc pkg CMD --help for command-specific help.\"\n )\n\n fix_subparsers(pkg_subparsers)\n\n PKG_INSTALL_HELP = \"Install package.\"\n pkg_install_parser = pkg_subparsers.add_parser(\n \"install\",\n parents=[parent_config_parser, parent_parser],\n description=append_doc_link(PKG_INSTALL_HELP, \"pkg-install\"),\n help=PKG_INSTALL_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n pkg_install_parser.add_argument(\n \"address\",\n nargs=\"?\",\n default=\"\",\n help=\"Package address: git:// or https://github.com/...\",\n )\n pkg_install_parser.add_argument(\n \"target_dir\",\n metavar=\"target\",\n nargs=\"?\",\n default=\".\",\n help=\"Target directory to deploy package outputs. \"\n \"Default value is the current dir.\",\n )\n pkg_install_parser.add_argument(\n \"-s\",\n \"--select\",\n metavar=\"OUT\",\n action=\"append\",\n default=[],\n help=\"Select and persist only specified outputs from a package. \"\n \"The parameter can be used multiple times. \"\n \"All outputs will be selected by default.\",\n )\n pkg_install_parser.add_argument(\n \"-f\",\n \"--file\",\n help=\"Specify name of the stage file. It should be \"\n \"either 'Dvcfile' or have a '.dvc' suffix (e.g. \"\n \"'prepare.dvc', 'clean.dvc', etc). \"\n \"By default the file has 'mod_' prefix and imported package name \"\n \"followed by .dvc\",\n )\n pkg_install_parser.set_defaults(func=CmdPkg)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/tag.py_yaml_CmdTagList.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/tag.py_yaml_CmdTagList.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/tag.py", "file_name": "tag.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 54, "span_ids": ["CmdTagList", "CmdTagAdd", "imports", "CmdTagAdd.run", "CmdTagList.run", "CmdTagRemove.run", "CmdTagRemove"], "tokens": 290}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import yaml\n\nimport dvc.logger as logger\nfrom dvc.exceptions import DvcException\nfrom dvc.command.base import CmdBase, fix_subparsers, append_doc_link\n\n\nclass CmdTagAdd(CmdBase):\n def run(self):\n for target in self.args.targets:\n try:\n self.repo.tag.add(\n self.args.tag,\n target=target,\n with_deps=self.args.with_deps,\n recursive=self.args.recursive,\n )\n except DvcException:\n logger.error(\"failed to add tag\")\n return 1\n return 0\n\n\nclass CmdTagRemove(CmdBase):\n def run(self):\n for target in self.args.targets:\n try:\n self.repo.tag.remove(\n self.args.tag,\n target=target,\n with_deps=self.args.with_deps,\n recursive=self.args.recursive,\n )\n except DvcException:\n logger.error(\"failed to remove tag\")\n return 1\n return 0\n\n\nclass CmdTagList(CmdBase):\n def run(self):\n for target in self.args.targets:\n try:\n tags = self.repo.tag.list(\n target,\n with_deps=self.args.with_deps,\n recursive=self.args.recursive,\n )\n if tags:\n logger.info(yaml.dump(tags, default_flow_style=False))\n except DvcException:\n logger.error(\"failed list tags\")\n return 1\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/tag.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/tag.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/tag.py", "file_name": "tag.py", "file_type": "text/x-python", "category": "implementation", "start_line": 57, "end_line": 152, "span_ids": ["add_parser"], "tokens": 665}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n TAG_HELP = \"A set of commands to manage DVC tags.\"\n tag_parser = subparsers.add_parser(\n \"tag\",\n parents=[parent_parser],\n description=append_doc_link(TAG_HELP, \"tag\"),\n add_help=False,\n )\n\n tag_subparsers = tag_parser.add_subparsers(\n dest=\"cmd\",\n help=\"Use DVC tag CMD --help to display command-specific help.\",\n )\n\n fix_subparsers(tag_subparsers)\n\n TAG_ADD_HELP = \"Add DVC tag.\"\n tag_add_parser = tag_subparsers.add_parser(\n \"add\",\n parents=[parent_parser],\n description=append_doc_link(TAG_ADD_HELP, \"tag-add\"),\n help=TAG_ADD_HELP,\n )\n tag_add_parser.add_argument(\"tag\", help=\"Dvc tag.\")\n tag_add_parser.add_argument(\n \"targets\", nargs=\"*\", default=[None], help=\"Dvc files.\"\n )\n tag_add_parser.add_argument(\n \"-d\",\n \"--with-deps\",\n action=\"store_true\",\n default=False,\n help=\"Add tag for all dependencies of the specified DVC file.\",\n )\n tag_add_parser.add_argument(\n \"-R\",\n \"--recursive\",\n action=\"store_true\",\n default=False,\n help=\"Add tag for subdirectories of the specified directory.\",\n )\n tag_add_parser.set_defaults(func=CmdTagAdd)\n\n TAG_REMOVE_HELP = \"Remove DVC tag.\"\n tag_remove_parser = tag_subparsers.add_parser(\n \"remove\",\n parents=[parent_parser],\n description=append_doc_link(TAG_REMOVE_HELP, \"tag-remove\"),\n help=TAG_REMOVE_HELP,\n )\n tag_remove_parser.add_argument(\"tag\", help=\"Dvc tag.\")\n tag_remove_parser.add_argument(\n \"targets\", nargs=\"*\", default=[None], help=\"Dvc files.\"\n )\n tag_remove_parser.add_argument(\n \"-d\",\n \"--with-deps\",\n action=\"store_true\",\n default=False,\n help=\"Remove tag for all dependencies of the specified DVC file.\",\n )\n tag_remove_parser.add_argument(\n \"-R\",\n \"--recursive\",\n action=\"store_true\",\n default=False,\n help=\"Remove tag for subdirectories of the specified directory.\",\n )\n tag_remove_parser.set_defaults(func=CmdTagRemove)\n\n TAG_LIST_HELP = \"List DVC tags.\"\n tag_list_parser = tag_subparsers.add_parser(\n \"list\",\n parents=[parent_parser],\n description=append_doc_link(TAG_LIST_HELP, \"tag-list\"),\n help=TAG_LIST_HELP,\n )\n tag_list_parser.add_argument(\n \"targets\", nargs=\"*\", default=[None], help=\"Dvc files.\"\n )\n tag_list_parser.add_argument(\n \"-d\",\n \"--with-deps\",\n action=\"store_true\",\n default=False,\n help=\"List tags for all dependencies of the specified DVC file.\",\n )\n tag_list_parser.add_argument(\n \"-R\",\n \"--recursive\",\n action=\"store_true\",\n default=False,\n help=\"List tags for subdirectories of the specified directory.\",\n )\n tag_list_parser.set_defaults(func=CmdTagList)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_NotDvcRepoError_RecursiveAddingWhileUsingFilename.__init__.super_RecursiveAddingWhil": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_NotDvcRepoError_RecursiveAddingWhileUsingFilename.__init__.super_RecursiveAddingWhil", "embedding": null, "metadata": {"file_path": "dvc/exceptions.py", "file_name": "exceptions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 144, "end_line": 229, "span_ids": ["InitError.__init__", "BadMetricError", "ConfirmRemoveError", "RecursiveAddingWhileUsingFilename.__init__", "NotDvcRepoError", "RecursiveAddingWhileUsingFilename", "CyclicGraphError", "ConfirmRemoveError.__init__", "StageFileCorruptedError.__init__", "InitError", "StageFileCorruptedError", "DvcParserError.__init__", "ReproductionError.__init__", "NotDvcRepoError.__init__", "BadMetricError.__init__", "NoMetricsError.__init__", "DvcParserError", "CyclicGraphError.__init__", "NoMetricsError", "ReproductionError"], "tokens": 594}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 Args:\n root (str): path to the directory.\n \"\"\"\n\n def __init__(self, root):\n msg = (\n \"you are not inside of a dvc repository \"\n \"(checked up to mount point '{}')\"\n )\n super(NotDvcRepoError, self).__init__(msg.format(root))\n\n\nclass DvcParserError(DvcException):\n \"\"\"Base class for CLI parser errors.\"\"\"\n\n def __init__(self):\n super(DvcParserError, self).__init__(\"parser error\")\n\n\nclass CyclicGraphError(DvcException):\n def __init__(self, stages):\n assert isinstance(stages, list)\n stages = \"\\n\".join(\"\\t- {}\".format(stage) for stage in stages)\n msg = (\n \"you've introduced a cycle in your pipeline that involves\"\n \" the following stages:\"\n \"\\n\"\n \"{stages}\".format(stages=stages)\n )\n super(CyclicGraphError, self).__init__(msg)\n\n\nclass ConfirmRemoveError(DvcException):\n def __init__(self, path):\n super(ConfirmRemoveError, self).__init__(\n \"unable to remove '{}' without a confirmation from the user. Use \"\n \"'-f' to force.\".format(path)\n )\n\n\nclass InitError(DvcException):\n def __init__(self, msg):\n super(InitError, self).__init__(msg)\n\n\nclass ReproductionError(DvcException):\n def __init__(self, dvc_file_name, ex):\n self.path = dvc_file_name\n msg = \"failed to reproduce '{}'\".format(dvc_file_name)\n super(ReproductionError, self).__init__(msg, cause=ex)\n\n\nclass BadMetricError(DvcException):\n def __init__(self, path):\n super(BadMetricError, self).__init__(\n \"'{}' does not exist, not a metric or is malformed\".format(\n os.path.relpath(path)\n )\n )\n\n\nclass NoMetricsError(DvcException):\n def __init__(self):\n super(NoMetricsError, self).__init__(\n \"no metric files in this repository. \"\n \"Use 'dvc metrics add' to add a metric file to track.\"\n )\n\n\nclass StageFileCorruptedError(DvcException):\n def __init__(self, path):\n path = os.path.relpath(path)\n super(StageFileCorruptedError, self).__init__(\n \"unable to read stage file: {} \"\n \"YAML file structure is corrupted\".format(path)\n )\n\n\nclass RecursiveAddingWhileUsingFilename(DvcException):\n def __init__(self):\n super(RecursiveAddingWhileUsingFilename, self).__init__(\n \"using fname with recursive is not allowed.\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_OverlappingOutputPathsError_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_OverlappingOutputPathsError_", "embedding": null, "metadata": {"file_path": "dvc/exceptions.py", "file_name": "exceptions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 232, "end_line": 258, "span_ids": ["TargetNotDirectoryError", "OverlappingOutputPathsError", "CheckoutErrorSuggestGit", "CheckoutErrorSuggestGit.__init__", "OverlappingOutputPathsError.__init__", "TargetNotDirectoryError.__init__"], "tokens": 216}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class OverlappingOutputPathsError(DvcException):\n def __init__(self, out_1, out_2):\n super(OverlappingOutputPathsError, self).__init__(\n \"Paths for outs:\\n'{}'('{}')\\n'{}'('{}')\\noverlap. To avoid \"\n \"unpredictable behaviour, rerun command with non overlapping outs \"\n \"paths.\".format(\n str(out_1),\n out_1.stage.relpath,\n str(out_2),\n out_2.stage.relpath,\n )\n )\n\n\nclass TargetNotDirectoryError(DvcException):\n def __init__(self, path):\n super(TargetNotDirectoryError, self).__init__(\n \"Target: {} is not a directory\".format(path)\n )\n\n\nclass CheckoutErrorSuggestGit(DvcException):\n def __init__(self, target, cause):\n super(CheckoutErrorSuggestGit, self).__init__(\n \"Did you mean 'git checkout {}'?\".format(target), cause=cause\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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___future___import_un_None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/__init__.py_from___future___import_un_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": 57, "span_ids": ["imports"], "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": "from __future__ import unicode_literals\n\nimport schema\n\nfrom dvc.config import Config\nfrom dvc.utils.compat import urlparse, str\n\nfrom dvc.output.base import OutputBase\nfrom dvc.output.s3 import OutputS3\nfrom dvc.output.gs import OutputGS\nfrom dvc.output.local import OutputLOCAL\nfrom dvc.output.hdfs import OutputHDFS\nfrom dvc.output.ssh import OutputSSH\n\nfrom dvc.remote import Remote\nfrom dvc.remote.s3 import RemoteS3\nfrom dvc.remote.hdfs import RemoteHDFS\nfrom dvc.remote.local import RemoteLOCAL\n\nOUTS = [\n OutputHDFS,\n OutputS3,\n OutputGS,\n OutputSSH,\n # NOTE: OutputLOCAL is the default choice\n]\n\nOUTS_MAP = {\n \"hdfs\": OutputHDFS,\n \"s3\": OutputS3,\n \"gs\": OutputGS,\n \"ssh\": OutputSSH,\n \"local\": OutputLOCAL,\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.\nCHECKSUM_SCHEMA = {\n schema.Optional(RemoteLOCAL.PARAM_CHECKSUM): schema.Or(str, None),\n schema.Optional(RemoteS3.PARAM_CHECKSUM): schema.Or(str, None),\n schema.Optional(RemoteHDFS.PARAM_CHECKSUM): schema.Or(str, None),\n}\n\nTAGS_SCHEMA = {schema.Optional(str): CHECKSUM_SCHEMA}\n\nSCHEMA = CHECKSUM_SCHEMA.copy()\nSCHEMA[OutputBase.PARAM_PATH] = str\nSCHEMA[schema.Optional(OutputBase.PARAM_CACHE)] = bool\nSCHEMA[schema.Optional(OutputBase.PARAM_METRIC)] = OutputBase.METRIC_SCHEMA\nSCHEMA[schema.Optional(OutputBase.PARAM_TAGS)] = TAGS_SCHEMA\nSCHEMA[schema.Optional(OutputBase.PARAM_PERSIST)] = bool", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/__init__.py__get__get.return.OutputLOCAL_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/__init__.py__get__get.return.OutputLOCAL_", "embedding": null, "metadata": {"file_path": "dvc/output/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 60, "end_line": 98, "span_ids": ["_get"], "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 _get(stage, p, info, cache, metric, persist=False, tags=None):\n parsed = urlparse(p)\n if parsed.scheme == \"remote\":\n name = Config.SECTION_REMOTE_FMT.format(parsed.netloc)\n sect = stage.repo.config.config[name]\n remote = Remote(stage.repo, sect)\n return OUTS_MAP[remote.scheme](\n stage,\n p,\n info,\n cache=cache,\n remote=remote,\n metric=metric,\n persist=persist,\n tags=tags,\n )\n\n for o in OUTS:\n if o.supported(p):\n return o(\n stage,\n p,\n info,\n cache=cache,\n remote=None,\n metric=metric,\n persist=persist,\n tags=tags,\n )\n return OutputLOCAL(\n stage,\n p,\n info,\n cache=cache,\n remote=None,\n metric=metric,\n persist=persist,\n tags=tags,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase_OutputBase.commit.if_self_use_cache_.getattr_self_repo_cache_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase_OutputBase.commit.if_self_use_cache_.getattr_self_repo_cache_", "embedding": null, "metadata": {"file_path": "dvc/output/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 29, "end_line": 183, "span_ids": ["OutputBase.changed_checksum", "OutputBase.commit", "OutputBase.save", "OutputBase.status", "OutputBase.changed", "OutputBase.checksum", "OutputBase.scheme", "OutputBase.path", "OutputBase", "OutputBase.sep", "OutputBase.changed_cache", "OutputBase.__init__", "OutputBase.exists", "OutputBase.is_local", "OutputBase.group", "OutputBase.__str__", "OutputBase.match", "OutputBase.supported", "OutputBase.__repr__", "OutputBase.assign_to_stage_file"], "tokens": 828}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class OutputBase(object):\n IS_DEPENDENCY = False\n\n REMOTE = RemoteBase\n\n PARAM_PATH = \"path\"\n PARAM_CACHE = \"cache\"\n PARAM_METRIC = \"metric\"\n PARAM_METRIC_TYPE = \"type\"\n PARAM_METRIC_XPATH = \"xpath\"\n PARAM_PERSIST = \"persist\"\n\n METRIC_SCHEMA = Or(\n None,\n bool,\n {\n Optional(PARAM_METRIC_TYPE): Or(str, None),\n Optional(PARAM_METRIC_XPATH): Or(str, None),\n },\n )\n\n PARAM_TAGS = \"tags\"\n\n DoesNotExistError = OutputDoesNotExistError\n IsNotFileOrDirError = OutputIsNotFileOrDirError\n\n def __init__(\n self,\n stage,\n path,\n info=None,\n remote=None,\n cache=True,\n metric=False,\n persist=False,\n tags=None,\n ):\n self.stage = stage\n self.repo = stage.repo\n self.url = path\n self.info = info\n self.remote = remote or self.REMOTE(self.repo, {})\n self.use_cache = False if self.IS_DEPENDENCY else cache\n self.metric = False if self.IS_DEPENDENCY else metric\n self.persist = persist\n self.tags = None if self.IS_DEPENDENCY else (tags or {})\n\n if (\n self.use_cache\n and getattr(self.repo.cache, self.REMOTE.scheme) is None\n ):\n raise DvcException(\n \"no cache location setup for '{}' outputs.\".format(\n self.REMOTE.scheme\n )\n )\n\n def __repr__(self):\n return \"{class_name}: '{url}'\".format(\n class_name=type(self).__name__, url=(self.url or \"No url\")\n )\n\n def __str__(self):\n return self.url\n\n @property\n def is_local(self):\n raise DvcException(\n \"is local is not supported for {}\".format(self.scheme)\n )\n\n def assign_to_stage_file(self, target_repo):\n raise DvcException(\n \"change repo is not supported for {}\".format(self.scheme)\n )\n\n @classmethod\n def match(cls, url):\n return re.match(cls.REMOTE.REGEX, url)\n\n def group(self, name):\n match = self.match(self.url)\n if not match:\n return None\n return match.group(name)\n\n @classmethod\n def supported(cls, url):\n return cls.match(url) is not None\n\n @property\n def scheme(self):\n return self.REMOTE.scheme\n\n @property\n def path(self):\n return self.path_info[\"path\"]\n\n @property\n def sep(self):\n return \"/\"\n\n @property\n def checksum(self):\n return self.info.get(self.remote.PARAM_CHECKSUM)\n\n @property\n def exists(self):\n return self.remote.exists(self.path_info)\n\n def changed_checksum(self):\n return (\n self.checksum\n != self.remote.save_info(self.path_info)[\n self.remote.PARAM_CHECKSUM\n ]\n )\n\n def changed_cache(self):\n if not self.use_cache or not self.checksum:\n return True\n\n cache = self.repo.cache.__getattribute__(self.scheme)\n\n return cache.changed_cache(self.checksum)\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 return bool(self.status())\n\n def save(self):\n if not self.exists:\n raise self.DoesNotExistError(self)\n\n self.info = self.remote.save_info(self.path_info)\n\n def commit(self):\n if self.use_cache:\n getattr(self.repo.cache, self.scheme).save(\n self.path_info, self.info\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.dumpd_OutputBase.dumpd.return.ret": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.dumpd_OutputBase.dumpd.return.ret", "embedding": null, "metadata": {"file_path": "dvc/output/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 185, "end_line": 207, "span_ids": ["OutputBase.dumpd"], "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 OutputBase(object):\n\n def dumpd(self):\n ret = self.info.copy()\n ret[self.PARAM_PATH] = self.url\n\n if self.IS_DEPENDENCY:\n return ret\n\n ret[self.PARAM_CACHE] = self.use_cache\n\n if isinstance(self.metric, dict):\n if (\n self.PARAM_METRIC_XPATH in self.metric\n and not self.metric[self.PARAM_METRIC_XPATH]\n ):\n del self.metric[self.PARAM_METRIC_XPATH]\n\n ret[self.PARAM_METRIC] = self.metric\n ret[self.PARAM_PERSIST] = self.persist\n\n if self.tags:\n ret[self.PARAM_TAGS] = self.tags\n\n return ret", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/progress.py_Progress._bar_Progress.__exit__.self__lock_release_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/progress.py_Progress._bar_Progress.__exit__.self__lock_release_", "embedding": null, "metadata": {"file_path": "dvc/progress.py", "file_name": "progress.py", "file_type": "text/x-python", "category": "implementation", "start_line": 82, "end_line": 125, "span_ids": ["Progress.__exit__", "Progress.__enter__", "Progress._bar", "Progress.print"], "tokens": 308}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Progress(object):\n\n def _bar(self, target_name, current, total):\n \"\"\"\n Make a progress bar out of info, which looks like:\n (1/2): [########################################] 100% master.zip\n \"\"\"\n bar_len = 30\n\n if total is None:\n state = 0\n percent = \"?% \"\n else:\n total = int(total)\n state = int((100 * current) / total) if current < total else 100\n percent = str(state) + \"% \"\n\n if self._n_total > 1:\n num = \"({}/{}): \".format(self._n_finished + 1, self._n_total)\n else:\n num = \"\"\n\n n_sh = int((state * bar_len) / 100)\n n_sp = bar_len - n_sh\n pbar = \"[\" + \"#\" * n_sh + \" \" * n_sp + \"] \"\n\n return num + pbar + percent + target_name\n\n @staticmethod\n def print(*args, **kwargs):\n import dvc.logger as logger\n\n if logger.is_quiet():\n return\n\n print(*args, **kwargs)\n\n def __enter__(self):\n self._lock.acquire(True)\n if self._line is not None:\n self.clearln()\n\n def __exit__(self, typ, value, tbck):\n if self._line is not None:\n self.refresh()\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/progress.py_progress_aware_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/progress.py_progress_aware_", "embedding": null, "metadata": {"file_path": "dvc/progress.py", "file_name": "progress.py", "file_type": "text/x-python", "category": "implementation", "start_line": 128, "end_line": 157, "span_ids": ["impl:3", "ProgressCallback.__init__", "ProgressCallback.finish", "ProgressCallback", "progress_aware", "ProgressCallback.update"], "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": "def progress_aware(f):\n \"\"\" Decorator to add a new line if progress bar hasn't finished \"\"\"\n from functools import wraps\n\n @wraps(f)\n def wrapper(*args, **kwargs):\n if not progress.is_finished:\n progress.print()\n progress.clearln()\n\n return f(*args, **kwargs)\n\n return wrapper\n\n\nclass ProgressCallback(object):\n def __init__(self, total):\n self.total = total\n self.current = 0\n\n def update(self, name, progress_to_add=1):\n self.current += progress_to_add\n progress.update_target(name, self.current, self.total)\n\n def finish(self, name):\n progress.finish_target(name)\n\n\nprogress = Progress() # pylint: disable=invalid-name", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.do_checkout_RemoteLOCAL.do_checkout.self_state_update_link_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.do_checkout_RemoteLOCAL.do_checkout.self_state_update_link_pa", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 309, "end_line": 357, "span_ids": ["RemoteLOCAL.do_checkout"], "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": "class RemoteLOCAL(RemoteBase):\n\n def do_checkout(\n self, path_info, checksum, force=False, progress_callback=None\n ):\n path = path_info[\"path\"]\n cache = self.get(checksum)\n\n if not self.is_dir_cache(cache):\n if os.path.exists(path):\n self.safe_remove(path_info, force=force)\n\n self.link(cache, path)\n self.state.update_link(path)\n if progress_callback:\n progress_callback.update(os.path.relpath(path))\n return\n\n # Create dir separately so that dir is created\n # even if there are no files in it\n if not os.path.exists(path):\n os.makedirs(path)\n\n dir_relpath = os.path.relpath(path)\n\n logger.debug(\"Linking directory '{}'.\".format(dir_relpath))\n\n dir_info = self.load_dir_cache(checksum)\n\n for processed, entry in enumerate(dir_info):\n relpath = entry[self.PARAM_RELPATH]\n m = entry[self.PARAM_CHECKSUM]\n p = os.path.join(path, relpath)\n c = self.get(m)\n\n entry_info = {\"scheme\": path_info[\"scheme\"], self.PARAM_PATH: p}\n\n entry_checksum_info = {self.PARAM_CHECKSUM: m}\n\n if self.changed(entry_info, entry_checksum_info):\n if os.path.exists(p):\n self.safe_remove(entry_info, force=force)\n\n self.link(c, p)\n\n if progress_callback:\n progress_callback.update(os.path.relpath(p))\n\n self._discard_working_directory_changes(path, dir_info, force=force)\n\n self.state.update_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/dvc/remote/local.py_RemoteLOCAL.already_cached_RemoteLOCAL._move.move_tmp_outp_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.already_cached_RemoteLOCAL._move.move_tmp_outp_", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 359, "end_line": 387, "span_ids": ["RemoteLOCAL.already_cached", "RemoteLOCAL._discard_working_directory_changes", "RemoteLOCAL._move"], "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 RemoteLOCAL(RemoteBase):\n\n def already_cached(self, path_info):\n assert path_info[\"scheme\"] in [\"\", \"local\"]\n\n current_md5 = self.state.update(path_info[\"path\"])\n\n if not current_md5:\n return False\n\n return not self.changed_cache(current_md5)\n\n def _discard_working_directory_changes(self, path, dir_info, force=False):\n working_dir_files = set(path for path in walk_files(path))\n\n cached_files = set(\n os.path.join(path, file[\"relpath\"]) for file in dir_info\n )\n\n delta = working_dir_files - cached_files\n\n for file in delta:\n self.safe_remove({\"scheme\": \"local\", \"path\": file}, force=force)\n\n def _move(self, inp, outp):\n # moving in two stages to make the whole operation atomic in\n # case inp and outp are in different filesystems and actual\n # physical copying of data is happening\n tmp = \"{}.{}\".format(outp, str(uuid.uuid4()))\n move(inp, tmp)\n move(tmp, outp)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._save_file_RemoteLOCAL._save_file.return._self_PARAM_CHECKSUM_md5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._save_file_RemoteLOCAL._save_file.return._self_PARAM_CHECKSUM_md5", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 389, "end_line": 408, "span_ids": ["RemoteLOCAL._save_file"], "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 RemoteLOCAL(RemoteBase):\n\n def _save_file(self, path, md5):\n assert md5 is not None\n\n cache = self.get(md5)\n\n if self.changed_cache(md5):\n self._move(path, cache)\n else:\n remove(path)\n\n self.link(cache, path)\n self.state.update_link(path)\n\n # we need to update path and cache, since in case of reflink,\n # or copy cache type moving original file results in updates on\n # next executed command, which causes md5 recalculation\n self.state.update(path, md5)\n self.state.update(cache, md5)\n\n return {self.PARAM_CHECKSUM: 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/local.py_RemoteLOCAL.status_RemoteLOCAL._fill_statuses.for_md5_info_in_checksum.info_status_status": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.status_RemoteLOCAL._fill_statuses.for_md5_info_in_checksum.info_status_status", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 585, "end_line": 618, "span_ids": ["RemoteLOCAL._fill_statuses", "RemoteLOCAL.status"], "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 RemoteLOCAL(RemoteBase):\n\n def status(self, checksum_infos, remote, jobs=None, show_checksums=False):\n logger.info(\"Preparing to collect status from {}\".format(remote.url))\n title = \"Collecting information\"\n\n ret = {}\n\n progress.set_n_total(1)\n progress.update_target(title, 0, 100)\n\n progress.update_target(title, 10, 100)\n\n ret = self._group(checksum_infos, show_checksums=show_checksums)\n md5s = list(ret.keys())\n\n progress.update_target(title, 30, 100)\n\n remote_exists = list(remote.cache_exists(md5s))\n\n progress.update_target(title, 90, 100)\n\n local_exists = self.cache_exists(md5s)\n\n progress.finish_target(title)\n\n self._fill_statuses(ret, local_exists, remote_exists)\n\n self._log_missing_caches(ret)\n\n return ret\n\n def _fill_statuses(self, checksum_info_dir, local_exists, remote_exists):\n for md5, info in checksum_info_dir.items():\n status = STATUS_MAP[(md5 in local_exists, md5 in remote_exists)]\n info[\"status\"] = status", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.push_RemoteLOCAL._cache_metadata_changed.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL.push_RemoteLOCAL._cache_metadata_changed.return.True", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 704, "end_line": 732, "span_ids": ["RemoteLOCAL.push", "RemoteLOCAL.pull", "RemoteLOCAL._cache_metadata_changed"], "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 RemoteLOCAL(RemoteBase):\n\n def push(self, checksum_infos, remote, jobs=None, show_checksums=False):\n return self._process(\n checksum_infos,\n remote,\n jobs=jobs,\n show_checksums=show_checksums,\n download=False,\n )\n\n def pull(self, checksum_infos, remote, jobs=None, show_checksums=False):\n return self._process(\n checksum_infos,\n remote,\n jobs=jobs,\n show_checksums=show_checksums,\n download=True,\n )\n\n def _cache_metadata_changed(self):\n mtime, size = get_mtime_and_size(self.cache_dir)\n inode = get_inode(self.cache_dir)\n\n existing_record = self.state.get_state_record_for_inode(inode)\n\n if existing_record:\n cached_mtime, cached_size, _, _ = existing_record\n return not (mtime == cached_mtime and size == cached_size)\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/local.py_RemoteLOCAL._log_missing_caches_RemoteLOCAL._log_missing_caches.if_missing_caches_.logger_warning_msg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._log_missing_caches_RemoteLOCAL._log_missing_caches.if_missing_caches_.logger_warning_msg_", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 734, "end_line": 751, "span_ids": ["RemoteLOCAL._log_missing_caches"], "tokens": 146}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteLOCAL(RemoteBase):\n\n def _log_missing_caches(self, checksum_info_dict):\n missing_caches = [\n (md5, info)\n for md5, info in checksum_info_dict.items()\n if info[\"status\"] == STATUS_MISSING\n ]\n if missing_caches:\n missing_desc = \"\".join(\n [\n \"\\nname: {}, md5: {}\".format(info[\"name\"], md5)\n for md5, info in missing_caches\n ]\n )\n msg = (\n \"Some of the cache files do not exist neither locally \"\n \"nor on remote. Missing cache files: {}\".format(missing_desc)\n )\n logger.warning(msg)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._unprotect_file_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local.py_RemoteLOCAL._unprotect_file_", "embedding": null, "metadata": {"file_path": "dvc/remote/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 753, "end_line": 797, "span_ids": ["RemoteLOCAL.unprotect", "RemoteLOCAL._unprotect_file", "RemoteLOCAL._unprotect_dir"], "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": "class RemoteLOCAL(RemoteBase):\n\n @staticmethod\n def _unprotect_file(path):\n if System.is_symlink(path) or System.is_hardlink(path):\n logger.debug(\"Unprotecting '{}'\".format(path))\n tmp = os.path.join(os.path.dirname(path), \".\" + str(uuid.uuid4()))\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(\n path,\n tmp,\n name=\"Unprotecting '{}'\".format(os.path.relpath(path)),\n )\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, os.stat(path).st_mode | stat.S_IWRITE)\n\n @staticmethod\n def _unprotect_dir(path):\n for path in walk_files(path):\n RemoteLOCAL._unprotect_file(path)\n\n @staticmethod\n def unprotect(path_info):\n path = path_info[\"path\"]\n if not os.path.exists(path):\n raise DvcException(\n \"can't unprotect non-existing data '{}'\".format(path)\n )\n\n if os.path.isdir(path):\n RemoteLOCAL._unprotect_dir(path)\n else:\n RemoteLOCAL._unprotect_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/remote/s3.py_RemoteS3_RemoteS3.remove.self_s3_delete_object_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3_RemoteS3.remove.self_s3_delete_object_", "embedding": null, "metadata": {"file_path": "dvc/remote/s3.py", "file_name": "s3.py", "file_type": "text/x-python", "category": "implementation", "start_line": 33, "end_line": 127, "span_ids": ["RemoteS3", "RemoteS3.save_info", "RemoteS3.remove", "RemoteS3.s3", "RemoteS3.compat_config", "RemoteS3.__init__", "RemoteS3.copy", "RemoteS3.get_etag"], "tokens": 672}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteS3(RemoteBase):\n scheme = \"s3\"\n REGEX = r\"^s3://(?P.*)$\"\n REQUIRES = {\"boto3\": boto3}\n PARAM_CHECKSUM = \"etag\"\n\n def __init__(self, repo, config):\n super(RemoteS3, self).__init__(repo, config)\n\n storagepath = \"s3://{}\".format(\n config.get(Config.SECTION_AWS_STORAGEPATH, \"\").lstrip(\"/\")\n )\n\n self.url = config.get(Config.SECTION_REMOTE_URL, storagepath)\n\n self.region = os.environ.get(\"AWS_DEFAULT_REGION\") or config.get(\n Config.SECTION_AWS_REGION\n )\n\n self.profile = os.environ.get(\"AWS_PROFILE\") or config.get(\n Config.SECTION_AWS_PROFILE\n )\n\n self.endpoint_url = config.get(Config.SECTION_AWS_ENDPOINT_URL)\n\n self.list_objects = config.get(Config.SECTION_AWS_LIST_OBJECTS)\n\n self.use_ssl = config.get(Config.SECTION_AWS_USE_SSL, True)\n\n shared_creds = config.get(Config.SECTION_AWS_CREDENTIALPATH)\n if shared_creds:\n os.environ.setdefault(\"AWS_SHARED_CREDENTIALS_FILE\", shared_creds)\n\n parsed = urlparse(self.url)\n self.bucket = parsed.netloc\n self.prefix = parsed.path.lstrip(\"/\")\n\n self.path_info = {\"scheme\": self.scheme, \"bucket\": self.bucket}\n\n @staticmethod\n def compat_config(config):\n ret = config.copy()\n url = \"s3://\" + ret.pop(Config.SECTION_AWS_STORAGEPATH, \"\").lstrip(\"/\")\n ret[Config.SECTION_REMOTE_URL] = url\n return ret\n\n @property\n def s3(self):\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 def get_etag(self, bucket, path):\n try:\n obj = self.s3.head_object(Bucket=bucket, Key=path)\n except Exception:\n raise DvcException(\n \"s3://{}/{} does not exist\".format(bucket, path)\n )\n\n return obj[\"ETag\"].strip('\"')\n\n def save_info(self, path_info):\n if path_info[\"scheme\"] != \"s3\":\n raise NotImplementedError\n\n return {\n self.PARAM_CHECKSUM: self.get_etag(\n path_info[\"bucket\"], path_info[\"path\"]\n )\n }\n\n def copy(self, from_info, to_info, s3=None):\n s3 = s3 if s3 else self.s3\n\n source = {\"Bucket\": from_info[\"bucket\"], \"Key\": from_info[\"path\"]}\n self.s3.copy(source, to_info[\"bucket\"], to_info[\"path\"])\n\n def remove(self, path_info):\n if path_info[\"scheme\"] != \"s3\":\n raise NotImplementedError\n\n logger.debug(\n \"Removing s3://{}/{}\".format(\n path_info[\"bucket\"], path_info[\"path\"]\n )\n )\n\n self.s3.delete_object(\n Bucket=path_info[\"bucket\"], Key=path_info[\"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/s3.py_RemoteS3._list_paths_RemoteS3.exists.return.any_path_info_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3._list_paths_RemoteS3.exists.return.any_path_info_path_", "embedding": null, "metadata": {"file_path": "dvc/remote/s3.py", "file_name": "s3.py", "file_type": "text/x-python", "category": "implementation", "start_line": 129, "end_line": 153, "span_ids": ["RemoteS3._list_paths", "RemoteS3.exists", "RemoteS3.list_cache_paths"], "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 RemoteS3(RemoteBase):\n\n def _list_paths(self, bucket, prefix):\n \"\"\" Read config for list object api, paginate through list objects.\"\"\"\n s3 = self.s3\n kwargs = {\"Bucket\": bucket, \"Prefix\": prefix}\n if self.list_objects:\n list_objects_api = \"list_objects\"\n else:\n list_objects_api = \"list_objects_v2\"\n paginator = s3.get_paginator(list_objects_api)\n for page in paginator.paginate(**kwargs):\n contents = page.get(\"Contents\", None)\n if not contents:\n continue\n for item in contents:\n yield item[\"Key\"]\n\n def list_cache_paths(self):\n return self._list_paths(self.bucket, self.prefix)\n\n def exists(self, path_info):\n assert not isinstance(path_info, list)\n assert path_info[\"scheme\"] == \"s3\"\n\n paths = self._list_paths(path_info[\"bucket\"], path_info[\"path\"])\n return any(path_info[\"path\"] == path for path in paths)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3.upload_RemoteS3.upload.for_from_info_to_info_n.progress_finish_target_na": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3.upload_RemoteS3.upload.for_from_info_to_info_n.progress_finish_target_na", "embedding": null, "metadata": {"file_path": "dvc/remote/s3.py", "file_name": "s3.py", "file_type": "text/x-python", "category": "implementation", "start_line": 155, "end_line": 191, "span_ids": ["RemoteS3.upload"], "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 RemoteS3(RemoteBase):\n\n def upload(self, from_infos, to_infos, names=None):\n names = self._verify_path_args(to_infos, from_infos, names)\n\n s3 = self.s3\n\n for from_info, to_info, name in zip(from_infos, to_infos, names):\n if to_info[\"scheme\"] != \"s3\":\n raise NotImplementedError\n\n if from_info[\"scheme\"] != \"local\":\n raise NotImplementedError\n\n logger.debug(\n \"Uploading '{}' to '{}/{}'\".format(\n from_info[\"path\"], to_info[\"bucket\"], to_info[\"path\"]\n )\n )\n\n if not name:\n name = os.path.basename(from_info[\"path\"])\n\n total = os.path.getsize(from_info[\"path\"])\n cb = Callback(name, total)\n\n try:\n s3.upload_file(\n from_info[\"path\"],\n to_info[\"bucket\"],\n to_info[\"path\"],\n Callback=cb,\n )\n except Exception:\n msg = \"failed to upload '{}'\".format(from_info[\"path\"])\n logger.error(msg)\n continue\n\n progress.finish_target(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/ssh/connection.py_errno_create_cb.return.lambda_cur_tot_percent_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_errno_create_cb.return.lambda_cur_tot_percent_", "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": 39, "span_ids": ["percent_cb", "imports", "create_cb", "sizeof_fmt"], "tokens": 265}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import errno\nimport os\nimport posixpath\n\ntry:\n import paramiko\nexcept ImportError:\n paramiko = None\n\nimport dvc.logger as logger\nfrom dvc.utils import tmp_fname\nfrom dvc.utils.compat import makedirs\nfrom dvc.progress import progress\nfrom dvc.exceptions import DvcException\nfrom dvc.remote.base import RemoteCmdError\n\n\ndef sizeof_fmt(num, suffix=\"B\"):\n \"\"\" Convert number of bytes to human-readable string \"\"\"\n for unit in [\"\", \"K\", \"M\", \"G\", \"T\", \"P\", \"E\", \"Z\"]:\n if abs(num) < 1024.0:\n return \"%3.1f%s%s\" % (num, unit, suffix)\n num /= 1024.0\n return \"%.1f%s%s\" % (num, \"Y\", suffix)\n\n\ndef percent_cb(name, complete, total):\n \"\"\" Callback for updating target progress \"\"\"\n logger.debug(\n \"{}: {} transferred out of {}\".format(\n name, sizeof_fmt(complete), sizeof_fmt(total)\n )\n )\n progress.update_target(name, complete, total)\n\n\ndef create_cb(name):\n \"\"\" Create callback function for multipart object \"\"\"\n return lambda cur, tot: percent_cb(name, cur, tot)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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.walk_files.for_entry_in_dir_entries_.if_S_ISDIR_entry_st_mode_.elif_S_ISREG_entry_st_mod.yield_path": {"__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.walk_files.for_entry_in_dir_entries_.if_S_ISDIR_entry_st_mode_.elif_S_ISREG_entry_st_mod.yield_path", "embedding": null, "metadata": {"file_path": "dvc/remote/ssh/connection.py", "file_name": "connection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 126, "end_line": 153, "span_ids": ["SSHConnection.walk_files"], "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 SSHConnection:\n\n def walk_files(self, directory):\n from stat import S_ISLNK, S_ISDIR, S_ISREG\n\n self._sftp_connect()\n\n try:\n dir_entries = self._sftp.listdir_attr(directory)\n except IOError as exc:\n raise DvcException(\n \"couldn't get the '{}' remote directory files list\".format(\n directory\n ),\n cause=exc,\n )\n\n for entry in dir_entries:\n path = posixpath.join(directory, entry.filename)\n\n if S_ISLNK(entry.st_mode):\n path = self._sftp.readlink(directory)\n entry = self._sftp.stat(path)\n\n if S_ISDIR(entry.st_mode):\n for inner_path in self.walk_files(path):\n yield inner_path\n\n elif S_ISREG(entry.st_mode):\n yield 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.remove_SSHConnection.download.os_rename_tmp_file_dest_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.remove_SSHConnection.download.os_rename_tmp_file_dest_", "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": 181, "span_ids": ["SSHConnection.download", "SSHConnection.remove"], "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 SSHConnection:\n\n def remove(self, path):\n self._sftp_connect()\n try:\n self._sftp.remove(path)\n except IOError as exc:\n if exc.errno != errno.ENOENT:\n raise\n\n def download(self, src, dest, no_progress_bar=False, progress_title=None):\n self._sftp_connect()\n\n makedirs(os.path.dirname(dest), exist_ok=True)\n tmp_file = tmp_fname(dest)\n\n if no_progress_bar:\n self._sftp.get(src, tmp_file)\n else:\n if not progress_title:\n progress_title = os.path.basename(dest)\n\n self._sftp.get(src, tmp_file, callback=create_cb(progress_title))\n progress.finish_target(progress_title)\n\n if os.path.exists(dest):\n os.remove(dest)\n\n os.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/repo/brancher.py_brancher_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/brancher.py_brancher_", "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"], "tokens": 399}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def brancher( # noqa: E302\n self, branches=None, all_branches=False, tags=None, all_tags=False\n):\n \"\"\"Generator that iterates over specified revisions.\n\n Args:\n branches (list): a list of branches to iterate over.\n all_branches (bool): iterate over all available branches.\n tags (list): a list of tags to iterate over.\n all_tags (bool): iterate over all available tags.\n\n Yields:\n str: the display name for the currently selected tree, it could be:\n - a git revision identifier\n - empty string it there is no branches to iterate over\n - \"Working Tree\" if there are uncommited changes in the SCM repo\n \"\"\"\n if not any([branches, all_branches, tags, all_tags]):\n yield \"\"\n return\n\n saved_tree = self.tree\n revs = []\n\n scm = self.scm\n\n if self.scm.is_dirty():\n from dvc.scm.tree import WorkingTree\n\n self.tree = WorkingTree()\n yield \"Working Tree\"\n\n if all_branches:\n branches = scm.list_branches()\n\n if all_tags:\n tags = scm.list_tags()\n\n if branches is None:\n revs.extend([scm.active_branch()])\n else:\n revs.extend(branches)\n\n if tags is not None:\n revs.extend(tags)\n\n # NOTE: it might be a good idea to wrap this loop in try/finally block\n # to don't leave the tree on some unexpected branch after the\n # `brancher()`, but this could cause problems on exception handling\n # code which might expect the tree on which exception was raised to\n # stay in place. This behavior is a subject to change.\n for rev in revs:\n self.tree = scm.get_tree(rev)\n yield rev\n\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_from___future___import_un_get_progress_callback.return.ProgressCallback_total_fi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/checkout.py_from___future___import_un_get_progress_callback.return.ProgressCallback_total_fi", "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": 24, "span_ids": ["imports", "get_progress_callback", "_cleanup_unused_links", "get_all_files_numbers"], "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": "from __future__ import unicode_literals\n\nimport dvc.logger as logger\nfrom dvc.exceptions import CheckoutErrorSuggestGit\nfrom dvc.progress import ProgressCallback\n\n\ndef _cleanup_unused_links(self, all_stages):\n used = []\n for stage in all_stages:\n for out in stage.outs:\n used.append(out.path)\n self.state.remove_unused_links(used)\n\n\ndef get_all_files_numbers(stages):\n return sum(stage.get_all_files_number() for stage in stages)\n\n\ndef get_progress_callback(stages):\n total_files_num = get_all_files_numbers(stages)\n if total_files_num == 0:\n return None\n return ProgressCallback(total_files_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/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": 27, "end_line": 53, "span_ids": ["checkout"], "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 checkout(self, target=None, with_deps=False, force=False, recursive=False):\n from dvc.stage import StageFileDoesNotExistError, StageFileBadNameError\n\n all_stages = self.stages()\n\n try:\n stages = self.collect(target, with_deps=with_deps, recursive=recursive)\n except (StageFileDoesNotExistError, StageFileBadNameError) as exc:\n if not target:\n raise\n raise CheckoutErrorSuggestGit(target, exc)\n\n with self.state:\n _cleanup_unused_links(self, all_stages)\n progress_callback = get_progress_callback(stages)\n\n for stage in stages:\n if stage.locked:\n logger.warning(\n \"DVC file '{path}' is locked. Its dependencies are\"\n \" not going to be checked out.\".format(path=stage.relpath)\n )\n\n stage.checkout(force=force, progress_callback=progress_callback)\n if progress_callback:\n progress_callback.finish(\"Checkout finished!\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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__format_csv__format_csv.return._n_join_lines_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/show.py__format_csv__format_csv.return._n_join_lines_", "embedding": null, "metadata": {"file_path": "dvc/repo/metrics/show.py", "file_name": "show.py", "file_type": "text/x-python", "category": "implementation", "start_line": 69, "end_line": 106, "span_ids": ["_format_csv"], "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": "def _format_csv(content, delimiter):\n \"\"\"Format delimited text to have same column width.\n\n Args:\n content (str): The content of a metric.\n delimiter (str): Value separator\n\n Returns:\n str: Formatted content.\n\n Example:\n\n >>> content = (\n \"value_mse,deviation_mse,data_set\\n\"\n \"0.421601,0.173461,train\\n\"\n \"0.67528,0.289545,testing\\n\"\n \"0.671502,0.297848,validation\\n\"\n )\n >>> _format_csv(content, \",\")\n\n \"value_mse deviation_mse data_set\\n\"\n \"0.421601 0.173461 train\\n\"\n \"0.67528 0.289545 testing\\n\"\n \"0.671502 0.297848 validation\\n\"\n \"\"\"\n reader = csv_reader(StringIO(content), delimiter=builtin_str(delimiter))\n rows = [row for row in reader]\n max_widths = [max(map(len, column)) for column in zip(*rows)]\n\n lines = [\n \" \".join(\n \"{entry:{width}}\".format(entry=entry, width=width + 2)\n for entry, width in zip(row, max_widths)\n )\n for row in rows\n ]\n\n return \"\\n\".join(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/repo/metrics/show.py__format_output__format_output.return.content": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/show.py__format_output__format_output.return.content", "embedding": null, "metadata": {"file_path": "dvc/repo/metrics/show.py", "file_name": "show.py", "file_type": "text/x-python", "category": "implementation", "start_line": 109, "end_line": 126, "span_ids": ["_format_output"], "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 _format_output(content, typ):\n \"\"\"Tabularize the content according to its type.\n\n Args:\n content (str): The content of a metric.\n typ (str): The type of metric -- (raw|json|tsv|htsv|csv|hcsv).\n\n Returns:\n str: Content in a raw or tabular format.\n \"\"\"\n\n if \"csv\" in str(typ):\n return _format_csv(content, delimiter=\",\")\n\n if \"tsv\" in str(typ):\n return _format_csv(content, delimiter=\"\\t\")\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/metrics/show.py__read_metric__read_metric.try_.except_Exception_.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/show.py__read_metric__read_metric.try_.except_Exception_.return.None", "embedding": null, "metadata": {"file_path": "dvc/repo/metrics/show.py", "file_name": "show.py", "file_type": "text/x-python", "category": "implementation", "start_line": 129, "end_line": 145, "span_ids": ["_read_metric"], "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 _read_metric(fd, typ=None, xpath=None, rel_path=None, branch=None):\n typ = typ.lower().strip() if typ else typ\n try:\n if xpath:\n return _read_typed_metric(typ, xpath.strip(), fd)\n else:\n return _format_output(fd.read().strip(), typ)\n # Json path library has to be replaced or wrapped in\n # order to fix this too broad except clause.\n except Exception:\n logger.warning(\n \"unable to read metric in '{}' in branch '{}'\".format(\n rel_path, branch\n ),\n parse_exception=True,\n )\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/repo/metrics/show.py__read_metrics_filesystem__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__read_metrics_filesystem__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": 196, "end_line": 243, "span_ids": ["_read_metrics", "_read_metrics_filesystem"], "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 _read_metrics_filesystem(path, typ, xpath, rel_path, branch):\n if not os.path.exists(path):\n return None\n with open(path, \"r\") as fd:\n return _read_metric(\n fd, typ=typ, xpath=xpath, rel_path=rel_path, branch=branch\n )\n\n\ndef _read_metrics(self, metrics, branch):\n \"\"\"Read the content of each metric file and format it.\n\n Args:\n metrics (list): List of metric touples\n branch (str): Branch to look up for metrics.\n\n Returns:\n A dict mapping keys with metrics path name and content.\n For example:\n\n {'metric.csv': (\"value_mse deviation_mse data_set\\n\"\n \"0.421601 0.173461 train\\n\"\n \"0.67528 0.289545 testing\\n\"\n \"0.671502 0.297848 validation\\n\")}\n \"\"\"\n res = {}\n for out, typ, xpath in metrics:\n assert out.scheme == \"local\"\n if out.use_cache:\n metric = _read_metrics_filesystem(\n self.cache.local.get(out.checksum),\n typ=typ,\n xpath=xpath,\n rel_path=out.rel_path,\n branch=branch,\n )\n else:\n fd = self.tree.open(out.path)\n metric = _read_metric(\n fd, typ=typ, xpath=xpath, rel_path=out.rel_path, branch=branch\n )\n\n if not metric:\n continue\n\n res[out.rel_path] = metric\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/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": 246, "end_line": 269, "span_ids": ["show"], "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 show(\n self,\n path=None,\n typ=None,\n xpath=None,\n all_branches=False,\n all_tags=False,\n recursive=False,\n):\n res = {}\n\n for branch in self.brancher(all_branches=all_branches, all_tags=all_tags):\n entries = _collect_metrics(self, path, recursive, typ, xpath, branch)\n metrics = _read_metrics(self, entries, branch)\n if metrics:\n res[branch] = metrics\n\n if not res:\n if path:\n raise BadMetricError(path)\n raise NoMetricsError()\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/pkg.py_from___future___import_un_Package.is_in_root.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/pkg.py_from___future___import_un_Package.is_in_root.return.True", "embedding": null, "metadata": {"file_path": "dvc/repo/pkg.py", "file_name": "pkg.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 56, "span_ids": ["Package.install_or_update", "Package.is_in_root", "PackageParams.__init__", "PackageParams.all_addresses", "imports", "PackageManager", "PackageManager.__init__", "PackageParams", "Package", "PackageManager.read_packages", "PackageManager.get_package"], "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": "from __future__ import unicode_literals\n\nimport os\nimport shutil\nfrom git.cmd import Git\n\nimport dvc.logger as logger\nfrom dvc.exceptions import DvcException\nfrom dvc.stage import Stage\nfrom dvc.temp_git_repo import TempGitRepo\n\n\nclass PackageParams(object):\n def __init__(self, address, target_dir, select=[], file=None):\n self.address = address\n self.target_dir = target_dir\n self.select = select\n self.file = file\n\n @property\n def all_addresses(self):\n if self.address:\n return [self.address]\n return PackageManager.read_packages()\n\n\nclass PackageManager(object):\n PACKAGE_FILE = \"package.yaml\"\n\n @staticmethod\n def read_packages():\n return []\n\n @staticmethod\n def get_package(addr):\n for pkg_class in [GitPackage]:\n try:\n return pkg_class()\n except Exception:\n pass\n return None\n\n def __init__(self, addr):\n self._addr = addr\n\n\nclass Package(object):\n MODULES_DIR = \"dvc_mod\"\n\n def install_or_update(self, parent_repo, pkg_param):\n raise NotImplementedError(\n \"A method of abstract Package class was called\"\n )\n\n def is_in_root(self):\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/pkg.py_GitPackage_GitPackage.install_or_update.parent_repo_checkout_dvc_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/pkg.py_GitPackage_GitPackage.install_or_update.parent_repo_checkout_dvc_", "embedding": null, "metadata": {"file_path": "dvc/repo/pkg.py", "file_name": "pkg.py", "file_type": "text/x-python", "category": "implementation", "start_line": 59, "end_line": 120, "span_ids": ["GitPackage.install_or_update", "GitPackage"], "tokens": 408}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GitPackage(Package):\n DEF_DVC_FILE_PREFIX = \"mod_\"\n\n def install_or_update(self, parent_repo, pkg_params):\n if not self.is_in_root():\n raise DvcException(\n \"This command can be run only from a repository root\"\n )\n\n if not os.path.exists(self.MODULES_DIR):\n logger.debug(\"Creating modules dir {}\".format(self.MODULES_DIR))\n os.makedirs(self.MODULES_DIR)\n parent_repo.scm.ignore(os.path.abspath(self.MODULES_DIR))\n\n module_name = (\n Git.polish_url(pkg_params.address).strip(\"/\").split(\"/\")[-1]\n )\n if not module_name:\n raise DvcException(\n \"Package address error: unable to extract package name\"\n )\n\n with TempGitRepo(\n pkg_params.address, module_name, Package.MODULES_DIR\n ) as tmp_repo:\n outputs_to_copy = tmp_repo.outs\n if pkg_params.select:\n outputs_to_copy = list(\n filter(\n lambda out: out.dvc_path in pkg_params.select,\n outputs_to_copy,\n )\n )\n\n fetched_stage_files = set(\n map(lambda o: o.stage.path, outputs_to_copy)\n )\n tmp_repo.fetch(fetched_stage_files)\n\n module_dir = self.create_module_dir(module_name)\n tmp_repo.persist_to(module_dir, parent_repo)\n\n dvc_file = self.get_dvc_file_name(\n pkg_params.file, pkg_params.target_dir, module_name\n )\n try:\n self.persist_stage_and_scm_state(\n parent_repo,\n outputs_to_copy,\n pkg_params.target_dir,\n dvc_file,\n )\n except Exception as ex:\n raise DvcException(\n \"Package '{}' was installed \"\n \"but stage file '{}' \"\n \"was not created properly: {}\".format(\n pkg_params.address, dvc_file, ex\n )\n )\n\n parent_repo.checkout(dvc_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/repo/pkg.py_GitPackage.persist_stage_and_scm_state_GitPackage.persist_stage_and_scm_state.stage_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/pkg.py_GitPackage.persist_stage_and_scm_state_GitPackage.persist_stage_and_scm_state.stage_dump_", "embedding": null, "metadata": {"file_path": "dvc/repo/pkg.py", "file_name": "pkg.py", "file_type": "text/x-python", "category": "implementation", "start_line": 122, "end_line": 139, "span_ids": ["GitPackage.persist_stage_and_scm_state"], "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 GitPackage(Package):\n\n @staticmethod\n def persist_stage_and_scm_state(\n parent_repo, outputs_to_copy, target_dir, dvc_file\n ):\n stage = Stage.create(\n repo=parent_repo,\n fname=dvc_file,\n validate_state=False,\n wdir=target_dir,\n )\n stage.outs = list(\n map(lambda o: o.assign_to_stage_file(stage), outputs_to_copy)\n )\n\n for out in stage.outs:\n parent_repo.scm.ignore(out.path, in_curr_dir=True)\n\n stage.dump()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/pkg.py_GitPackage.create_module_dir_GitPackage.get_dvc_file_name.return.dvc_file_path": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/pkg.py_GitPackage.create_module_dir_GitPackage.get_dvc_file_name.return.dvc_file_path", "embedding": null, "metadata": {"file_path": "dvc/repo/pkg.py", "file_name": "pkg.py", "file_type": "text/x-python", "category": "implementation", "start_line": 141, "end_line": 157, "span_ids": ["GitPackage.create_module_dir", "GitPackage.get_dvc_file_name"], "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 GitPackage(Package):\n\n @staticmethod\n def create_module_dir(module_name):\n module_dir = os.path.join(GitPackage.MODULES_DIR, module_name)\n if os.path.exists(module_dir):\n logger.info(\"Updating package {}\".format(module_name))\n shutil.rmtree(module_dir)\n else:\n logger.info(\"Adding package {}\".format(module_name))\n return module_dir\n\n def get_dvc_file_name(self, stage_file, target_dir, module_name):\n if stage_file:\n dvc_file_path = stage_file\n else:\n dvc_file_name = self.DEF_DVC_FILE_PREFIX + module_name + \".dvc\"\n dvc_file_path = os.path.join(target_dir, dvc_file_name)\n return dvc_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/repo/pkg.py_install_pkg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/pkg.py_install_pkg_", "embedding": null, "metadata": {"file_path": "dvc/repo/pkg.py", "file_name": "pkg.py", "file_type": "text/x-python", "category": "implementation", "start_line": 160, "end_line": 202, "span_ids": ["install_pkg"], "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 install_pkg(self, pkg_params):\n \"\"\"\n Install package.\n\n The command can be run only from DVC project root.\n\n E.g.\n Having: DVC package in https://github.com/dmpetrov/tag_classifier\n\n $ dvc pkg install https://github.com/dmpetrov/tag_classifier\n\n Result: tag_classifier package in dvc_mod/ directory\n \"\"\"\n\n if not os.path.isdir(pkg_params.target_dir):\n logger.error(\n \"Unable to install package: \"\n \"target directory '{}' does not exist\".format(\n pkg_params.target_dir\n )\n )\n return 1\n\n curr_dir = os.path.realpath(os.curdir)\n if not os.path.realpath(pkg_params.target_dir).startswith(curr_dir):\n logger.error(\n \"Unable to install package: the current dir should be\"\n \" a subdirectory of the target dir {}\".format(\n pkg_params.target_dir\n )\n )\n return 1\n\n for addr in pkg_params.all_addresses:\n try:\n mgr = PackageManager.get_package(addr)\n mgr.install_or_update(self, pkg_params)\n except Exception as ex:\n logger.error(\"Unable to install package: \".format(ex))\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/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": 13, "span_ids": ["scm_context"], "tokens": 75}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 return result\n except Exception as e:\n repo.scm.cleanup_ignores()\n raise e\n\n return run", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tag/__init__.py_Tag_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tag/__init__.py_Tag_", "embedding": null, "metadata": {"file_path": "dvc/repo/tag/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 19, "span_ids": ["Tag.__init__", "Tag.remove", "Tag.list", "Tag.add", "Tag"], "tokens": 118}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Tag(object):\n def __init__(self, repo):\n self.repo = repo\n\n def add(self, *args, **kwargs):\n from dvc.repo.tag.add import add\n\n return add(self.repo, *args, **kwargs)\n\n def list(self, *args, **kwargs):\n from dvc.repo.tag.list import list\n\n return list(self.repo, *args, **kwargs)\n\n def remove(self, *args, **kwargs):\n from dvc.repo.tag.remove import remove\n\n return remove(self.repo, *args, **kwargs)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tag/add.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tag/add.py__", "embedding": null, "metadata": {"file_path": "dvc/repo/tag/add.py", "file_name": "add.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 16, "span_ids": ["add", "imports"], "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 dvc.logger as logger\n\n\ndef add(self, tag, target=None, with_deps=False, recursive=False):\n stages = self.collect(target, with_deps=with_deps, recursive=recursive)\n for stage in stages:\n changed = False\n for out in stage.outs:\n if not out.info:\n logger.warning(\"missing checksum info for '{}'\".format(out))\n continue\n out.tags[tag] = out.info.copy()\n changed = True\n if changed:\n stage.dump()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tag/list.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tag/list.py__", "embedding": null, "metadata": {"file_path": "dvc/repo/tag/list.py", "file_name": "list.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 12, "span_ids": ["list"], "tokens": 89}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def list(self, target=None, with_deps=False, recursive=False):\n ret = {}\n stages = self.collect(target, with_deps=with_deps, recursive=recursive)\n for stage in stages:\n outs_tags = {}\n for out in stage.outs:\n if out.tags:\n outs_tags[str(out)] = out.tags.copy()\n if outs_tags:\n ret.update({stage.relpath: outs_tags})\n return ret", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tag/remove.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tag/remove.py__", "embedding": null, "metadata": {"file_path": "dvc/repo/tag/remove.py", "file_name": "remove.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 16, "span_ids": ["imports", "remove"], "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 dvc.logger as logger\n\n\ndef remove(self, tag, target=None, with_deps=False, recursive=False):\n stages = self.collect(target, with_deps=with_deps, recursive=recursive)\n for stage in stages:\n changed = False\n for out in stage.outs:\n if tag not in out.tags.keys():\n logger.warning(\"tag '{}' not found for '{}'\".format(tag, out))\n continue\n del out.tags[tag]\n changed = True\n if changed:\n stage.dump()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_FileNotInTargetSubdirError._Thrown_when_trying_to_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/base.py__Manages_source_control_FileNotInTargetSubdirError._Thrown_when_trying_to_", "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": 22, "span_ids": ["FileNotInTargetSubdirError", "FileNotInRepoError", "SCMError", "docstring"], "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": "\"\"\"Manages source control systems(e.g. Git) in dvc.\"\"\"\n\nfrom __future__ import unicode_literals\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(DvcException):\n \"\"\"Thrown when trying to find .gitignore for a file that is not in a scm\n repository.\n \"\"\"\n\n\nclass FileNotInTargetSubdirError(DvcException):\n \"\"\"Thrown when trying to place .gitignore for a file that not in\n the file subdirectory.\"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": 25, "end_line": 136, "span_ids": ["Base.untracked_files", "Base.checkout", "Base.tag", "Base.dir", "Base.ignore", "Base.reset_ignores", "Base.is_repo", "Base.commit", "Base.cleanup_ignores", "Base.list_tags", "Base.branch", "Base.belongs_to_scm", "Base.add", "Base.install", "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": 742}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Base(object):\n \"\"\"Base class for source control management driver implementations.\"\"\"\n\n def __init__(self, root_dir=os.curdir, repo=None):\n self.repo = repo\n self.root_dir = os.path.realpath(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 uncommited 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 install(self):\n \"\"\"Adds dvc commands to SCM hooks for the repo.\"\"\"\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 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\"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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__Git.ignore_file.return.self_GITIGNORE": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py__Manages_Git__Git.ignore_file.return.self_GITIGNORE", "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": 64, "span_ids": ["Git.__init__", "Git.is_submodule", "Git.dir", "Git._get_git_dir", "docstring", "Git", "Git.ignore_file", "Git.is_repo"], "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": "\"\"\"Manages Git.\"\"\"\n\nfrom __future__ import unicode_literals\n\nimport os\n\nfrom dvc.utils.compat import str, open\nfrom dvc.utils import fix_env\nfrom dvc.scm.base import (\n Base,\n SCMError,\n FileNotInRepoError,\n FileNotInTargetSubdirError,\n)\nfrom dvc.scm.git.tree import GitTree\nimport dvc.logger as logger\n\n\nclass Git(Base):\n \"\"\"Class for managing Git.\"\"\"\n\n GITIGNORE = \".gitignore\"\n GIT_DIR = \".git\"\n\n def __init__(self, root_dir=os.curdir, repo=None):\n super(Git, self).__init__(root_dir, repo=repo)\n\n import git\n from git.exc import InvalidGitRepositoryError\n\n try:\n self.git = git.Repo(root_dir)\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.git.git.update_environment(LD_LIBRARY_PATH=libpath)\n\n self.ignored_paths = []\n self.files_to_track = []\n\n @staticmethod\n def is_repo(root_dir):\n return os.path.isdir(Git._get_git_dir(root_dir))\n\n @staticmethod\n def is_submodule(root_dir):\n return os.path.isfile(Git._get_git_dir(root_dir))\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.git.git_dir\n\n @property\n def ignore_file(self):\n return self.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._get_gitignore_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._get_gitignore_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": 66, "end_line": 92, "span_ids": ["Git._get_gitignore"], "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 Git(Base):\n\n def _get_gitignore(self, path, ignore_file_dir=None):\n if not ignore_file_dir:\n ignore_file_dir = os.path.dirname(os.path.realpath(path))\n\n assert os.path.isabs(path)\n assert os.path.isabs(ignore_file_dir)\n\n if not path.startswith(ignore_file_dir):\n msg = (\n \"{} file has to be located in one of '{}' subdirectories\"\n \", not outside '{}'\"\n )\n raise FileNotInTargetSubdirError(\n msg.format(self.GITIGNORE, path, ignore_file_dir)\n )\n\n entry = os.path.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 gitignore.startswith(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.ignore_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.ignore_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": 94, "end_line": 118, "span_ids": ["Git.ignore"], "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 Git(Base):\n\n def ignore(self, path, in_curr_dir=False):\n base_dir = (\n os.path.realpath(os.curdir)\n if in_curr_dir\n else os.path.dirname(path)\n )\n entry, gitignore = self._get_gitignore(path, base_dir)\n\n ignore_list = []\n if os.path.exists(gitignore):\n with open(gitignore, \"r\") as f:\n ignore_list = f.readlines()\n if any(filter(lambda x: x.strip() == entry.strip(), ignore_list)):\n return\n\n msg = \"Adding '{}' to '{}'.\".format(\n os.path.relpath(path), os.path.relpath(gitignore)\n )\n logger.info(msg)\n\n self._add_entry_to_gitignore(entry, gitignore, ignore_list)\n\n self.track_file(os.path.relpath(gitignore))\n\n self.ignored_paths.append(path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git._add_entry_to_gitignore_Git.ignore_remove.self_track_file_os_path_r": {"__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.ignore_remove.self_track_file_os_path_r", "embedding": null, "metadata": {"file_path": "dvc/scm/git/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 120, "end_line": 142, "span_ids": ["Git.ignore_remove", "Git._add_entry_to_gitignore"], "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 Git(Base):\n\n @staticmethod\n def _add_entry_to_gitignore(entry, gitignore, ignore_list):\n content = entry\n if ignore_list:\n content = \"\\n\" + content\n with open(gitignore, \"a\", encoding=\"utf-8\") as fobj:\n fobj.write(content)\n\n def ignore_remove(self, path):\n entry, gitignore = self._get_gitignore(path)\n\n if not os.path.exists(gitignore):\n return\n\n with open(gitignore, \"r\") as fobj:\n lines = fobj.readlines()\n\n filtered = list(filter(lambda x: x.strip() != entry.strip(), lines))\n\n with open(gitignore, \"w\") as fobj:\n fobj.writelines(filtered)\n\n self.track_file(os.path.relpath(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.add_Git.add.try_.except_AssertionError_.logger_error_msg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.add_Git.add.try_.except_AssertionError_.logger_error_msg_", "embedding": null, "metadata": {"file_path": "dvc/scm/git/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 144, "end_line": 157, "span_ids": ["Git.add"], "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 Git(Base):\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.git.index.add(paths)\n except AssertionError:\n msg = (\n \"failed to add '{}' to git. You can add those files\"\n \" manually using 'git add'.\"\n \" See 'https://github.com/iterative/dvc/issues/610'\"\n \" for more details.\".format(str(paths))\n )\n\n logger.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/scm/git/__init__.py_Git.commit_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.commit_", "embedding": null, "metadata": {"file_path": "dvc/scm/git/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 159, "end_line": 238, "span_ids": ["Git.is_tracked", "Git.is_dirty", "Git.commit", "Git.cleanup_ignores", "Git.list_branches", "Git.checkout", "Git._install_hook", "Git.reset_ignores", "Git.install", "Git.track_file", "Git.untracked_files", "Git.list_tags", "Git.tag", "Git.branch", "Git.remind_to_track", "Git.belongs_to_scm", "Git.active_branch", "Git.get_tree"], "tokens": 578}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Git(Base):\n\n def commit(self, msg):\n self.git.index.commit(msg)\n\n def checkout(self, branch, create_new=False):\n if create_new:\n self.git.git.checkout(\"HEAD\", b=branch)\n else:\n self.git.git.checkout(branch)\n\n def branch(self, branch):\n self.git.git.branch(branch)\n\n def tag(self, tag):\n self.git.git.tag(tag)\n\n def untracked_files(self):\n files = self.git.untracked_files\n return [os.path.join(self.git.working_dir, fname) for fname in files]\n\n def is_tracked(self, path):\n # it is equivalent to `bool(self.git.git.ls_files(path))` by\n # functionality, but ls_files fails on unicode filenames\n path = os.path.relpath(path, self.root_dir)\n return path in [i[0] for i in self.git.index.entries]\n\n def is_dirty(self):\n return self.git.is_dirty()\n\n def active_branch(self):\n return self.git.active_branch.name\n\n def list_branches(self):\n return [h.name for h in self.git.heads]\n\n def list_tags(self):\n return [t.name for t in self.git.tags]\n\n def _install_hook(self, name, cmd):\n hook = os.path.join(self.root_dir, self.GIT_DIR, \"hooks\", name)\n if os.path.isfile(hook):\n msg = \"git hook '{}' already exists.\"\n raise SCMError(msg.format(os.path.relpath(hook)))\n with open(hook, \"w+\") as fobj:\n fobj.write(\"#!/bin/sh\\nexec dvc {}\\n\".format(cmd))\n os.chmod(hook, 0o777)\n\n def install(self):\n self._install_hook(\"post-checkout\", \"checkout\")\n self._install_hook(\"pre-commit\", \"status\")\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 remind_to_track(self):\n if not self.files_to_track:\n return\n\n logger.info(\n \"\\n\"\n \"To track the changes with git run:\\n\"\n \"\\n\"\n \"\\tgit add {files}\".format(files=\" \".join(self.files_to_track))\n )\n\n def track_file(self, path):\n self.files_to_track.append(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.git, 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_errno_GitTree.open.return.StringIO_obj_data_stream_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_errno_GitTree.open.return.StringIO_obj_data_stream_", "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": 42, "span_ids": ["imports", "GitTree", "GitTree.open", "GitTree.__init__"], "tokens": 290}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import errno\nimport os\n\nfrom dvc.utils.compat import StringIO\n\nfrom dvc.scm.tree import BaseTree\n\n\n# see git-fast-import(1)\nGIT_MODE_DIR = 0o40000\nGIT_MODE_FILE = 0o644\n\n\nclass 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 def open(self, path):\n\n relpath = os.path.relpath(path, self.git.working_dir)\n\n obj = self.git_object_by_path(path)\n if obj is None:\n msg = \"No such file in branch '{}'\".format(self.rev)\n raise IOError(errno.ENOENT, msg, relpath)\n if obj.mode == GIT_MODE_DIR:\n raise IOError(errno.EISDIR, \"Is a directory\", relpath)\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 return StringIO(obj.data_stream.read().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/scm/git/tree.py_GitTree.exists_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_GitTree.exists_", "embedding": null, "metadata": {"file_path": "dvc/scm/git/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 44, "end_line": 115, "span_ids": ["GitTree.isfile", "GitTree.exists", "GitTree._walk", "GitTree._is_tree_and_contains", "GitTree.walk", "GitTree.git_object_by_path", "GitTree.isdir"], "tokens": 532}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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 i in obj:\n if i.name == path:\n return True\n return False\n\n def git_object_by_path(self, path):\n path = os.path.relpath(os.path.realpath(path), self.git.working_dir)\n assert path.split(os.sep, 1)[0] != \"..\"\n tree = self.git.tree(self.rev)\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\n\n def _walk(self, tree, topdown=True):\n\n dirs, nondirs = [], []\n for i in tree:\n if i.mode == GIT_MODE_DIR:\n dirs.append(i.name)\n else:\n nondirs.append(i.name)\n\n if topdown:\n yield os.path.normpath(tree.path), dirs, nondirs\n for i in dirs:\n for x in self._walk(tree[i], topdown=True):\n yield x\n if not topdown:\n yield os.path.normpath(tree.path), dirs, nondirs\n\n def walk(self, top, topdown=True):\n \"\"\"Directory tree generator.\n\n See `os.walk` for the docs. Differences:\n - no support for symlinks\n - it could raise exceptions, there is no onerror argument\n \"\"\"\n\n tree = self.git_object_by_path(top)\n if tree is None:\n raise IOError(errno.ENOENT, \"No such file\")\n\n for x in self._walk(tree, topdown):\n yield 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/dvc/scm/tree.py_os_BaseTree.walk._Directory_tree_generat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/tree.py_os_BaseTree.walk._Directory_tree_generat", "embedding": null, "metadata": {"file_path": "dvc/scm/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 27, "span_ids": ["BaseTree.open", "imports", "BaseTree.exists", "BaseTree.isdir", "BaseTree", "BaseTree.isfile", "BaseTree.walk"], "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 os\n\nfrom dvc.utils.compat import open\n\n\nclass BaseTree(object):\n \"\"\"Abstract class to represent access to files\"\"\"\n\n def open(self, path):\n \"\"\"Open file and return a stream.\"\"\"\n\n def exists(self, path):\n \"\"\"Test whether a path exists.\"\"\"\n\n def isdir(self, path):\n \"\"\"Return true if the pathname refers to an existing directory.\"\"\"\n\n def isfile(self, path):\n \"\"\"Test whether a path is a regular file\"\"\"\n\n def walk(self, top, topdown=True):\n \"\"\"Directory tree generator.\n\n See `os.walk` for the docs. Differences:\n - no support for symlinks\n - it could raise exceptions, there is no onerror argument\n \"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/tree.py_WorkingTree_WorkingTree.isfile.return.os_path_isfile_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/tree.py_WorkingTree_WorkingTree.isfile.return.os_path_isfile_path_", "embedding": null, "metadata": {"file_path": "dvc/scm/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 30, "end_line": 47, "span_ids": ["WorkingTree.isdir", "WorkingTree", "WorkingTree.exists", "WorkingTree.isfile", "WorkingTree.open"], "tokens": 123}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class WorkingTree(BaseTree):\n \"\"\"Proxies the repo file access methods to working tree files\"\"\"\n\n def open(self, path):\n \"\"\"Open file and return a stream.\"\"\"\n return open(path, encoding=\"utf-8\")\n\n def exists(self, path):\n \"\"\"Test whether a path exists.\"\"\"\n return os.path.exists(path)\n\n def isdir(self, path):\n \"\"\"Return true if the pathname refers to an existing directory.\"\"\"\n return os.path.isdir(path)\n\n def isfile(self, path):\n \"\"\"Test whether a path is a regular file\"\"\"\n return os.path.isfile(path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/tree.py_WorkingTree.walk_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/tree.py_WorkingTree.walk_", "embedding": null, "metadata": {"file_path": "dvc/scm/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 49, "end_line": 66, "span_ids": ["WorkingTree.walk"], "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 WorkingTree(BaseTree):\n\n def walk(self, top, topdown=True):\n \"\"\"Directory tree generator.\n\n See `os.walk` for the docs. Differences:\n - no support for symlinks\n - it could raise exceptions, there is no onerror argument\n \"\"\"\n\n def onerror(e):\n raise e\n\n for root, dirs, files in os.walk(\n top, topdown=topdown, onerror=onerror\n ):\n if topdown:\n dirs[:] = [i for i in dirs if i not in (\".git\", \".hg\", \".dvc\")]\n yield os.path.normpath(root), 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/stage.py_Stage._fill_stage_outputs_Stage._fill_stage_outputs.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage._fill_stage_outputs_Stage._fill_stage_outputs.None_4", "embedding": null, "metadata": {"file_path": "dvc/stage.py", "file_name": "stage.py", "file_type": "text/x-python", "category": "implementation", "start_line": 499, "end_line": 522, "span_ids": ["Stage._fill_stage_outputs"], "tokens": 182}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Stage(object):\n\n @staticmethod\n def _fill_stage_outputs(\n stage,\n outs,\n outs_no_cache,\n metrics,\n metrics_no_cache,\n outs_persist,\n outs_persist_no_cache,\n ):\n stage.outs = output.loads_from(stage, outs, use_cache=True)\n stage.outs += output.loads_from(\n stage, metrics, use_cache=True, metric=True\n )\n stage.outs += output.loads_from(\n stage, outs_persist, use_cache=True, persist=True\n )\n stage.outs += output.loads_from(stage, outs_no_cache, use_cache=False)\n stage.outs += output.loads_from(\n stage, metrics_no_cache, use_cache=False, metric=True\n )\n stage.outs += output.loads_from(\n stage, outs_persist_no_cache, use_cache=False, persist=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/stage.py_Stage._check_dvc_filename_Stage._get_path_tag.return.match_group_path_matc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage._check_dvc_filename_Stage._get_path_tag.return.match_group_path_matc", "embedding": null, "metadata": {"file_path": "dvc/stage.py", "file_name": "stage.py", "file_type": "text/x-python", "category": "implementation", "start_line": 524, "end_line": 550, "span_ids": ["Stage._get_path_tag", "Stage._check_isfile", "Stage._check_file_exists", "Stage._check_dvc_filename"], "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 Stage(object):\n\n @staticmethod\n def _check_dvc_filename(fname):\n if not Stage.is_valid_filename(fname):\n raise StageFileBadNameError(\n \"bad stage filename '{}'. Stage files should be named\"\n \" 'Dvcfile' or have a '.dvc' suffix (e.g. '{}.dvc').\".format(\n os.path.relpath(fname), os.path.basename(fname)\n )\n )\n\n @staticmethod\n def _check_file_exists(repo, fname):\n if not repo.tree.exists(fname):\n raise StageFileDoesNotExistError(fname)\n\n @staticmethod\n def _check_isfile(repo, fname):\n if not repo.tree.isfile(fname):\n raise StageFileIsNotDvcFileError(fname)\n\n @classmethod\n def _get_path_tag(cls, s):\n regex = re.compile(cls.TAG_REGEX)\n match = regex.match(s)\n if not match:\n return s, None\n return match.group(\"path\"), match.group(\"tag\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage.dumpd_Stage.dump.self_repo_scm_track_file_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage.dumpd_Stage.dump.self_repo_scm_track_file_", "embedding": null, "metadata": {"file_path": "dvc/stage.py", "file_name": "stage.py", "file_type": "text/x-python", "category": "implementation", "start_line": 588, "end_line": 621, "span_ids": ["Stage.dump", "Stage.dumpd"], "tokens": 229}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Stage(object):\n\n def dumpd(self):\n from dvc.remote.local import RemoteLOCAL\n\n return {\n key: value\n for key, value in {\n Stage.PARAM_MD5: self.md5,\n Stage.PARAM_CMD: self.cmd,\n Stage.PARAM_WDIR: RemoteLOCAL.unixpath(\n os.path.relpath(self.wdir, os.path.dirname(self.path))\n ),\n Stage.PARAM_LOCKED: self.locked,\n Stage.PARAM_DEPS: [d.dumpd() for d in self.deps],\n Stage.PARAM_OUTS: [o.dumpd() for o in self.outs],\n }.items()\n if value\n }\n\n def dump(self):\n fname = self.path\n\n self._check_dvc_filename(fname)\n\n logger.info(\n \"Saving information to '{file}'.\".format(\n file=os.path.relpath(fname)\n )\n )\n d = self.dumpd()\n\n with open(fname, \"w\") as fd:\n yaml.safe_dump(d, fd, default_flow_style=False)\n\n self.repo.scm.track_file(os.path.relpath(fname))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/temp_git_repo.py_os_TempGitRepo._clone_to_temp_dir.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/temp_git_repo.py_os_TempGitRepo._clone_to_temp_dir.return.result", "embedding": null, "metadata": {"file_path": "dvc/temp_git_repo.py", "file_name": "temp_git_repo.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 82, "span_ids": ["TempGitRepo._set_state", "TempGitRepo", "TempRepoException", "imports", "TempGitRepo.__enter__", "TempGitRepo._clone_to_temp_dir", "TempGitRepo.fetch", "TempGitRepo.__init__", "TempRepoException.__init__", "TempGitRepo._reset_state", "TempGitRepo.is_state_set"], "tokens": 525}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport shutil\nimport tempfile\n\nimport git\n\nfrom dvc import logger\nfrom dvc.exceptions import DvcException\n\n\nclass TempRepoException(DvcException):\n \"\"\"Raise when temporary package repository has not properly created\"\"\"\n\n def __init__(self, temp_repo, msg, cause=None):\n m = \"temp repository '{}' error: {}\".format(temp_repo.addr, msg)\n super(TempRepoException, self).__init__(m, cause)\n\n\nclass TempGitRepo(object):\n GIT_DIR_TO_REMOVE = \".git\"\n GIT_FILES_TO_REMOVE = [\".gitignore\", \".gitmodules\"]\n SUFFIX = \"tmp_DVC_mod\"\n\n def __init__(self, addr, module_name, modules_dir):\n self.addr = addr\n self.modules_dir = modules_dir\n self._tmp_mod_prefix = module_name + \"_\" + self.SUFFIX + \"_\"\n self._reset_state()\n\n def _reset_state(self):\n self._set_state(None, [])\n\n def _set_state(self, cloned_tmp_dir, outs):\n from dvc.repo import Repo\n\n self.repo = Repo(cloned_tmp_dir) if cloned_tmp_dir else None\n\n self._cloned_tmp_dir = cloned_tmp_dir\n self.outs = outs\n self._moved_files = []\n\n def fetch(self, targets):\n for target in targets:\n try:\n self.repo.fetch(target)\n except Exception as ex:\n msg = \"error in fetching data from {}: {}\".format(\n os.path.basename(target), ex\n )\n raise TempRepoException(self, msg)\n\n @property\n def is_state_set(self):\n return self._cloned_tmp_dir is not None\n\n def __enter__(self):\n if self.is_state_set:\n raise TempRepoException(self, \"Git repo cloning duplication\")\n\n module_temp_dir = None\n try:\n module_temp_dir = self._clone_to_temp_dir()\n self._remove_git_files_and_dirs(module_temp_dir)\n\n outputs = self._read_outputs(module_temp_dir)\n self._set_state(module_temp_dir, outputs)\n finally:\n self._clean_mod_temp_dir(module_temp_dir)\n\n return self\n\n def _clone_to_temp_dir(self):\n result = tempfile.mktemp(\n prefix=self._tmp_mod_prefix, dir=self.modules_dir\n )\n logger.debug(\n \"Cloning git repository {} to temp dir {}\".format(\n self.addr, result\n )\n )\n git.Repo.clone_from(self.addr, result, depth=1)\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/temp_git_repo.py_TempGitRepo._remove_git_files_and_dirs_TempGitRepo._remove_git_files_and_dirs.for_item_in_TempGitRepo_G.if_os_path_exists_fname_.os_remove_fname_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/temp_git_repo.py_TempGitRepo._remove_git_files_and_dirs_TempGitRepo._remove_git_files_and_dirs.for_item_in_TempGitRepo_G.if_os_path_exists_fname_.os_remove_fname_", "embedding": null, "metadata": {"file_path": "dvc/temp_git_repo.py", "file_name": "temp_git_repo.py", "file_type": "text/x-python", "category": "implementation", "start_line": 84, "end_line": 98, "span_ids": ["TempGitRepo._remove_git_files_and_dirs"], "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 TempGitRepo(object):\n\n def _remove_git_files_and_dirs(self, module_temp_dir):\n logger.debug(\n \"Removing git meta files from {}: {} dif and {}\".format(\n module_temp_dir,\n TempGitRepo.GIT_DIR_TO_REMOVE,\n \", \".join(TempGitRepo.GIT_FILES_TO_REMOVE),\n )\n )\n shutil.rmtree(\n os.path.join(module_temp_dir, TempGitRepo.GIT_DIR_TO_REMOVE)\n )\n for item in TempGitRepo.GIT_FILES_TO_REMOVE:\n fname = os.path.join(module_temp_dir, item)\n if os.path.exists(fname):\n os.remove(fname)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/temp_git_repo.py_TempGitRepo._clean_mod_temp_dir_TempGitRepo.persist_to.self__reset_state_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/temp_git_repo.py_TempGitRepo._clean_mod_temp_dir_TempGitRepo.persist_to.self__reset_state_", "embedding": null, "metadata": {"file_path": "dvc/temp_git_repo.py", "file_name": "temp_git_repo.py", "file_type": "text/x-python", "category": "implementation", "start_line": 100, "end_line": 128, "span_ids": ["TempGitRepo._read_outputs", "TempGitRepo.persist_to", "TempGitRepo._clean_mod_temp_dir"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TempGitRepo(object):\n\n def _clean_mod_temp_dir(self, module_temp_dir):\n if not self.is_state_set:\n if module_temp_dir and os.path.exists(module_temp_dir):\n shutil.rmtree(module_temp_dir, ignore_errors=True)\n\n def _read_outputs(self, module_temp_dir):\n from dvc.repo import Repo\n\n pkg_repo = Repo(module_temp_dir)\n stages = pkg_repo.stages()\n return [out for s in stages for out in s.outs]\n\n def persist_to(self, module_dir, parent_repo):\n if not self.is_state_set:\n raise TempRepoException(self, \"cannot persist\")\n\n tmp_repo_cache = self.repo.cache.local.url\n\n for prefix in os.listdir(tmp_repo_cache):\n if len(prefix) != 2:\n logger.warning(\n \"wrong dir format in cache {}: dir {}\".format(\n tmp_repo_cache, prefix\n )\n )\n self._move_all_cache_files(parent_repo, prefix, tmp_repo_cache)\n\n shutil.move(self._cloned_tmp_dir, module_dir)\n self._reset_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/temp_git_repo.py_TempGitRepo._move_all_cache_files_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/temp_git_repo.py_TempGitRepo._move_all_cache_files_", "embedding": null, "metadata": {"file_path": "dvc/temp_git_repo.py", "file_name": "temp_git_repo.py", "file_type": "text/x-python", "category": "implementation", "start_line": 130, "end_line": 146, "span_ids": ["TempGitRepo._move_all_cache_files", "TempGitRepo.__exit__"], "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 TempGitRepo(object):\n\n @staticmethod\n def _move_all_cache_files(parent_repo, prefix, tmp_repo_cache):\n obj_name = os.path.join(tmp_repo_cache, prefix)\n for suffix in os.listdir(obj_name):\n src_path = os.path.join(tmp_repo_cache, prefix, suffix)\n pre = os.path.join(parent_repo.cache.local.url, prefix)\n if not os.path.exists(pre):\n os.mkdir(pre)\n dest = os.path.join(pre, suffix)\n shutil.move(src_path, dest)\n\n def __exit__(self, exc_type, exc_value, traceback):\n if self.is_state_set:\n shutil.rmtree(self._cloned_tmp_dir)\n self._reset_state()\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/compat.py__Handle_import_compatib_encode.return.u_encode_encoding_repla": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/compat.py__Handle_import_compatib_encode.return.u_encode_encoding_repla", "embedding": null, "metadata": {"file_path": "dvc/utils/compat.py", "file_name": "compat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 27, "span_ids": ["no_code", "encode", "docstring"], "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": "\"\"\"Handle import compatibility between Python 2 and Python 3\"\"\"\n\nimport sys\nimport os\nimport errno\n\n\n# Syntax sugar.\n_ver = sys.version_info\n\n#: Python 2.x?\nis_py2 = _ver[0] == 2\n\n#: Python 3.x?\nis_py3 = _ver[0] == 3\n\n# simplified version of ipython_genutils/encoding.py\nDEFAULT_ENCODING = sys.getdefaultencoding()\n\n\ndef no_code(x, encoding=None):\n return x\n\n\ndef encode(u, encoding=None):\n encoding = encoding or DEFAULT_ENCODING\n return u.encode(encoding, \"replace\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/compat.py_csv_reader_csv_reader.if_is_py3_.else_.for_row_in_reader_._noqa_F821": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/compat.py_csv_reader_csv_reader.if_is_py3_.else_.for_row_in_reader_._noqa_F821", "embedding": null, "metadata": {"file_path": "dvc/utils/compat.py", "file_name": "compat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 30, "end_line": 52, "span_ids": ["csv_reader"], "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 csv_reader(unicode_csv_data, dialect=None, **kwargs):\n \"\"\"csv.reader doesn't support Unicode input, so need to use some tricks\n to work around this.\n\n Source: https://docs.python.org/2/library/csv.html#csv-examples\n \"\"\"\n import csv\n\n dialect = dialect or csv.excel\n\n if is_py3:\n # Python3 supports encoding by default, so just return the object\n for row in csv.reader(unicode_csv_data, dialect=dialect, **kwargs):\n yield [cell for cell in row]\n\n else:\n # csv.py doesn't do Unicode; encode temporarily as UTF-8:\n reader = csv.reader(\n utf_8_encoder(unicode_csv_data), dialect=dialect, **kwargs\n )\n for row in reader:\n # decode UTF-8 back to Unicode, cell by cell:\n yield [unicode(cell, \"utf-8\") for cell in row] # noqa: F821", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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/compat.py_utf_8_encoder__makedirs.try_.except_OSError_.if_not_exist_ok_or_not_os.raise": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/compat.py_utf_8_encoder__makedirs.try_.except_OSError_.if_not_exist_ok_or_not_os.raise", "embedding": null, "metadata": {"file_path": "dvc/utils/compat.py", "file_name": "compat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 55, "end_line": 90, "span_ids": ["utf_8_encoder", "_makedirs", "cast_bytes"], "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": "def utf_8_encoder(unicode_csv_data):\n \"\"\"Source: https://docs.python.org/2/library/csv.html#csv-examples\"\"\"\n for line in unicode_csv_data:\n yield line.encode(\"utf-8\")\n\n\ndef cast_bytes(s, encoding=None):\n \"\"\"Source: https://github.com/ipython/ipython_genutils\"\"\"\n if not isinstance(s, bytes):\n return encode(s, encoding)\n return s\n\n\ndef _makedirs(name, mode=0o777, exist_ok=False):\n \"\"\"Source: https://github.com/python/cpython/blob/\n 3ce3dea60646d8a5a1c952469a2eb65f937875b3/Lib/os.py#L196-L226\n \"\"\"\n head, tail = os.path.split(name)\n if not tail:\n head, tail = os.path.split(head)\n if head and tail and not os.path.exists(head):\n try:\n _makedirs(head, exist_ok=exist_ok)\n except OSError as e:\n if e.errno != errno.EEXIST:\n raise\n cdir = os.curdir\n if isinstance(tail, bytes):\n cdir = bytes(os.curdir, \"ASCII\")\n if tail == cdir:\n return\n try:\n os.mkdir(name, mode)\n except OSError:\n if not exist_ok or not os.path.isdir(name):\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/basic_env.py__encoding_utf_8_TestDirFixture.tearDown.self__popd_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py__encoding_utf_8_TestDirFixture.tearDown.self__popd_", "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": 96, "span_ids": ["TestDirFixture.mkdtemp", "TestDirFixture._pushd", "TestDirFixture.__init__", "TestDirFixture.setUp", "TestDirFixture.create", "TestDirFixture", "TestDirFixture._popd", "docstring", "TestDirFixture.tearDown"], "tokens": 761}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# encoding: utf-8\n\nfrom __future__ import unicode_literals\n\nimport os\nimport shutil\nimport uuid\nimport tempfile\n\nfrom git import Repo\nfrom git.exc import GitCommandNotFound\nfrom unittest import TestCase\n\nimport dvc.logger as logger\nfrom dvc.command.remote import CmdRemoteAdd\nfrom dvc.repo import Repo as DvcRepo\nfrom dvc.utils.compat import open, str\n\n\nclass TestDirFixture(object):\n GCP_CREDS_FILE = os.path.abspath(\n os.path.join(\"scripts\", \"ci\", \"gcp-creds.json\")\n )\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, root_dir=None):\n if root_dir:\n os.mkdir(root_dir)\n else:\n root_dir = self.mkdtemp()\n self._root_dir = os.path.realpath(root_dir)\n\n def _pushd(self, d):\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():\n prefix = \"dvc-test.{}.\".format(os.getpid())\n suffix = \".{}\".format(uuid.uuid4())\n return tempfile.mkdtemp(prefix=prefix, suffix=suffix)\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)\n\n def tearDown(self):\n self._popd()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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.setUp.self_git_index_commit_ad": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py_TestGitFixture_TestGitFixture.setUp.self_git_index_commit_ad", "embedding": null, "metadata": {"file_path": "tests/basic_env.py", "file_name": "basic_env.py", "file_type": "text/x-python", "category": "implementation", "start_line": 99, "end_line": 119, "span_ids": ["TestGitFixture.setUp", "TestGitFixture"], "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 TestGitFixture(TestDirFixture):\n N_RETRIES = 5\n\n def setUp(self):\n super(TestGitFixture, self).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 retries:\n try:\n self.git = Repo.init()\n except GitCommandNotFound:\n retries -= 1\n continue\n break\n\n self.git.index.add([self.CODE])\n self.git.index.commit(\"add 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/tests/basic_env.py_TestGitSubmoduleFixture_TestDvcGitInitializedFixture.setUp.self_git_init_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py_TestGitSubmoduleFixture_TestDvcGitInitializedFixture.setUp.self_git_init_", "embedding": null, "metadata": {"file_path": "tests/basic_env.py", "file_name": "basic_env.py", "file_type": "text/x-python", "category": "implementation", "start_line": 122, "end_line": 151, "span_ids": ["TestGitSubmoduleFixture.__init__", "TestDvcFixture.__init__", "TestDvcGitInitializedFixture", "TestDvcFixture.setUp", "TestGitSubmoduleFixture.setUp", "TestGitSubmoduleFixture", "TestDvcFixture", "TestDvcGitInitializedFixture.setUp", "TestDvcGitInitializedFixture.__init__"], "tokens": 240}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestGitSubmoduleFixture(TestGitFixture):\n def __init__(self, root_dir=None):\n super(TestGitSubmoduleFixture, self).__init__(root_dir)\n\n def setUp(self):\n super(TestGitSubmoduleFixture, self).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(TestGitFixture):\n def __init__(self, root_dir=None):\n super(TestDvcFixture, self).__init__(root_dir)\n\n def setUp(self):\n super(TestDvcFixture, self).setUp()\n self.dvc = DvcRepo.init(self._root_dir)\n self.dvc.scm.commit(\"init dvc\")\n logger.be_verbose()\n\n\nclass TestDvcGitInitializedFixture(TestDvcFixture):\n def __init__(self, root_dir=None):\n super(TestDvcGitInitializedFixture, self).__init__(root_dir)\n\n def setUp(self):\n super(TestDvcGitInitializedFixture, self).setUp()\n self.git.init()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_TestDvcDataFileFixture_TestDvcDataFileFixture.setUp.self_git_index_commit_He": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py_TestDvcDataFileFixture_TestDvcDataFileFixture.setUp.self_git_index_commit_He", "embedding": null, "metadata": {"file_path": "tests/basic_env.py", "file_name": "basic_env.py", "file_type": "text/x-python", "category": "implementation", "start_line": 154, "end_line": 193, "span_ids": ["TestDvcDataFileFixture.__init__", "TestDvcDataFileFixture.setUp", "TestDvcDataFileFixture"], "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 TestDvcDataFileFixture(TestDvcGitInitializedFixture):\n DATA_DVC_FILE = \"data.dvc\"\n DATA_DIR_DVC_FILE = \"data_sub_dir.dvc\"\n REMOTE = \"myremote2\"\n\n def __init__(self, root_dir=None, cache_dir=None):\n super(TestDvcDataFileFixture, self).__init__(root_dir)\n self.cache_dir = cache_dir\n\n def setUp(self):\n super(TestDvcDataFileFixture, self).setUp()\n\n self.dvc.add(self.DATA)\n self.dvc.add(self.DATA_SUB_DIR)\n\n if self.cache_dir:\n shutil.copytree(self.dvc.cache.local.cache_dir, self.cache_dir)\n\n class MockConfig:\n system = None\n glob = None\n local = None\n default = True\n name = self.REMOTE\n url = self.cache_dir\n\n cmd = CmdRemoteAdd(MockConfig())\n cmd.run()\n\n self.git.index.add(\n [\n os.path.join(self.DATA_DIR, self.DATA_DVC_FILE),\n os.path.join(self.DATA_DIR, self.DATA_DIR_DVC_FILE),\n os.path.join(self.DATA_DIR, \".gitignore\"),\n \".dvc/config\",\n self.FOO,\n self.BAR,\n ]\n )\n self.git.index.commit(\"Hello world commit\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py__NOTE_Inheritance_order_TestDvc.__init__.TestCase___init___self_m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py__NOTE_Inheritance_order_TestDvc.__init__.TestCase___init___self_m", "embedding": null, "metadata": {"file_path": "tests/basic_env.py", "file_name": "basic_env.py", "file_type": "text/x-python", "category": "implementation", "start_line": 196, "end_line": 220, "span_ids": ["TestDvcDataFileFixture.setUp", "TestDvc", "TestGitSubmodule", "TestDir.__init__", "TestGit", "TestGitSubmodule.__init__", "TestDvc.__init__", "TestDir", "TestGit.__init__"], "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": "# NOTE: Inheritance order in the classes below is important.\n\n\nclass TestDir(TestDirFixture, TestCase):\n def __init__(self, methodName, root_dir=None):\n TestDirFixture.__init__(self, root_dir)\n TestCase.__init__(self, methodName)\n\n\nclass TestGit(TestGitFixture, TestCase):\n def __init__(self, methodName, root_dir=None):\n TestGitFixture.__init__(self, root_dir)\n TestCase.__init__(self, methodName)\n\n\nclass TestGitSubmodule(TestGitSubmoduleFixture, TestCase):\n def __init__(self, methodName, root_dir=None):\n TestGitSubmoduleFixture.__init__(self, root_dir)\n TestCase.__init__(self, methodName)\n\n\nclass TestDvc(TestDvcFixture, TestCase):\n def __init__(self, methodName, root_dir=None):\n TestDvcFixture.__init__(self, root_dir)\n TestCase.__init__(self, methodName)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_TestDvcPkg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py_TestDvcPkg_", "embedding": null, "metadata": {"file_path": "tests/basic_env.py", "file_name": "basic_env.py", "file_type": "text/x-python", "category": "implementation", "start_line": 223, "end_line": 237, "span_ids": ["TestDvcPkg.__init__", "TestDvcPkg"], "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 TestDvcPkg(TestDvcFixture, TestCase):\n GIT_PKG = \"git_pkg\"\n CACHE_DIR = \"mycache\"\n\n def __init__(self, methodName, root_dir=None):\n TestDvcFixture.__init__(self, root_dir)\n TestCase.__init__(self, methodName)\n\n self.pkg_dir = os.path.join(self._root_dir, self.GIT_PKG)\n cache_dir = os.path.join(self._root_dir, self.CACHE_DIR)\n self.pkg_fixture = TestDvcDataFileFixture(\n root_dir=self.pkg_dir, cache_dir=cache_dir\n )\n self.pkg_fixture.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/tests/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/test_add.py_TestAddFilename_TestAddFilename.test.None_10", "embedding": null, "metadata": {"file_path": "tests/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 433, "end_line": 458, "span_ids": ["TestAddFilename", "TestAddFilename.test"], "tokens": 251}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestAddFilename(TestDvc):\n def test(self):\n ret = main([\"add\", self.FOO, self.BAR, \"-f\", \"error.dvc\"])\n self.assertNotEqual(0, ret)\n\n ret = main([\"add\", \"-R\", self.DATA_DIR, \"-f\", \"error.dvc\"])\n self.assertNotEqual(0, ret)\n\n with self.assertRaises(RecursiveAddingWhileUsingFilename):\n self.dvc.add(self.DATA_DIR, recursive=True, fname=\"error.dvc\")\n\n ret = main([\"add\", self.DATA_DIR, \"-f\", \"data_directory.dvc\"])\n self.assertEqual(0, ret)\n self.assertTrue(os.path.exists(\"data_directory.dvc\"))\n\n ret = main([\"add\", self.FOO, \"-f\", \"bar.dvc\"])\n self.assertEqual(0, ret)\n self.assertTrue(os.path.exists(\"bar.dvc\"))\n self.assertFalse(os.path.exists(\"foo.dvc\"))\n\n os.remove(\"bar.dvc\")\n\n ret = main([\"add\", self.FOO, \"--file\", \"bar.dvc\"])\n self.assertEqual(0, ret)\n self.assertTrue(os.path.exists(\"bar.dvc\"))\n self.assertFalse(os.path.exists(\"foo.dvc\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestShouldCleanUpAfterFailedAdd_TestShouldCleanUpAfterFailedAdd.test.self_assertNotIn_se": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestShouldCleanUpAfterFailedAdd_TestShouldCleanUpAfterFailedAdd.test.self_assertNotIn_se", "embedding": null, "metadata": {"file_path": "tests/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 461, "end_line": 478, "span_ids": ["TestShouldCleanUpAfterFailedAdd.test", "TestShouldCleanUpAfterFailedAdd"], "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 TestShouldCleanUpAfterFailedAdd(TestDvc):\n def test(self):\n ret = main([\"add\", self.FOO])\n self.assertEqual(0, ret)\n\n foo_stage_file = self.FOO + Stage.STAGE_FILE_SUFFIX\n # corrupt stage file\n with open(foo_stage_file, \"a+\") as file:\n file.write(\"this will break yaml file structure\")\n\n ret = main([\"add\", self.BAR])\n self.assertEqual(1, ret)\n\n bar_stage_file = self.BAR + Stage.STAGE_FILE_SUFFIX\n self.assertFalse(os.path.exists(bar_stage_file))\n\n gitignore_content = get_gitignore_content()\n self.assertNotIn(\"/\" + self.BAR, 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/test_add.py_TestShouldNotTrackGitInternalFiles_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_add.py_TestShouldNotTrackGitInternalFiles_", "embedding": null, "metadata": {"file_path": "tests/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 481, "end_line": 492, "span_ids": ["TestShouldNotTrackGitInternalFiles.test", "TestShouldNotTrackGitInternalFiles"], "tokens": 112}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShouldNotTrackGitInternalFiles(TestDvc):\n def test(self):\n stage_creator_spy = spy(dvc.repo.add._create_stages)\n\n with patch.object(dvc.repo.add, \"_create_stages\", stage_creator_spy):\n ret = main([\"add\", \"-R\", self.dvc.root_dir])\n self.assertEqual(0, ret)\n\n created_stages_filenames = stage_creator_spy.mock.call_args[0][0]\n for fname in created_stages_filenames:\n self.assertNotIn(\".git\", 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/test_analytics.py_os_TestAnalytics.test_send.self_assertTrue_mockpost_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_analytics.py_os_TestAnalytics.test_send.self_assertTrue_mockpost_", "embedding": null, "metadata": {"file_path": "tests/test_analytics.py", "file_name": "test_analytics.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 38, "span_ids": ["TestAnalytics.test_send", "TestAnalytics.test", "imports", "TestAnalytics", "_clean_getenv"], "tokens": 254}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport mock\nimport requests\n\nfrom dvc.main import main\nfrom dvc.analytics import Analytics\nfrom tests.basic_env import TestDvc, TestGit, TestDir\n\n\ndef _clean_getenv(key, default=None):\n \"\"\"\n Remove env vars that affect dvc behavior in tests\n \"\"\"\n if key in [\"DVC_TEST\", \"CI\"]:\n return None\n return os.environ.get(key, default)\n\n\nclass TestAnalytics(TestDir):\n def test(self):\n a = Analytics()\n a.collect()\n self.assertTrue(isinstance(a.info, dict))\n self.assertNotEqual(a.info, {})\n self.assertTrue(a.PARAM_USER_ID in a.info.keys())\n self.assertTrue(a.PARAM_SYSTEM_INFO in a.info.keys())\n self.assertNotEqual(a.info[a.PARAM_SYSTEM_INFO], {})\n\n @mock.patch.object(os, \"getenv\", new=_clean_getenv)\n @mock.patch(\n \"dvc.analytics.Analytics._is_enabled_config\", return_value=True\n )\n @mock.patch(\"requests.post\")\n def test_send(self, mockpost, _):\n ret = main([\"daemon\", \"analytics\", Analytics().dump(), \"-v\"])\n self.assertEqual(ret, 0)\n\n self.assertTrue(mockpost.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/test_analytics.py_TestAnalytics.test_send_failed_TestAnalytics.test_send_failed.self_assertTrue_mockpost_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_analytics.py_TestAnalytics.test_send_failed_TestAnalytics.test_send_failed.self_assertTrue_mockpost_", "embedding": null, "metadata": {"file_path": "tests/test_analytics.py", "file_name": "test_analytics.py", "file_type": "text/x-python", "category": "test", "start_line": 40, "end_line": 51, "span_ids": ["TestAnalytics.test_send_failed"], "tokens": 112}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestAnalytics(TestDir):\n\n @mock.patch.object(os, \"getenv\", new=_clean_getenv)\n @mock.patch(\n \"dvc.analytics.Analytics._is_enabled_config\", return_value=True\n )\n @mock.patch.object(\n requests, \"post\", side_effect=requests.exceptions.RequestException()\n )\n def test_send_failed(self, mockpost, _):\n ret = main([\"daemon\", \"analytics\", Analytics().dump(), \"-v\"])\n self.assertEqual(ret, 0)\n\n self.assertTrue(mockpost.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/test_checkout.py_os_from_tests_utils_logger_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_checkout.py_os_from_tests_utils_logger_i", "embedding": null, "metadata": {"file_path": "tests/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 28, "span_ids": ["imports"], "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 os\nimport sys\nimport re\n\nimport yaml\nimport shutil\nimport filecmp\nimport collections\n\nfrom dvc.logger import logger\nfrom dvc.main import main\nfrom dvc import progress\nfrom dvc.repo import Repo as DvcRepo\nfrom dvc.system import System\nfrom dvc.utils import walk_files\nfrom tests.basic_env import TestDvc\nfrom tests.test_repro import TestRepro\nfrom dvc.stage import Stage, StageFileBadNameError, StageFileDoesNotExistError\nfrom dvc.remote.local import RemoteLOCAL\nfrom dvc.exceptions import (\n DvcException,\n ConfirmRemoveError,\n TargetNotDirectoryError,\n CheckoutErrorSuggestGit,\n)\n\nfrom mock import patch\nfrom tests.utils.logger import MockLoggerHandlers, ConsoleFontColorsRemover", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/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/test_checkout.py_TestCheckout_TestCheckout._test_checkout.self_assertTrue_filecmp_c", "embedding": null, "metadata": {"file_path": "tests/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 31, "end_line": 54, "span_ids": ["TestCheckout._test_checkout", "TestCheckout.setUp", "TestCheckout.test", "TestCheckout"], "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 TestCheckout(TestRepro):\n def setUp(self):\n super(TestCheckout, self).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/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/test_checkout.py_TestCheckoutCorruptedCacheDir_TestCheckoutCorruptedCacheDir.test.self_assertFalse_os_path_", "embedding": null, "metadata": {"file_path": "tests/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 81, "end_line": 104, "span_ids": ["TestCheckoutCorruptedCacheDir.test", "TestCheckoutCorruptedCacheDir"], "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 TestCheckoutCorruptedCacheDir(TestDvc):\n def test(self):\n # NOTE: using 'copy' so that cache and link don't have same inode\n ret = main([\"config\", \"cache.type\", \"copy\"])\n self.assertEqual(ret, 0)\n\n self.dvc = DvcRepo(\".\")\n stages = self.dvc.add(self.DATA_DIR)\n self.assertEqual(len(stages), 1)\n self.assertEqual(len(stages[0].outs), 1)\n out = stages[0].outs[0]\n\n # NOTE: modifying cache file for one of the files inside the directory\n # to check if dvc will detect that the cache is corrupted.\n entry = self.dvc.cache.local.load_dir_cache(out.checksum)[0]\n checksum = entry[self.dvc.cache.local.PARAM_CHECKSUM]\n cache = self.dvc.cache.local.get(checksum)\n\n with open(cache, \"w+\") as fobj:\n fobj.write(\"1\")\n\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/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/test_checkout.py_TestCmdCheckout_CheckoutBase.outs_info.return._", "embedding": null, "metadata": {"file_path": "tests/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 107, "end_line": 140, "span_ids": ["TestCmdCheckout", "CheckoutBase", "CheckoutBase.outs_info", "CheckoutBase.commit_data_file", "TestCmdCheckout.test", "CheckoutBase.read_ignored"], "tokens": 240}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCmdCheckout(TestCheckout):\n def test(self):\n ret = main([\"checkout\", \"--force\"])\n self.assertEqual(ret, 0)\n self._test_checkout()\n\n\nclass CheckoutBase(TestDvc):\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 return list(\n map(lambda s: s.strip(\"\\n\"), open(self.GIT_IGNORE).readlines())\n )\n\n def outs_info(self, stage):\n FileInfo = collections.namedtuple(\"FileInfo\", \"path inode\")\n\n paths = [\n path for output in stage.outs for path in 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/test_checkout.py_TestCheckoutSuggestGit_TestCheckoutSuggestGit.test.None_1.except_DvcException_as_ex.self_assertIsNone_exc_cau": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_checkout.py_TestCheckoutSuggestGit_TestCheckoutSuggestGit.test.None_1.except_DvcException_as_ex.self_assertIsNone_exc_cau", "embedding": null, "metadata": {"file_path": "tests/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 383, "end_line": 398, "span_ids": ["TestCheckoutSuggestGit", "TestCheckoutSuggestGit.test"], "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 TestCheckoutSuggestGit(TestRepro):\n def test(self):\n\n try:\n self.dvc.checkout(target=\"gitbranch\")\n except DvcException as exc:\n self.assertIsInstance(exc, CheckoutErrorSuggestGit)\n self.assertIsInstance(exc.cause, StageFileDoesNotExistError)\n self.assertIsNone(exc.cause.cause)\n\n try:\n self.dvc.checkout(target=self.FOO)\n except DvcException as exc:\n self.assertIsInstance(exc, CheckoutErrorSuggestGit)\n self.assertIsInstance(exc.cause, StageFileBadNameError)\n self.assertIsNone(exc.cause.cause)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_checkout.py_TestCheckoutShouldHaveSelfClearingProgressBar_TestCheckoutShouldHaveSelfClearingProgressBar.test.self_assertTrue_finish_ba": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_checkout.py_TestCheckoutShouldHaveSelfClearingProgressBar_TestCheckoutShouldHaveSelfClearingProgressBar.test.self_assertTrue_finish_ba", "embedding": null, "metadata": {"file_path": "tests/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 401, "end_line": 432, "span_ids": ["TestCheckoutShouldHaveSelfClearingProgressBar.setUp", "TestCheckoutShouldHaveSelfClearingProgressBar.test", "TestCheckoutShouldHaveSelfClearingProgressBar"], "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 TestCheckoutShouldHaveSelfClearingProgressBar(TestDvc):\n def setUp(self):\n super(TestCheckoutShouldHaveSelfClearingProgressBar, self).setUp()\n self._prepare_repo()\n\n def test(self):\n self._checkout_and_intercept_std_output()\n\n stdout_calls = self.stdout_mock.method_calls\n write_calls = self.filter_out_non_write_calls(stdout_calls)\n write_calls = self.filter_out_empty_write_calls(write_calls)\n self.write_args = [w_c[1][0] for w_c in write_calls]\n\n progress_bars = self.get_progress_bars()\n update_bars = progress_bars[:-1]\n finish_bar = progress_bars[-1]\n\n self.assertEqual(4, len(update_bars))\n self.assertRegexpMatches(progress_bars[0], \".*\\\\[#{7} {23}\\\\] 25%.*\")\n self.assertRegexpMatches(progress_bars[1], \".*\\\\[#{15} {15}\\\\] 50%.*\")\n self.assertRegexpMatches(progress_bars[2], \".*\\\\[#{22} {8}\\\\] 75%.*\")\n self.assertRegexpMatches(progress_bars[3], \".*\\\\[#{30}\\\\] 100%.*\")\n\n self.assertCaretReturnFollowsEach(update_bars)\n self.assertNewLineFollows(finish_bar)\n\n self.assertAnyEndsWith(update_bars, self.FOO)\n self.assertAnyEndsWith(update_bars, self.BAR)\n self.assertAnyEndsWith(update_bars, self.DATA)\n self.assertAnyEndsWith(update_bars, self.DATA_SUB)\n\n self.assertTrue(finish_bar.endswith(\"Checkout finished!\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_checkout.py_TestCheckoutShouldHaveSelfClearingProgressBar.filter_out_empty_write_calls_TestCheckoutShouldHaveSelfClearingProgressBar._prepare_repo.os_unlink_self_BAR_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_checkout.py_TestCheckoutShouldHaveSelfClearingProgressBar.filter_out_empty_write_calls_TestCheckoutShouldHaveSelfClearingProgressBar._prepare_repo.os_unlink_self_BAR_", "embedding": null, "metadata": {"file_path": "tests/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 434, "end_line": 467, "span_ids": ["TestCheckoutShouldHaveSelfClearingProgressBar.filter_out_non_write_calls", "TestCheckoutShouldHaveSelfClearingProgressBar._prepare_repo", "TestCheckoutShouldHaveSelfClearingProgressBar.filter_out_empty_write_calls"], "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 TestCheckoutShouldHaveSelfClearingProgressBar(TestDvc):\n\n def filter_out_empty_write_calls(self, calls):\n def is_not_empty_write(call):\n assert call[0] == \"write\"\n return call[1][0] != \"\"\n\n return list(filter(is_not_empty_write, calls))\n\n def filter_out_non_write_calls(self, calls):\n def is_write_call(call):\n return call[0] == \"write\"\n\n return list(filter(is_write_call, calls))\n\n def _prepare_repo(self):\n storage = self.mkdtemp()\n\n ret = main([\"remote\", \"add\", \"-d\", \"myremote\", storage])\n self.assertEqual(0, ret)\n\n ret = main([\"add\", self.DATA_DIR])\n self.assertEqual(0, ret)\n\n ret = main([\"add\", self.FOO])\n self.assertEqual(0, ret)\n\n ret = main([\"add\", self.BAR])\n self.assertEqual(0, ret)\n\n ret = main([\"push\"])\n self.assertEqual(0, ret)\n\n shutil.rmtree(self.DATA_DIR)\n os.unlink(self.FOO)\n os.unlink(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/test_checkout.py_TestCheckoutShouldHaveSelfClearingProgressBar._checkout_and_intercept_std_output_TestCheckoutShouldHaveSelfClearingProgressBar.assertAnyEndsWith.self_assertTrue_any_ub_fo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_checkout.py_TestCheckoutShouldHaveSelfClearingProgressBar._checkout_and_intercept_std_output_TestCheckoutShouldHaveSelfClearingProgressBar.assertAnyEndsWith.self_assertTrue_any_ub_fo", "embedding": null, "metadata": {"file_path": "tests/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 469, "end_line": 503, "span_ids": ["TestCheckoutShouldHaveSelfClearingProgressBar.assertCaretReturnFollowsEach", "TestCheckoutShouldHaveSelfClearingProgressBar._checkout_and_intercept_std_output", "TestCheckoutShouldHaveSelfClearingProgressBar.assertNewLineFollows", "TestCheckoutShouldHaveSelfClearingProgressBar.assertAnyEndsWith", "TestCheckoutShouldHaveSelfClearingProgressBar.get_progress_bars"], "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 TestCheckoutShouldHaveSelfClearingProgressBar(TestDvc):\n\n def _checkout_and_intercept_std_output(self):\n with MockLoggerHandlers(\n logger\n ), ConsoleFontColorsRemover(), patch.object(\n sys, \"stdout\"\n ) as stdout_mock:\n self.stdout_mock = logger.handlers[0].stream = stdout_mock\n\n ret = main([\"checkout\"])\n self.assertEqual(0, ret)\n\n def get_progress_bars(self):\n pattern = re.compile(\".*\\\\[.{30}\\\\].*%.*\")\n return [arg for arg in self.write_args if pattern.match(arg)]\n\n def assertCaretReturnFollowsEach(self, update_bars):\n for update_bar in update_bars:\n\n self.assertIn(update_bar, self.write_args)\n\n for index, arg in enumerate(self.write_args):\n if arg == update_bar:\n self.assertEqual(\n progress.CLEARLINE_PATTERN, self.write_args[index + 1]\n )\n\n def assertNewLineFollows(self, finish_bar):\n self.assertIn(finish_bar, self.write_args)\n\n for index, arg in enumerate(self.write_args):\n if arg == finish_bar:\n self.assertEqual(\"\\n\", self.write_args[index + 1])\n\n def assertAnyEndsWith(self, update_bars, name):\n self.assertTrue(any(ub for ub in update_bars if ub.endswith(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/test_checkout.py_TestCheckoutTargetRecursiveShouldNotRemoveOtherUsedFiles_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_checkout.py_TestCheckoutTargetRecursiveShouldNotRemoveOtherUsedFiles_", "embedding": null, "metadata": {"file_path": "tests/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 506, "end_line": 525, "span_ids": ["TestCheckoutTargetRecursiveShouldNotRemoveOtherUsedFiles", "TestCheckoutRecursiveNotDirectory", "TestCheckoutRecursiveNotDirectory.test", "TestCheckoutTargetRecursiveShouldNotRemoveOtherUsedFiles.test"], "tokens": 146}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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 with self.assertRaises(TargetNotDirectoryError):\n self.dvc.checkout(target=self.FOO, 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/test_data_cloud.py_TestCheckSumRecalculation_TestCheckSumRecalculation.test.self_assertEqual_test_col": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestCheckSumRecalculation_TestCheckSumRecalculation.test.self_assertEqual_test_col", "embedding": null, "metadata": {"file_path": "tests/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 738, "end_line": 753, "span_ids": ["TestCheckSumRecalculation", "TestCheckSumRecalculation.test"], "tokens": 165}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCheckSumRecalculation(TestDvc):\n def test(self):\n test_collect = spy(State._collect)\n with patch.object(State, \"_collect\", test_collect):\n url = get_local_url()\n ret = main([\"remote\", \"add\", \"-d\", TEST_REMOTE, url])\n self.assertEqual(ret, 0)\n ret = main([\"config\", \"cache.type\", \"hardlink\"])\n self.assertEqual(ret, 0)\n ret = main([\"add\", self.FOO])\n self.assertEqual(ret, 0)\n ret = main([\"push\"])\n self.assertEqual(ret, 0)\n ret = main([\"run\", \"-d\", self.FOO, \"echo foo\"])\n self.assertEqual(ret, 0)\n self.assertEqual(test_collect.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/test_data_cloud.py_TestShouldWarnOnNoChecksumInLocalAndRemoteCache_TestShouldWarnOnNoChecksumInLocalAndRemoteCache.setUp.self.message_foo_part._nname_md5_n_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestShouldWarnOnNoChecksumInLocalAndRemoteCache_TestShouldWarnOnNoChecksumInLocalAndRemoteCache.setUp.self.message_foo_part._nname_md5_n_f", "embedding": null, "metadata": {"file_path": "tests/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 756, "end_line": 784, "span_ids": ["TestShouldWarnOnNoChecksumInLocalAndRemoteCache", "TestShouldWarnOnNoChecksumInLocalAndRemoteCache.setUp"], "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 TestShouldWarnOnNoChecksumInLocalAndRemoteCache(TestDvc):\n def setUp(self):\n super(TestShouldWarnOnNoChecksumInLocalAndRemoteCache, self).setUp()\n\n cache_dir = self.mkdtemp()\n ret = main([\"add\", self.FOO])\n self.assertEqual(0, ret)\n\n ret = main([\"add\", self.BAR])\n self.assertEqual(0, ret)\n\n # purge cache\n shutil.rmtree(self.dvc.cache.local.cache_dir)\n\n ret = main([\"remote\", \"add\", \"remote_name\", \"-d\", cache_dir])\n self.assertEqual(0, ret)\n\n checksum_foo = file_md5(self.FOO)[0]\n checksum_bar = file_md5(self.BAR)[0]\n self.message_header = (\n \"Some of the cache files do not exist neither locally \"\n \"nor on remote. Missing cache files: \\n\"\n )\n self.message_bar_part = \"\\nname: {}, md5: {}\\n\".format(\n self.BAR, checksum_bar\n )\n self.message_foo_part = \"\\nname: {}, md5: {}\\n\".format(\n self.FOO, checksum_foo\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestShouldWarnOnNoChecksumInLocalAndRemoteCache.stderr_contains_message_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_data_cloud.py_TestShouldWarnOnNoChecksumInLocalAndRemoteCache.stderr_contains_message_", "embedding": null, "metadata": {"file_path": "tests/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 786, "end_line": 813, "span_ids": ["TestShouldWarnOnNoChecksumInLocalAndRemoteCache.stderr_contains_message", "TestShouldWarnOnNoChecksumInLocalAndRemoteCache.test"], "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 TestShouldWarnOnNoChecksumInLocalAndRemoteCache(TestDvc):\n\n def stderr_contains_message(self):\n self.assertIn(\n self.message_header, logger.handlers[1].stream.getvalue()\n )\n self.assertIn(\n self.message_foo_part, logger.handlers[1].stream.getvalue()\n )\n self.assertIn(\n self.message_bar_part, logger.handlers[1].stream.getvalue()\n )\n\n def test(self):\n with ConsoleFontColorsRemover(), MockLoggerHandlers(logger):\n reset_logger_error_output()\n\n main([\"push\"])\n self.stderr_contains_message()\n\n reset_logger_error_output()\n\n main([\"pull\"])\n self.stderr_contains_message()\n\n reset_logger_error_output()\n\n main([\"status\", \"-c\"])\n self.stderr_contains_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/test_import.py_dvc_TestDefaultOutput.test.self_assertEqual_open_fil": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_import.py_dvc_TestDefaultOutput.test.self_assertEqual_open_fil", "embedding": null, "metadata": {"file_path": "tests/test_import.py", "file_name": "test_import.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 45, "span_ids": ["TestDefaultOutput.test", "TestCmdImport.test", "imports", "TestDefaultOutput", "TestCmdImport", "TestCmdImport.test_unsupported"], "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 dvc\n\nfrom dvc.utils.compat import str\n\nimport os\nfrom uuid import uuid4\n\nfrom dvc import logger\nfrom dvc.utils.compat import urljoin\nfrom dvc.exceptions import DvcException\nfrom dvc.main import main\nfrom mock import patch, mock_open, call\nfrom tests.basic_env import TestDvc\nfrom tests.utils import reset_logger_error_output, spy\nfrom tests.utils.httpd import StaticFileServer\nfrom tests.utils.logger import MockLoggerHandlers, ConsoleFontColorsRemover\n\n\nclass TestCmdImport(TestDvc):\n def test(self):\n ret = main([\"import\", self.FOO, \"import\"])\n self.assertEqual(ret, 0)\n self.assertTrue(os.path.exists(\"import.dvc\"))\n\n ret = main([\"import\", \"non-existing-file\", \"import\"])\n self.assertNotEqual(ret, 0)\n\n def test_unsupported(self):\n ret = main([\"import\", \"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\", tmpfile])\n self.assertEqual(ret, 0)\n self.assertTrue(os.path.exists(filename))\n self.assertEqual(open(filename).read(), \"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/test_import.py_TestShouldNotResumeDownload_TestShouldNotResumeDownload.test.m_handle_write_assert_has": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_import.py_TestShouldNotResumeDownload_TestShouldNotResumeDownload.test.m_handle_write_assert_has", "embedding": null, "metadata": {"file_path": "tests/test_import.py", "file_name": "test_import.py", "file_type": "text/x-python", "category": "test", "start_line": 126, "end_line": 141, "span_ids": ["TestShouldNotResumeDownload.test", "TestShouldNotResumeDownload"], "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 TestShouldNotResumeDownload(TestInterruptedDownload):\n @patch(\"dvc.remote.http.RemoteHTTP.CHUNK_SIZE\", 1)\n def test(self):\n with StaticFileServer():\n import_output, import_url, tmp_file_path = (\n self._prepare_interrupted_download()\n )\n\n m = mock_open()\n with patch(\"dvc.remote.http.open\", m):\n result = main([\"import\", import_url, import_output])\n self.assertEqual(result, 0)\n m.assert_called_once_with(tmp_file_path, \"wb\")\n m_handle = m()\n expected_calls = [call(b\"f\"), call(b\"o\"), call(b\"o\")]\n m_handle.write.assert_has_calls(expected_calls, any_order=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/test_import.py_TestShouldRemoveOutsBeforeImport_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_import.py_TestShouldRemoveOutsBeforeImport_", "embedding": null, "metadata": {"file_path": "tests/test_import.py", "file_name": "test_import.py", "file_type": "text/x-python", "category": "test", "start_line": 144, "end_line": 161, "span_ids": ["TestShouldRemoveOutsBeforeImport", "TestShouldRemoveOutsBeforeImport.test", "TestShouldRemoveOutsBeforeImport.setUp"], "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 TestShouldRemoveOutsBeforeImport(TestDvc):\n def setUp(self):\n super(TestShouldRemoveOutsBeforeImport, self).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 remove_outs_call_counter = spy(dvc.stage.Stage.remove_outs)\n with patch.object(\n dvc.stage.Stage, \"remove_outs\", remove_outs_call_counter\n ):\n ret = main([\"import\", self.external_source])\n self.assertEqual(0, ret)\n\n self.assertEqual(1, remove_outs_call_counter.mock.call_count)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py__coding_utf_8__TestMetrics.setUp.self_dvc_scm_checkout_ma": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py__coding_utf_8__TestMetrics.setUp.self_dvc_scm_checkout_ma", "embedding": null, "metadata": {"file_path": "tests/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 58, "span_ids": ["TestMetrics.setUp", "TestMetrics", "docstring"], "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": "# -*- coding: utf-8 -*-\nimport os\nimport json\n\nfrom dvc.repo import Repo as DvcRepo\nfrom dvc.main import main\nfrom dvc.exceptions import DvcException, BadMetricError, NoMetricsError\nfrom tests.basic_env import TestDvc\n\nimport dvc.logger as logger\nfrom tests.utils import reset_logger_error_output, reset_logger_standard_output\nfrom tests.utils.logger import MockLoggerHandlers\n\n\nclass TestMetrics(TestDvc):\n def setUp(self):\n super(TestMetrics, self).setUp()\n self.dvc.scm.commit(\"init\")\n\n for branch in [\"foo\", \"bar\", \"baz\"]:\n self.dvc.scm.checkout(branch, create_new=True)\n\n with open(\"metric\", \"w+\") as fd:\n fd.write(branch)\n\n with open(\"metric_json\", \"w+\") as fd:\n json.dump({\"branch\": branch}, fd)\n\n with open(\"metric_csv\", \"w+\") as fd:\n fd.write(branch)\n\n with open(\"metric_hcsv\", \"w+\") as fd:\n fd.write(\"branch\\n\")\n fd.write(branch)\n\n with open(\"metric_tsv\", \"w+\") as fd:\n fd.write(branch)\n\n with open(\"metric_htsv\", \"w+\") as fd:\n fd.write(\"branch\\n\")\n fd.write(branch)\n\n files = [\n \"metric\",\n \"metric_json\",\n \"metric_tsv\",\n \"metric_htsv\",\n \"metric_csv\",\n \"metric_hcsv\",\n ]\n\n self.dvc.run(metrics_no_cache=files, overwrite=True)\n\n self.dvc.scm.add(files + [\"metric.dvc\"])\n\n self.dvc.scm.commit(\"metric\")\n\n self.dvc.scm.checkout(\"master\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetrics.test_formatted_output_TestMetrics.test_formatted_output.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetrics.test_formatted_output_TestMetrics.test_formatted_output.None_3", "embedding": null, "metadata": {"file_path": "tests/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 171, "end_line": 226, "span_ids": ["TestMetrics.test_formatted_output"], "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 TestMetrics(TestDvc):\n\n def test_formatted_output(self):\n with open(\"metrics.csv\", \"w\") as fobj:\n # Labels are in Spanish to test unicode characters\n fobj.write(\n \"valor_mse,desviaci\u00f3n_mse,data_set\\n\"\n \"0.421601,0.173461,entrenamiento\\n\"\n \"0.67528,0.289545,pruebas\\n\"\n \"0.671502,0.297848,validaci\u00f3n\\n\"\n )\n\n with open(\"metrics.tsv\", \"w\") as fobj:\n # Contains quoted newlines to test output correctness\n fobj.write(\n \"value_mse\\tdeviation_mse\\tdata_set\\n\"\n \"0.421601\\t0.173461\\ttrain\\n\"\n '0.67528\\t0.289545\\t\"test\\\\ning\"\\n'\n \"0.671502\\t0.297848\\tvalidation\\n\"\n )\n\n with open(\"metrics.json\", \"w\") as fobj:\n fobj.write(\n \"{\\n\"\n ' \"data_set\": [\\n'\n ' \"train\",\\n'\n ' \"testing\",\\n'\n ' \"validation\"\\n'\n \" ],\\n\"\n ' \"deviation_mse\": [\\n'\n ' \"0.173461\",\\n'\n ' \"0.289545\",\\n'\n ' \"0.297848\"\\n'\n \" ],\\n\"\n ' \"value_mse\": [\\n'\n ' \"0.421601\",\\n'\n ' \"0.67528\",\\n'\n ' \"0.671502\"\\n'\n \" ]\\n\"\n \"}\"\n )\n\n with open(\"metrics.txt\", \"w\") as fobj:\n fobj.write(\"ROC_AUC: 0.64\\nKS: 78.9999999996\\nF_SCORE: 77\\n\")\n\n self.dvc.run(\n fname=\"testing_metrics_output.dvc\",\n metrics_no_cache=[\n \"metrics.csv\",\n \"metrics.tsv\",\n \"metrics.json\",\n \"metrics.txt\",\n ],\n )\n\n self.dvc.metrics.modify(\"metrics.csv\", typ=\"csv\")\n self.dvc.metrics.modify(\"metrics.tsv\", typ=\"tsv\")\n self.dvc.metrics.modify(\"metrics.json\", typ=\"json\")\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/tests/test_metrics.py_TestMetrics.test_formatted_output.with_MockLoggerHandlers_l_TestMetrics.test_formatted_output.with_MockLoggerHandlers_l.self_assertIn_expected_js": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetrics.test_formatted_output.with_MockLoggerHandlers_l_TestMetrics.test_formatted_output.with_MockLoggerHandlers_l.self_assertIn_expected_js", "embedding": null, "metadata": {"file_path": "tests/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 228, "end_line": 282, "span_ids": ["TestMetrics.test_formatted_output"], "tokens": 552}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestMetrics(TestDvc):\n\n def test_formatted_output(self):\n # ... other code\n\n with MockLoggerHandlers(logger.logger):\n reset_logger_standard_output()\n\n ret = main([\"metrics\", \"show\"])\n self.assertEqual(ret, 0)\n\n expected_csv = (\n u\"\\tmetrics.csv:\\n\"\n u\"\\t\\tvalor_mse desviaci\u00f3n_mse data_set \\n\"\n u\"\\t\\t0.421601 0.173461 entrenamiento \\n\"\n u\"\\t\\t0.67528 0.289545 pruebas \\n\"\n u\"\\t\\t0.671502 0.297848 validaci\u00f3n\"\n )\n\n expected_tsv = (\n \"\\tmetrics.tsv:\\n\"\n \"\\t\\tvalue_mse deviation_mse data_set \\n\"\n \"\\t\\t0.421601 0.173461 train \\n\"\n \"\\t\\t0.67528 0.289545 test\\\\ning \\n\"\n \"\\t\\t0.671502 0.297848 validation\"\n )\n\n expected_txt = (\n \"\\tmetrics.txt:\\n\"\n \"\\t\\tROC_AUC: 0.64\\n\"\n \"\\t\\tKS: 78.9999999996\\n\"\n \"\\t\\tF_SCORE: 77\\n\"\n )\n\n expected_json = (\n \"\\tmetrics.json:\\n\"\n \"\\t\\t{\\n\"\n '\\t\\t \"data_set\": [\\n'\n '\\t\\t \"train\",\\n'\n '\\t\\t \"testing\",\\n'\n '\\t\\t \"validation\"\\n'\n \"\\t\\t ],\\n\"\n '\\t\\t \"deviation_mse\": [\\n'\n '\\t\\t \"0.173461\",\\n'\n '\\t\\t \"0.289545\",\\n'\n '\\t\\t \"0.297848\"\\n'\n \"\\t\\t ],\\n\"\n '\\t\\t \"value_mse\": [\\n'\n '\\t\\t \"0.421601\",\\n'\n '\\t\\t \"0.67528\",\\n'\n '\\t\\t \"0.671502\"\\n'\n \"\\t\\t ]\\n\"\n \"\\t\\t}\"\n )\n\n stdout = logger.logger.handlers[0].stream.getvalue()\n self.assertIn(expected_tsv, stdout)\n self.assertIn(expected_csv, stdout)\n self.assertIn(expected_txt, stdout)\n self.assertIn(expected_json, stdout)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetricsCLI.test_wrong_type_add_TestMetricsCLI.test_wrong_type_add.with_MockLoggerHandlers_l.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetricsCLI.test_wrong_type_add_TestMetricsCLI.test_wrong_type_add.with_MockLoggerHandlers_l.None_6", "embedding": null, "metadata": {"file_path": "tests/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 469, "end_line": 497, "span_ids": ["TestMetricsCLI.test_wrong_type_add"], "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 TestMetricsCLI(TestMetrics):\n\n def test_wrong_type_add(self):\n with open(\"metric.unknown\", \"w+\") as fd:\n fd.write(\"unknown\")\n fd.flush()\n\n ret = main([\"add\", \"metric.unknown\"])\n self.assertEqual(ret, 0)\n\n with MockLoggerHandlers(logger.logger):\n reset_logger_error_output()\n ret = main([\"metrics\", \"add\", \"metric.unknown\", \"-t\", \"unknown\"])\n self.assertEqual(ret, 1)\n self.assertIn(\n \"failed to add metric file 'metric.unknown' - metric type \"\n \"'unknown' is not supported, must be one of \"\n \"[raw, json, csv, tsv, hcsv, htsv]\",\n logger.logger.handlers[1].stream.getvalue(),\n )\n\n ret = main([\"metrics\", \"add\", \"metric.unknown\", \"-t\", \"raw\"])\n self.assertEqual(ret, 0)\n\n reset_logger_standard_output()\n ret = main([\"metrics\", \"show\", \"metric.unknown\"])\n self.assertEqual(ret, 0)\n self.assertIn(\n \"\\tmetric.unknown: unknown\",\n logger.logger.handlers[0].stream.getvalue(),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetricsCLI.test_wrong_type_modify_TestMetricsCLI.test_wrong_type_modify.with_MockLoggerHandlers_l.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_metrics.py_TestMetricsCLI.test_wrong_type_modify_TestMetricsCLI.test_wrong_type_modify.with_MockLoggerHandlers_l.None_6", "embedding": null, "metadata": {"file_path": "tests/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 499, "end_line": 529, "span_ids": ["TestMetricsCLI.test_wrong_type_modify"], "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 TestMetricsCLI(TestMetrics):\n\n def test_wrong_type_modify(self):\n with open(\"metric.unknown\", \"w+\") as fd:\n fd.write(\"unknown\")\n fd.flush()\n\n ret = main([\"run\", \"-m\", \"metric.unknown\"])\n self.assertEqual(ret, 0)\n\n with MockLoggerHandlers(logger.logger):\n reset_logger_error_output()\n ret = main(\n [\"metrics\", \"modify\", \"metric.unknown\", \"-t\", \"unknown\"]\n )\n self.assertEqual(ret, 1)\n self.assertIn(\n \"failed to modify metric file settings - metric type \"\n \"'unknown' is not supported, must be one of \"\n \"[raw, json, csv, tsv, hcsv, htsv]\",\n logger.logger.handlers[1].stream.getvalue(),\n )\n\n ret = main([\"metrics\", \"modify\", \"metric.unknown\", \"-t\", \"CSV\"])\n self.assertEqual(ret, 0)\n\n reset_logger_standard_output()\n ret = main([\"metrics\", \"show\", \"metric.unknown\"])\n self.assertEqual(ret, 0)\n self.assertIn(\n \"\\tmetric.unknown: unknown\",\n logger.logger.handlers[0].stream.getvalue(),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/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/test_move.py_TestMoveFileBetweenDirectories_TestMoveFileBetweenDirectories.test.self_assertEqual_", "embedding": null, "metadata": {"file_path": "tests/test_move.py", "file_name": "test_move.py", "file_type": "text/x-python", "category": "test", "start_line": 146, "end_line": 171, "span_ids": ["TestMoveFileBetweenDirectories.test", "TestMoveFileBetweenDirectories"], "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 TestMoveFileBetweenDirectories(TestDvc):\n def test(self):\n data_stage_file = self.DATA + Stage.STAGE_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 + Stage.STAGE_FILE_SUFFIX\n\n self.assertFalse(os.path.exists(self.DATA))\n self.assertFalse(os.path.exists(data_stage_file))\n\n self.assertTrue(os.path.exists(new_data_path))\n self.assertTrue(os.path.exists(new_data_stage_file))\n\n new_stage_file = load_stage_file(new_data_stage_file)\n self.assertEqual(\n os.path.basename(self.DATA), new_stage_file[\"outs\"][0][\"path\"]\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_move.py_TestMoveFileInsideDirectory_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_move.py_TestMoveFileInsideDirectory_", "embedding": null, "metadata": {"file_path": "tests/test_move.py", "file_name": "test_move.py", "file_type": "text/x-python", "category": "test", "start_line": 174, "end_line": 189, "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/test_pkg.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_pkg.py_os_", "embedding": null, "metadata": {"file_path": "tests/test_pkg.py", "file_name": "test_pkg.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 38, "span_ids": ["TestPkgBasic", "TestPkgBasic.test_target_dir_checkout", "TestPkgBasic.test_installed_dirs_and_files", "imports", "TestPkgBasic.setUp"], "tokens": 297}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nfrom dvc.repo.pkg import Package, PackageParams\nfrom tests.basic_env import TestDvcPkg\n\n\nclass TestPkgBasic(TestDvcPkg):\n NEW_PKG_DIR = \"new_pkg\"\n\n def setUp(self):\n super(TestPkgBasic, self).setUp()\n\n self.to_dir = os.path.join(self._root_dir, self.NEW_PKG_DIR)\n os.mkdir(self.to_dir)\n self.dvc.install_pkg(\n PackageParams(self.pkg_fixture._root_dir, self.to_dir)\n )\n\n def test_installed_dirs_and_files(self):\n self.assertTrue(os.path.isdir(self.pkg_dir))\n\n mod_dir_fullpath = os.path.join(self._root_dir, Package.MODULES_DIR)\n self.assertTrue(os.path.isdir(mod_dir_fullpath))\n\n installed_pkg_dir = os.path.join(mod_dir_fullpath, self.GIT_PKG)\n for file in [self.FOO, self.BAR, self.CODE]:\n installed_file = os.path.join(installed_pkg_dir, file)\n self.assertTrue(os.path.isfile(installed_file))\n\n def test_target_dir_checkout(self):\n pkg_data_file = os.path.join(self.to_dir, self.DATA)\n self.assertTrue(os.path.exists(pkg_data_file))\n self.assertTrue(os.path.isfile(pkg_data_file))\n\n pkg_data_dir = os.path.join(self.to_dir, self.DATA_SUB_DIR)\n self.assertTrue(os.path.exists(pkg_data_dir))\n self.assertTrue(os.path.isdir(pkg_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/test_repo.py_from_tests_basic_env_impo_TestCollect.setUp.self_dvc_scm_checkout_ma": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repo.py_from_tests_basic_env_impo_TestCollect.setUp.self_dvc_scm_checkout_ma", "embedding": null, "metadata": {"file_path": "tests/test_repo.py", "file_name": "test_repo.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 26, "span_ids": ["imports", "TestCollect.setUp", "TestCollect"], "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": "from tests.basic_env import TestDvc\n\nfrom dvc.scm.git import GitTree\nfrom dvc.scm.tree import WorkingTree\n\n\nclass TestCollect(TestDvc):\n def setUp(self):\n super(TestCollect, self).setUp()\n self.dvc.add(self.FOO)\n self.dvc.run(\n deps=[self.FOO],\n outs=[self.BAR],\n cmd=\"python code.py {} {}\".format(self.FOO, self.BAR),\n )\n self.dvc.scm.add([\".gitignore\", self.FOO + \".dvc\", self.BAR + \".dvc\"])\n self.dvc.scm.commit(\"foo.dvc and bar.dvc\")\n self.dvc.scm.checkout(\"new_branch\", True)\n self.dvc.run(\n deps=[self.BAR],\n outs=[\"buzz\"],\n cmd=\"python code.py {} {}\".format(self.BAR, \"buzz\"),\n )\n self.dvc.scm.add([\".gitignore\", \"buzz.dvc\"])\n self.dvc.scm.commit(\"add buzz\")\n self.dvc.scm.checkout(\"master\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repo.py_TestCollect._check_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repo.py_TestCollect._check_", "embedding": null, "metadata": {"file_path": "tests/test_repo.py", "file_name": "test_repo.py", "file_type": "text/x-python", "category": "test", "start_line": 28, "end_line": 47, "span_ids": ["TestCollect._check", "TestCollect.test"], "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": "class TestCollect(TestDvc):\n\n def _check(self, branch, target, with_deps, expected):\n if branch:\n self.dvc.tree = GitTree(self.dvc.scm.git, branch)\n else:\n self.dvc.tree = WorkingTree()\n result = self.dvc.collect(target + \".dvc\", with_deps=with_deps)\n self.assertEqual(\n [[j.rel_path for j in i.outs] for i in result], expected\n )\n return result\n\n def test(self):\n self._check(\"\", self.BAR, True, [[self.FOO], [self.BAR]])\n self._check(\"master\", self.BAR, True, [[self.FOO], [self.BAR]])\n self._check(\n \"new_branch\", \"buzz\", True, [[self.FOO], [self.BAR], [\"buzz\"]]\n )\n result = self._check(\"new_branch\", \"buzz\", False, [[\"buzz\"]])\n self.assertEqual([i.rel_path for i in result[0].deps], [\"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/test_repro.py_from_dvc_logger_import_lo_from_tests_utils_logger_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_from_dvc_logger_import_lo_from_tests_utils_logger_i", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 39, "span_ids": ["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": "from dvc.logger import logger\nfrom dvc.utils.compat import str\n\nimport os\nimport yaml\nimport shutil\nimport filecmp\nimport getpass\nimport posixpath\nfrom subprocess import Popen, PIPE\n\nimport boto3\nimport uuid\nimport paramiko\nfrom google.cloud import storage as gc\nfrom flaky.flaky_decorator import flaky\n\nfrom dvc.main import main\nfrom dvc.repo import Repo as DvcRepo\nfrom dvc.utils import file_md5\nfrom dvc.utils.compat import urljoin\nfrom dvc.remote.local import RemoteLOCAL\nfrom dvc.stage import Stage, StageFileDoesNotExistError\nfrom dvc.system import System\nfrom dvc.output.base import OutputBase\nfrom dvc.exceptions import (\n CyclicGraphError,\n StagePathAsOutputError,\n ReproductionError,\n)\n\nfrom tests.basic_env import TestDvc\nfrom tests.test_data_cloud import _should_test_aws, TEST_AWS_REPO_BUCKET\nfrom tests.test_data_cloud import _should_test_gcp, TEST_GCP_REPO_BUCKET\nfrom tests.test_data_cloud import _should_test_ssh, _should_test_hdfs\nfrom tests.utils import reset_logger_standard_output\nfrom tests.utils.httpd import StaticFileServer\nfrom mock import patch\nfrom tests.utils.logger import MockLoggerHandlers", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/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/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/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1357, "end_line": 1380, "span_ids": ["TestReproAlreadyCached.test_force_import"], "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 TestReproAlreadyCached(TestRepro):\n\n def test_force_import(self):\n ret = main([\"import\", self.FOO, self.BAR])\n self.assertEqual(ret, 0)\n\n patch_download = patch.object(\n RemoteLOCAL,\n \"download\",\n side_effect=RemoteLOCAL.download,\n autospec=True,\n )\n\n patch_checkout = patch.object(\n OutputBase,\n \"checkout\",\n side_effect=OutputBase.checkout,\n autospec=True,\n )\n\n with patch_download as mock_download:\n with patch_checkout as mock_checkout:\n 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/test_repro.py_TestShouldDisplayMetricsOnReproWithMetricsOption_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_repro.py_TestShouldDisplayMetricsOnReproWithMetricsOption_", "embedding": null, "metadata": {"file_path": "tests/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1383, "end_line": 1415, "span_ids": ["TestShouldDisplayMetricsOnReproWithMetricsOption", "TestShouldDisplayMetricsOnReproWithMetricsOption.test"], "tokens": 176}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShouldDisplayMetricsOnReproWithMetricsOption(TestDvc):\n def test(self):\n metrics_file = \"metrics_file\"\n metrics_value = 0.123489015\n ret = main(\n [\n \"run\",\n \"-m\",\n metrics_file,\n \"echo {} >> {}\".format(metrics_value, metrics_file),\n ]\n )\n self.assertEqual(0, ret)\n\n with MockLoggerHandlers(logger):\n reset_logger_standard_output()\n ret = main(\n [\n \"repro\",\n \"--force\",\n \"--metrics\",\n metrics_file + Stage.STAGE_FILE_SUFFIX,\n ]\n )\n self.assertEqual(0, ret)\n\n expected_metrics_display = \"{}: {}\".format(\n metrics_file, metrics_value\n )\n self.assertIn(\n expected_metrics_display, logger.handlers[0].stream.getvalue()\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunCommit_TestRunCommit.test.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunCommit_TestRunCommit.test.None_5", "embedding": null, "metadata": {"file_path": "tests/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 752, "end_line": 765, "span_ids": ["TestRunCommit", "TestRunCommit.test"], "tokens": 128}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRunCommit(TestDvc):\n def test(self):\n fname = \"test\"\n ret = main(\n [\"run\", \"-o\", fname, \"--no-commit\", \"echo\", \"test\", \">\", fname]\n )\n self.assertEqual(ret, 0)\n self.assertTrue(os.path.isfile(fname))\n self.assertEqual(len(os.listdir(self.dvc.cache.local.cache_dir)), 0)\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/test_run.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/test_run.py_TestRunPersist_TestRunPersist.should_remove_persistent_outs.self_assertFalse_os_path_", "embedding": null, "metadata": {"file_path": "tests/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 768, "end_line": 814, "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": 307}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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 + Stage.STAGE_FILE_SUFFIX\n\n self.run_command(file, file_content)\n self.stage_should_contain_persist_flag(stage_file)\n\n self.should_append_upon_repro(file, stage_file)\n\n self.should_remove_persistent_outs(file, stage_file)\n\n def run_command(self, file, file_content):\n ret = main(\n [\n \"run\",\n self.outs_command,\n file,\n \"echo {} >> {}\".format(file_content, file),\n ]\n )\n self.assertEqual(0, ret)\n\n def stage_should_contain_persist_flag(self, stage_file):\n stage_file_content = load_stage_file(stage_file)\n self.assertEqual(\n True, stage_file_content[\"outs\"][0][OutputBase.PARAM_PERSIST]\n )\n\n def should_append_upon_repro(self, file, stage_file):\n ret = main([\"repro\", stage_file])\n self.assertEqual(0, ret)\n\n with open(file, \"r\") as fobj:\n lines = fobj.readlines()\n self.assertEqual(2, len(lines))\n\n def should_remove_persistent_outs(self, file, stage_file):\n ret = main([\"remove\", stage_file])\n self.assertEqual(0, ret)\n\n self.assertFalse(os.path.exists(file))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunPersistOuts_TestShouldRaiseOnOverlappingOutputPaths.test.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestRunPersistOuts_TestShouldRaiseOnOverlappingOutputPaths.test.None_4", "embedding": null, "metadata": {"file_path": "tests/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 817, "end_line": 861, "span_ids": ["TestRunPersistOutsNoCache.test", "TestRunPersistOuts.outs_command", "TestShouldRaiseOnOverlappingOutputPaths", "TestShouldRaiseOnOverlappingOutputPaths.test", "TestRunPersistOuts.test", "TestRunPersistOuts", "TestRunPersistOutsNoCache", "TestRunPersistOutsNoCache.outs_command"], "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": "class TestRunPersistOuts(TestRunPersist):\n @property\n def outs_command(self):\n return \"--outs-persist\"\n\n def test(self):\n self._test()\n\n\nclass TestRunPersistOutsNoCache(TestRunPersist):\n @property\n def outs_command(self):\n return \"--outs-persist-no-cache\"\n\n def test(self):\n self._test()\n\n\nclass TestShouldRaiseOnOverlappingOutputPaths(TestDvc):\n def test(self):\n ret = main([\"add\", self.DATA_DIR])\n self.assertEqual(0, ret)\n\n with self.assertRaises(OverlappingOutputPathsError) as err:\n self.dvc.run(\n outs=[self.DATA], cmd=\"echo data >> {}\".format(self.DATA)\n )\n error_output = str(err.exception)\n\n data_dir_stage = self.DATA_DIR + Stage.STAGE_FILE_SUFFIX\n data_stage = os.path.basename(self.DATA) + Stage.STAGE_FILE_SUFFIX\n\n self.assertIn(\"Paths for outs:\\n\", error_output)\n self.assertIn(\n \"\\n'{}'('{}')\\n\".format(self.DATA_DIR, data_dir_stage),\n error_output,\n )\n self.assertIn(\n \"\\n'{}'('{}')\\n\".format(self.DATA, data_stage), error_output\n )\n self.assertIn(\n \"\\noverlap. To avoid unpredictable behaviour, rerun \"\n \"command with non overlapping outs paths.\",\n error_output,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.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/test_run.py_TestRerunWithSameOutputs_TestRerunWithSameOutputs._run_twice_with_same_outputs.None_2", "embedding": null, "metadata": {"file_path": "tests/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 864, "end_line": 896, "span_ids": ["TestRerunWithSameOutputs", "TestRerunWithSameOutputs._read_content_only", "TestRerunWithSameOutputs._outs_command", "TestRerunWithSameOutputs._run_twice_with_same_outputs"], "tokens": 207}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRerunWithSameOutputs(TestDvc):\n def _read_content_only(self, path):\n with open(path, \"r\") as fobj:\n return [line.rstrip() for line in fobj]\n\n @property\n def _outs_command(self):\n raise NotImplementedError\n\n def _run_twice_with_same_outputs(self):\n ret = main(\n [\n \"run\",\n \"--outs\",\n self.FOO,\n \"echo {} > {}\".format(self.FOO_CONTENTS, self.FOO),\n ]\n )\n self.assertEqual(0, ret)\n\n output_file_content = self._read_content_only(self.FOO)\n self.assertEqual([self.FOO_CONTENTS], output_file_content)\n\n ret = main(\n [\n \"run\",\n self._outs_command,\n self.FOO,\n \"--overwrite-dvcfile\",\n \"echo {} >> {}\".format(self.BAR_CONTENTS, self.FOO),\n ]\n )\n self.assertEqual(0, ret)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestNewRunShouldRemoveOutsOnNoPersist_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_run.py_TestNewRunShouldRemoveOutsOnNoPersist_", "embedding": null, "metadata": {"file_path": "tests/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 899, "end_line": 923, "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/test_scm.py_from___future___import_un_TestSCM.test_git.self_assertIsInstance_SCM": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_scm.py_from___future___import_un_TestSCM.test_git.self_assertIsInstance_SCM", "embedding": null, "metadata": {"file_path": "tests/test_scm.py", "file_name": "test_scm.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 21, "span_ids": ["TestSCM.test_git", "imports", "TestSCM", "TestSCM.test_none"], "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": "from __future__ import unicode_literals\n\nimport os\n\nfrom git import Repo\n\nfrom dvc.utils.compat import str # noqa: F401\nfrom dvc.scm import SCM, NoSCM, Git\nfrom dvc.scm.base import FileNotInTargetSubdirError\n\nfrom tests.basic_env import TestDir, TestGit, TestGitSubmodule\nfrom tests.utils import get_gitignore_content\n\n\nclass TestSCM(TestDir):\n def test_none(self):\n self.assertIsInstance(SCM(self._root_dir), NoSCM)\n\n def test_git(self):\n Repo.init(os.curdir)\n self.assertIsInstance(SCM(self._root_dir), 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/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/test_scm.py_TestSCMGit_TestSCMGit.test_is_tracked.None_10", "embedding": null, "metadata": {"file_path": "tests/test_scm.py", "file_name": "test_scm.py", "file_type": "text/x-python", "category": "test", "start_line": 24, "end_line": 47, "span_ids": ["TestSCMGit.test_is_repo", "TestSCMGit.test_commit", "TestSCMGit", "TestSCMGit.test_is_tracked"], "tokens": 207}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestSCMGit(TestGit):\n def test_is_repo(self):\n self.assertTrue(Git.is_repo(os.curdir))\n\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.git.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/test_scm.py_TestSCMGitSubmodule_TestIgnore.test_ignore.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_scm.py_TestSCMGitSubmodule_TestIgnore.test_ignore.None_6", "embedding": null, "metadata": {"file_path": "tests/test_scm.py", "file_name": "test_scm.py", "file_type": "text/x-python", "category": "test", "start_line": 50, "end_line": 81, "span_ids": ["TestIgnore._count_gitignore", "TestSCMGitSubmodule.test_git_submodule", "TestSCMGitSubmodule.test_commit_in_submodule", "TestIgnore.test_ignore", "TestIgnore", "TestSCMGitSubmodule", "TestSCMGitSubmodule.test_is_submodule"], "tokens": 228}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestSCMGitSubmodule(TestGitSubmodule):\n def test_git_submodule(self):\n self.assertIsInstance(SCM(os.curdir), Git)\n\n def test_is_submodule(self):\n self.assertTrue(Git.is_submodule(os.curdir))\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\nclass TestIgnore(TestGit):\n def _count_gitignore(self):\n lines = get_gitignore_content()\n return len([i for i in lines if i == \"/\" + self.FOO])\n\n def test_ignore(self):\n git = Git(self._root_dir)\n foo = os.path.join(self._root_dir, self.FOO)\n\n git.ignore(foo)\n self.assertTrue(os.path.isfile(Git.GITIGNORE))\n self.assertEqual(self._count_gitignore(), 1)\n\n git.ignore(foo)\n self.assertEqual(self._count_gitignore(), 1)\n\n git.ignore_remove(foo)\n self.assertEqual(self._count_gitignore(), 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/test_scm.py_TestIgnore.test_get_gitignore_TestIgnore.test_get_gitignore.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_scm.py_TestIgnore.test_get_gitignore_TestIgnore.test_get_gitignore.None_3", "embedding": null, "metadata": {"file_path": "tests/test_scm.py", "file_name": "test_scm.py", "file_type": "text/x-python", "category": "test", "start_line": 83, "end_line": 96, "span_ids": ["TestIgnore.test_get_gitignore"], "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": "class TestIgnore(TestGit):\n\n def test_get_gitignore(self):\n data_dir = os.path.join(self._root_dir, \"file1\")\n entry, gitignore = Git(self._root_dir)._get_gitignore(data_dir)\n self.assertEqual(entry, \"/file1\")\n self.assertEqual(\n gitignore, os.path.join(self._root_dir, Git.GITIGNORE)\n )\n\n data_dir = os.path.join(self._root_dir, \"dir\")\n entry, gitignore = Git(self._root_dir)._get_gitignore(data_dir)\n self.assertEqual(entry, \"/dir\")\n self.assertEqual(\n gitignore, os.path.join(self._root_dir, Git.GITIGNORE)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_scm.py_TestIgnore.test_get_gitignore_subdir_TestIgnore.test_get_gitignore_subdir.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_scm.py_TestIgnore.test_get_gitignore_subdir_TestIgnore.test_get_gitignore_subdir.None_3", "embedding": null, "metadata": {"file_path": "tests/test_scm.py", "file_name": "test_scm.py", "file_type": "text/x-python", "category": "test", "start_line": 98, "end_line": 111, "span_ids": ["TestIgnore.test_get_gitignore_subdir"], "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 TestIgnore(TestGit):\n\n def test_get_gitignore_subdir(self):\n data_dir = os.path.join(self._root_dir, os.path.join(\"dir1\", \"file1\"))\n entry, gitignore = Git(self._root_dir)._get_gitignore(data_dir)\n self.assertEqual(entry, \"/file1\")\n self.assertEqual(\n gitignore, os.path.join(self._root_dir, \"dir1\", Git.GITIGNORE)\n )\n\n data_dir = os.path.join(self._root_dir, os.path.join(\"dir1\", \"dir2\"))\n entry, gitignore = Git(self._root_dir)._get_gitignore(data_dir)\n self.assertEqual(entry, \"/dir2\")\n self.assertEqual(\n gitignore, os.path.join(self._root_dir, \"dir1\", Git.GITIGNORE)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_scm.py_TestIgnore.test_get_gitignore_ignorefile_dir_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_scm.py_TestIgnore.test_get_gitignore_ignorefile_dir_", "embedding": null, "metadata": {"file_path": "tests/test_scm.py", "file_name": "test_scm.py", "file_type": "text/x-python", "category": "test", "start_line": 113, "end_line": 141, "span_ids": ["TestIgnore.test_get_gitignore_ignorefile_dir_upper_level", "TestIgnore.test_get_gitignore_ignorefile_dir"], "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 TestIgnore(TestGit):\n\n def test_get_gitignore_ignorefile_dir(self):\n git = Git(self._root_dir)\n\n file_double_dir = os.path.join(\"dir1\", \"dir2\", \"file1\")\n data_dir1 = os.path.join(self._root_dir, file_double_dir)\n dir1_real1 = os.path.realpath(\"dir1\")\n entry, gitignore = git._get_gitignore(data_dir1, dir1_real1)\n self.assertEqual(entry, \"/dir2/file1\")\n gitignore1 = os.path.join(self._root_dir, \"dir1\", Git.GITIGNORE)\n self.assertEqual(gitignore, gitignore1)\n\n triple_dir = os.path.join(\"dir1\", \"dir2\", \"dir3\")\n data_dir2 = os.path.join(self._root_dir, triple_dir)\n dir1_real2 = os.path.realpath(\"dir1\")\n entry, gitignore = git._get_gitignore(data_dir2, dir1_real2)\n self.assertEqual(entry, \"/dir2/dir3\")\n gitignore2 = os.path.join(self._root_dir, \"dir1\", Git.GITIGNORE)\n self.assertEqual(gitignore, gitignore2)\n\n def test_get_gitignore_ignorefile_dir_upper_level(self):\n git = Git(self._root_dir)\n\n file_double_dir = os.path.join(\"dir1\", \"dir2\", \"file1\")\n data_dir1 = os.path.join(self._root_dir, file_double_dir)\n ignore_file_dir = os.path.realpath(os.path.join(\"aa\", \"bb\"))\n\n with self.assertRaises(FileNotInTargetSubdirError):\n git._get_gitignore(data_dir1, ignore_file_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/test_state.py_TestStateOverflow_TestStateOverflow.test.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_state.py_TestStateOverflow_TestStateOverflow.test.None_2", "embedding": null, "metadata": {"file_path": "tests/test_state.py", "file_name": "test_state.py", "file_type": "text/x-python", "category": "test", "start_line": 34, "end_line": 48, "span_ids": ["TestStateOverflow.test", "TestStateOverflow"], "tokens": 128}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestStateOverflow(TestDvc):\n def test(self):\n # NOTE: trying to add more entries than state can handle,\n # to see if it will clean up and vacuum successfully\n ret = main([\"config\", \"state.row_limit\", \"10\"])\n self.assertEqual(ret, 0)\n\n dname = \"dir\"\n os.mkdir(dname)\n for i in range(20):\n with open(os.path.join(dname, str(i)), \"w+\") as fobj:\n fobj.write(str(i))\n\n ret = main([\"add\", \"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/test_state.py_TestGetStateRecordForInode_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_state.py_TestGetStateRecordForInode_", "embedding": null, "metadata": {"file_path": "tests/test_state.py", "file_name": "test_state.py", "file_type": "text/x-python", "category": "test", "start_line": 51, "end_line": 75, "span_ids": ["TestGetStateRecordForInode", "TestGetStateRecordForInode.test_transforms_inode", "TestGetStateRecordForInode.mock_get_inode"], "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 TestGetStateRecordForInode(TestDvc):\n @staticmethod\n def mock_get_inode(special_path, special_value):\n def get_inode_mocked(path):\n if path == special_path:\n return special_value\n else:\n return get_inode(path)\n\n return get_inode_mocked\n\n @mock.patch(\"dvc.state.get_inode\", autospec=True)\n def test_transforms_inode(self, get_inode_mock):\n state = State(self.dvc, self.dvc.config.config)\n inode = state.MAX_INT + 2\n self.assertNotEqual(inode, state._to_sqlite(inode))\n\n path = os.path.join(self.dvc.root_dir, self.FOO)\n get_inode_mock.side_effect = self.mock_get_inode(path, inode)\n\n with state:\n state.update(path)\n ret = state.get_state_record_for_inode(inode)\n self.assertIsNotNone(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/test_tag.py_os_TestTag.test.None_12": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_tag.py_os_TestTag.test.None_12", "embedding": null, "metadata": {"file_path": "tests/test_tag.py", "file_name": "test_tag.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 47, "span_ids": ["TestTag", "imports", "TestTag.test"], "tokens": 305}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport shutil\nimport filecmp\n\nfrom dvc.main import main\nfrom dvc.logger import logger\n\nfrom tests.basic_env import TestDvc\n\nfrom tests.utils import reset_logger_standard_output, reset_logger_error_output\nfrom tests.utils.logger import MockLoggerHandlers, ConsoleFontColorsRemover\n\n\nclass TestTag(TestDvc):\n def test(self):\n fname = \"file\"\n shutil.copyfile(self.FOO, fname)\n\n stages = self.dvc.add(fname)\n self.assertEqual(len(stages), 1)\n stage = stages[0]\n self.assertTrue(stage is not None)\n\n ret = main([\"tag\", \"add\", \"v1\", stage.path])\n self.assertEqual(ret, 0)\n\n os.unlink(fname)\n shutil.copyfile(self.BAR, fname)\n\n ret = main([\"repro\", stage.path])\n self.assertEqual(ret, 0)\n\n ret = main([\"tag\", \"add\", \"v2\", stage.path])\n self.assertEqual(ret, 0)\n\n ret = main([\"tag\", \"list\", stage.path])\n self.assertEqual(ret, 0)\n\n ret = main([\"checkout\", stage.path + \"@v1\"])\n self.assertEqual(ret, 0)\n\n self.assertTrue(filecmp.cmp(fname, self.FOO, shallow=False))\n\n ret = main([\"checkout\", stage.path + \"@v2\"])\n self.assertEqual(ret, 0)\n\n self.assertTrue(filecmp.cmp(fname, self.BAR, shallow=False))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_tag.py_TestTagAll_TestTagAll.test.None_2.self_assertEqual_logg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_tag.py_TestTagAll_TestTagAll.test.None_2.self_assertEqual_logg", "embedding": null, "metadata": {"file_path": "tests/test_tag.py", "file_name": "test_tag.py", "file_type": "text/x-python", "category": "test", "start_line": 50, "end_line": 94, "span_ids": ["TestTagAll.test", "TestTagAll"], "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 TestTagAll(TestDvc):\n def test(self):\n ret = main([\"add\", self.FOO, self.BAR])\n self.assertEqual(ret, 0)\n\n with MockLoggerHandlers(logger), ConsoleFontColorsRemover():\n reset_logger_standard_output()\n\n ret = main([\"tag\", \"list\"])\n self.assertEqual(ret, 0)\n\n self.assertEqual(\"\", logger.handlers[0].stream.getvalue())\n\n ret = main([\"tag\", \"add\", \"v1\"])\n self.assertEqual(ret, 0)\n\n with MockLoggerHandlers(logger), ConsoleFontColorsRemover():\n reset_logger_standard_output()\n\n ret = main([\"tag\", \"list\"])\n self.assertEqual(ret, 0)\n\n self.assertEqual(\n logger.handlers[0].stream.getvalue(),\n \"bar.dvc:\\n\"\n \" bar:\\n\"\n \" v1:\\n\"\n \" md5: 8978c98bb5a48c2fb5f2c4c905768afa\\n\"\n \"foo.dvc:\\n\"\n \" foo:\\n\"\n \" v1:\\n\"\n \" md5: acbd18db4cc2f85cedef654fccc4a4d8\\n\"\n \"\\n\",\n )\n\n ret = main([\"tag\", \"remove\", \"v1\"])\n self.assertEqual(ret, 0)\n\n with MockLoggerHandlers(logger), ConsoleFontColorsRemover():\n reset_logger_standard_output()\n\n ret = main([\"tag\", \"list\"])\n self.assertEqual(ret, 0)\n\n self.assertEqual(\"\", logger.handlers[0].stream.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/tests/test_tag.py_TestTagAddNoChecksumInfo_TestTagAddNoChecksumInfo.test.with_MockLoggerHandlers_l.self_assertEqual_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_tag.py_TestTagAddNoChecksumInfo_TestTagAddNoChecksumInfo.test.with_MockLoggerHandlers_l.self_assertEqual_", "embedding": null, "metadata": {"file_path": "tests/test_tag.py", "file_name": "test_tag.py", "file_type": "text/x-python", "category": "test", "start_line": 97, "end_line": 111, "span_ids": ["TestTagAddNoChecksumInfo.test", "TestTagAddNoChecksumInfo"], "tokens": 116}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestTagAddNoChecksumInfo(TestDvc):\n def test(self):\n ret = main([\"run\", \"-o\", self.FOO, \"--no-exec\"])\n self.assertEqual(ret, 0)\n\n with MockLoggerHandlers(logger), ConsoleFontColorsRemover():\n reset_logger_error_output()\n\n ret = main([\"tag\", \"add\", \"v1\", \"foo.dvc\"])\n self.assertEqual(ret, 0)\n\n self.assertEqual(\n \"Warning: missing checksum info for 'foo'\\n\",\n logger.handlers[1].stream.getvalue(),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_tag.py_TestTagRemoveNoTag_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_tag.py_TestTagRemoveNoTag_", "embedding": null, "metadata": {"file_path": "tests/test_tag.py", "file_name": "test_tag.py", "file_type": "text/x-python", "category": "test", "start_line": 114, "end_line": 129, "span_ids": ["TestTagRemoveNoTag.test", "TestTagRemoveNoTag"], "tokens": 112}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestTagRemoveNoTag(TestDvc):\n def test(self):\n ret = main([\"add\", self.FOO])\n self.assertEqual(ret, 0)\n\n with MockLoggerHandlers(logger), ConsoleFontColorsRemover():\n reset_logger_error_output()\n\n ret = main([\"tag\", \"remove\", \"v1\", \"foo.dvc\"])\n self.assertEqual(ret, 0)\n\n self.assertEqual(\n \"Warning: tag 'v1' not found for 'foo'\\n\",\n logger.handlers[1].stream.getvalue(),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_tree.py__encoding_utf_8_TestWorkingTree.test_isfile.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_tree.py__encoding_utf_8_TestWorkingTree.test_isfile.None_2", "embedding": null, "metadata": {"file_path": "tests/test_tree.py", "file_name": "test_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 38, "span_ids": ["TestWorkingTree.test_isdir", "TestWorkingTree.test_open", "TestWorkingTree", "TestWorkingTree.test_exists", "TestWorkingTree.setUp", "docstring", "TestWorkingTree.test_isfile"], "tokens": 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": "# encoding: utf-8\n\nfrom __future__ import unicode_literals\n\nfrom os.path import join\n\nfrom dvc.scm import SCM\nfrom dvc.scm.git import GitTree\nfrom dvc.scm.tree import WorkingTree\n\nfrom tests.basic_env import TestDir, TestGit\n\n\nclass TestWorkingTree(TestDir):\n def setUp(self):\n super(TestWorkingTree, self).setUp()\n self.tree = WorkingTree()\n\n def test_open(self):\n self.assertEqual(self.tree.open(self.FOO).read(), self.FOO_CONTENTS)\n self.assertEqual(\n self.tree.open(self.UNICODE).read(), self.UNICODE_CONTENTS\n )\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/test_tree.py_TestGitTree_TestGitTree.test_isfile.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_tree.py_TestGitTree_TestGitTree.test_isfile.None_4", "embedding": null, "metadata": {"file_path": "tests/test_tree.py", "file_name": "test_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 41, "end_line": 82, "span_ids": ["TestGitTree.test_open", "TestGitTree.setUp", "TestGitTree", "TestGitTree.test_isfile", "TestGitTree.test_exists", "TestGitTree.test_isdir"], "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": "class TestGitTree(TestGit):\n def setUp(self):\n super(TestGitTree, self).setUp()\n self.scm = SCM(self._root_dir)\n self.tree = GitTree(self.git, \"master\")\n\n def test_open(self):\n self.scm.add([self.FOO, self.UNICODE, self.DATA_DIR])\n self.scm.commit(\"add\")\n self.assertEqual(self.tree.open(self.FOO).read(), self.FOO_CONTENTS)\n self.assertEqual(\n self.tree.open(self.UNICODE).read(), self.UNICODE_CONTENTS\n )\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/test_tree.py_AssertWalkEqualMixin_TestWalkInNoSCM.test_subdir.self_assertWalkEqual_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_tree.py_AssertWalkEqualMixin_TestWalkInNoSCM.test_subdir.self_assertWalkEqual_", "embedding": null, "metadata": {"file_path": "tests/test_tree.py", "file_name": "test_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 85, "end_line": 115, "span_ids": ["TestWalkInNoSCM", "AssertWalkEqualMixin", "AssertWalkEqualMixin.assertWalkEqual", "TestWalkInNoSCM.test_subdir", "TestWalkInNoSCM.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 AssertWalkEqualMixin(object):\n def assertWalkEqual(self, actual, expected, msg=None):\n def convert_to_sets(walk_results):\n return [\n (root, set(dirs), set(nondirs))\n for root, dirs, nondirs in walk_results\n ]\n\n self.assertEqual(\n convert_to_sets(actual), convert_to_sets(expected), msg=msg\n )\n\n\nclass TestWalkInNoSCM(AssertWalkEqualMixin, TestDir):\n def test(self):\n tree = WorkingTree()\n self.assertWalkEqual(\n tree.walk(\".\"),\n [\n (\".\", [\"data_dir\"], [\"code.py\", \"bar\", \"\u0442\u0435\u0441\u0442\", \"foo\"]),\n (join(\"data_dir\"), [\"data_sub_dir\"], [\"data\"]),\n (join(\"data_dir\", \"data_sub_dir\"), [], [\"data_sub\"]),\n ],\n )\n\n def test_subdir(self):\n tree = WorkingTree()\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/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/test_tree.py_TestWalkInGit_TestWalkInGit.test_nobranch.None_1", "embedding": null, "metadata": {"file_path": "tests/test_tree.py", "file_name": "test_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 118, "end_line": 132, "span_ids": ["TestWalkInGit.test_nobranch", "TestWalkInGit"], "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 TestWalkInGit(AssertWalkEqualMixin, TestGit):\n def test_nobranch(self):\n tree = WorkingTree()\n self.assertWalkEqual(\n tree.walk(\".\"),\n [\n (\".\", [\"data_dir\"], [\"bar\", \"\u0442\u0435\u0441\u0442\", \"code.py\", \"foo\"]),\n (\"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/test_tree.py_TestWalkInGit.test_branch_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/test_tree.py_TestWalkInGit.test_branch_", "embedding": null, "metadata": {"file_path": "tests/test_tree.py", "file_name": "test_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 134, "end_line": 151, "span_ids": ["TestWalkInGit.test_branch"], "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 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 (\".\", [\"data_dir\"], [\"code.py\"]),\n (\"data_dir\", [\"data_sub_dir\"], []),\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/unit/command/test_run.py_mock_TestCli.test_file_name.cmd_mock_return_value_run": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_run.py_mock_TestCli.test_file_name.cmd_mock_return_value_run", "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": 21, "span_ids": ["imports", "TestCli", "TestCli.test_file_name"], "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": "import mock\n\nfrom unittest import TestCase\n\nfrom dvc.main import main\n\n\nclass TestCli(TestCase):\n @mock.patch(\"dvc.main.Analytics\", autospec=True)\n @mock.patch(\"dvc.cli.run.CmdRun\", autospec=True)\n def test_file_name(self, cmd_mock, _):\n cmd_mock.return_value.run_cmd.return_value = 0\n ret = main([\"run\", \"-f\", \"test/out.dvc\", \"echo\"])\n self.assertEqual(ret, 0)\n cmd_mock.assert_called_once()\n args, kwargs = cmd_mock.call_args_list[0]\n self.assertEqual(len(args), 1)\n self.assertEqual(len(kwargs), 0)\n self.assertEqual(args[0].file, \"test/out.dvc\")\n self.assertSequenceEqual(args[0].command, [\"echo\"])\n cmd_mock.return_value.run_cmd.assert_called_once()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_run.py_TestCli.test_file_name_default_TestCli.test_file_name_default.cmd_mock_return_value_run": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_run.py_TestCli.test_file_name_default_TestCli.test_file_name_default.cmd_mock_return_value_run", "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": 23, "end_line": 35, "span_ids": ["TestCli.test_file_name_default"], "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 TestCli(TestCase):\n\n @mock.patch(\"dvc.main.Analytics\", autospec=True)\n @mock.patch(\"dvc.cli.run.CmdRun\", autospec=True)\n def test_file_name_default(self, cmd_mock, _):\n cmd_mock.return_value.run_cmd.return_value = 0\n ret = main([\"run\", \"-d\", \"foo\", \"echo\"])\n self.assertEqual(ret, 0)\n cmd_mock.assert_called_once()\n args, kwargs = cmd_mock.call_args_list[0]\n self.assertEqual(len(args), 1)\n self.assertEqual(len(kwargs), 0)\n self.assertIsNone(args[0].file)\n self.assertSequenceEqual(args[0].command, [\"echo\"])\n cmd_mock.return_value.run_cmd.assert_called_once()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_run.py_TestCli.test_wdir_TestCli.test_wdir.cmd_mock_return_value_run": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_run.py_TestCli.test_wdir_TestCli.test_wdir.cmd_mock_return_value_run", "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": 37, "end_line": 49, "span_ids": ["TestCli.test_wdir"], "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 TestCli(TestCase):\n\n @mock.patch(\"dvc.main.Analytics\", autospec=True)\n @mock.patch(\"dvc.cli.run.CmdRun\", autospec=True)\n def test_wdir(self, cmd_mock, _):\n cmd_mock.return_value.run_cmd.return_value = 0\n ret = main([\"run\", \"--wdir\", \"test/\", \"echo\"])\n self.assertEqual(ret, 0)\n cmd_mock.assert_called_once()\n args, kwargs = cmd_mock.call_args_list[0]\n self.assertEqual(len(args), 1)\n self.assertEqual(len(kwargs), 0)\n self.assertEqual(args[0].wdir, \"test/\")\n self.assertSequenceEqual(args[0].command, [\"echo\"])\n cmd_mock.return_value.run_cmd.assert_called_once()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_run.py_TestCli.test_wdir_default_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_run.py_TestCli.test_wdir_default_", "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": 51, "end_line": 64, "span_ids": ["TestCli.test_wdir_default"], "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 TestCli(TestCase):\n\n @mock.patch(\"dvc.main.Analytics\", autospec=True)\n @mock.patch(\"dvc.cli.run.CmdRun\", autospec=True)\n def test_wdir_default(self, cmd_mock, _):\n cmd_mock.return_value.run_cmd.return_value = 0\n ret = main([\"run\", \"echo\"])\n self.assertEqual(ret, 0)\n cmd_mock.assert_called_once()\n args, kwargs = cmd_mock.call_args_list[0]\n self.assertEqual(len(args), 1)\n self.assertEqual(len(kwargs), 0)\n self.assertEqual(args[0].wdir, None)\n self.assertSequenceEqual(args[0].command, [\"echo\"])\n cmd_mock.return_value.run_cmd.assert_called_once()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/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": 9, "span_ids": ["TestDependencyGS._get_cls", "imports", "TestDependencyGS"], "tokens": 41}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.dependency.gs import DependencyGS\n\nfrom tests.unit.dependency.test_local import TestDependencyLOCAL\n\n\nclass TestDependencyGS(TestDependencyLOCAL):\n def _get_cls(self):\n return DependencyGS", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_hdfs.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_hdfs.py__", "embedding": null, "metadata": {"file_path": "tests/unit/dependency/test_hdfs.py", "file_name": "test_hdfs.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 9, "span_ids": ["imports", "TestDependencyHDFS._get_cls", "TestDependencyHDFS"], "tokens": 45}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.dependency.hdfs import DependencyHDFS\n\nfrom tests.unit.dependency.test_local import TestDependencyLOCAL\n\n\nclass TestDependencyHDFS(TestDependencyLOCAL):\n def _get_cls(self):\n return DependencyHDFS", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_http.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_http.py__", "embedding": null, "metadata": {"file_path": "tests/unit/dependency/test_http.py", "file_name": "test_http.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 9, "span_ids": ["TestDependencyHTTP._get_cls", "imports", "TestDependencyHTTP"], "tokens": 41}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.dependency.http import DependencyHTTP\n\nfrom tests.unit.dependency.test_local import TestDependencyLOCAL\n\n\nclass TestDependencyHTTP(TestDependencyLOCAL):\n def _get_cls(self):\n return DependencyHTTP", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_local.py_mock_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_local.py_mock_", "embedding": null, "metadata": {"file_path": "tests/unit/dependency/test_local.py", "file_name": "test_local.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 22, "span_ids": ["TestDependencyLOCAL._get_dependency", "TestDependencyLOCAL", "imports", "TestDependencyLOCAL.test_save_missing", "TestDependencyLOCAL._get_cls"], "tokens": 117}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import mock\n\nfrom dvc.stage import Stage\nfrom dvc.dependency import DependencyLOCAL\n\nfrom tests.basic_env import TestDvc\n\n\nclass TestDependencyLOCAL(TestDvc):\n def _get_cls(self):\n return DependencyLOCAL\n\n def _get_dependency(self):\n stage = Stage(self.dvc)\n return self._get_cls()(stage, \"path\")\n\n def test_save_missing(self):\n d = self._get_dependency()\n with mock.patch.object(d.remote, \"exists\", return_value=False):\n with self.assertRaises(d.DoesNotExistError):\n d.save()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_s3.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_s3.py__", "embedding": null, "metadata": {"file_path": "tests/unit/dependency/test_s3.py", "file_name": "test_s3.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 9, "span_ids": ["TestDependencyS3._get_cls", "imports", "TestDependencyS3"], "tokens": 45}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.dependency.s3 import DependencyS3\n\nfrom tests.unit.dependency.test_local import TestDependencyLOCAL\n\n\nclass TestDependencyS3(TestDependencyLOCAL):\n def _get_cls(self):\n return DependencyS3", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_ssh.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/dependency/test_ssh.py__", "embedding": null, "metadata": {"file_path": "tests/unit/dependency/test_ssh.py", "file_name": "test_ssh.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 9, "span_ids": ["imports", "TestDependencySSH._get_cls", "TestDependencySSH"], "tokens": 42}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.dependency.ssh import DependencySSH\n\nfrom tests.unit.dependency.test_local import TestDependencyLOCAL\n\n\nclass TestDependencySSH(TestDependencyLOCAL):\n def _get_cls(self):\n return DependencySSH", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_gs.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_gs.py__", "embedding": null, "metadata": {"file_path": "tests/unit/output/test_gs.py", "file_name": "test_gs.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 9, "span_ids": ["imports", "TestOutputGS", "TestOutputGS._get_cls"], "tokens": 39}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.output.gs import OutputGS\n\nfrom tests.unit.output.test_local import TestOutputLOCAL\n\n\nclass TestOutputGS(TestOutputLOCAL):\n def _get_cls(self):\n return OutputGS", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_hdfs.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_hdfs.py__", "embedding": null, "metadata": {"file_path": "tests/unit/output/test_hdfs.py", "file_name": "test_hdfs.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 9, "span_ids": ["imports", "TestOutputHDFS._get_cls", "TestOutputHDFS"], "tokens": 43}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.output.hdfs import OutputHDFS\n\nfrom tests.unit.output.test_local import TestOutputLOCAL\n\n\nclass TestOutputHDFS(TestOutputLOCAL):\n def _get_cls(self):\n return OutputHDFS", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_local.py_from_mock_import_patch_TestOutputLOCAL.test_save_missing.with_patch_object_o_remot.with_self_assertRaises_o_.o_save_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_local.py_from_mock_import_patch_TestOutputLOCAL.test_save_missing.with_patch_object_o_remot.with_self_assertRaises_o_.o_save_", "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": 21, "span_ids": ["TestOutputLOCAL.test_save_missing", "imports", "TestOutputLOCAL._get_output", "TestOutputLOCAL", "TestOutputLOCAL._get_cls"], "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 mock import patch\n\nfrom dvc.stage import Stage\nfrom dvc.output import OutputLOCAL\n\nfrom tests.basic_env import TestDvc\n\n\nclass TestOutputLOCAL(TestDvc):\n def _get_cls(self):\n return OutputLOCAL\n\n def _get_output(self):\n stage = Stage(self.dvc)\n return self._get_cls()(stage, \"path\", cache=False)\n\n def test_save_missing(self):\n o = self._get_output()\n with patch.object(o.remote, \"exists\", return_value=False):\n with self.assertRaises(o.DoesNotExistError):\n o.save()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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": 24, "end_line": 49, "span_ids": ["TestGetFilesNumber.test_return_mutiple_for_dir", "TestGetFilesNumber.test_return_0_on_no_cache", "TestGetFilesNumber", "TestGetFilesNumber.test_return_1_on_single_file_cache", "TestGetFilesNumber._get_output"], "tokens": 216}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestGetFilesNumber(TestDvc):\n def _get_output(self):\n stage = Stage(self.dvc)\n return OutputLOCAL(stage, \"path\")\n\n @patch.object(OutputLOCAL, \"cache\", None)\n def test_return_0_on_no_cache(self):\n o = self._get_output()\n\n self.assertEqual(0, o.get_files_number())\n\n @patch.object(OutputLOCAL, \"cache\", \"cache\")\n @patch.object(OutputLOCAL, \"is_dir_cache\", True)\n @patch.object(OutputLOCAL, \"dir_cache\", [{\"md5\": \"asdf\"}, {\"md5\": \"qwe\"}])\n def test_return_mutiple_for_dir(self):\n o = self._get_output()\n\n self.assertEqual(2, o.get_files_number())\n\n @patch.object(OutputLOCAL, \"cache\", \"cache\")\n @patch.object(OutputLOCAL, \"is_dir_cache\", 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": 9, "span_ids": ["imports", "TestOutputS3._get_cls", "TestOutputS3"], "tokens": 43}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.output.s3 import OutputS3\n\nfrom tests.unit.output.test_local import TestOutputLOCAL\n\n\nclass TestOutputS3(TestOutputLOCAL):\n def _get_cls(self):\n return OutputS3", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_ssh.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_ssh.py__", "embedding": null, "metadata": {"file_path": "tests/unit/output/test_ssh.py", "file_name": "test_ssh.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 9, "span_ids": ["imports", "TestOutputSSH._get_cls", "TestOutputSSH"], "tokens": 40}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.output.ssh import OutputSSH\n\nfrom tests.unit.output.test_local import TestOutputLOCAL\n\n\nclass TestOutputSSH(TestOutputLOCAL):\n def _get_cls(self):\n return OutputSSH", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_getpass_TestRemoteSSH.test_user.None_2": {"__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_TestRemoteSSH.test_user.None_2", "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": 24, "span_ids": ["imports", "TestRemoteSSH", "TestRemoteSSH.test_user"], "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 getpass\n\nfrom unittest import TestCase\n\nfrom dvc.remote.ssh import RemoteSSH\n\n\nclass TestRemoteSSH(TestCase):\n def test_user(self):\n url = \"ssh://127.0.0.1:/path/to/dir\"\n config = {\"url\": url}\n remote = RemoteSSH(None, config)\n self.assertEqual(remote.user, getpass.getuser())\n\n user = \"test1\"\n url = \"ssh://{}@127.0.0.1:/path/to/dir\".format(user)\n config = {\"url\": url}\n remote = RemoteSSH(None, config)\n self.assertEqual(remote.user, user)\n\n user = \"test2\"\n config[\"user\"] = user\n remote = RemoteSSH(None, config)\n self.assertEqual(remote.user, 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_TestRemoteSSH.test_url_TestRemoteSSH.test_url.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_TestRemoteSSH.test_url_TestRemoteSSH.test_url.None_7", "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": 26, "end_line": 52, "span_ids": ["TestRemoteSSH.test_url"], "tokens": 218}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRemoteSSH(TestCase):\n\n def test_url(self):\n user = \"test\"\n host = \"123.45.67.89\"\n port = 1234\n path = \"/path/to/dir\"\n\n # URL ssh://[user@]host.xz[:port]/path\n url = \"ssh://{}@{}:{}{}\".format(user, host, port, path)\n config = {\"url\": url}\n\n remote = RemoteSSH(None, config)\n\n self.assertEqual(remote.user, user)\n self.assertEqual(remote.host, host)\n self.assertEqual(remote.port, port)\n self.assertEqual(remote.prefix, path)\n\n # SCP-like URL ssh://[user@]host.xz:/absolute/path\n url = \"ssh://{}@{}:{}\".format(user, host, path)\n config = {\"url\": url}\n\n remote = RemoteSSH(None, config)\n\n self.assertEqual(remote.user, user)\n self.assertEqual(remote.host, host)\n self.assertEqual(remote.port, remote.DEFAULT_PORT)\n self.assertEqual(remote.prefix, 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/ssh/test_ssh.py_TestRemoteSSH.test_no_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_TestRemoteSSH.test_no_path_", "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": 54, "end_line": 75, "span_ids": ["TestRemoteSSH.test_no_path", "TestRemoteSSH.test_port"], "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 TestRemoteSSH(TestCase):\n\n def test_no_path(self):\n config = {\"url\": \"ssh://127.0.0.1\"}\n remote = RemoteSSH(None, config)\n self.assertEqual(remote.prefix, \"/\")\n\n def test_port(self):\n url = \"ssh://127.0.0.1/path/to/dir\"\n config = {\"url\": url}\n remote = RemoteSSH(None, config)\n self.assertEqual(remote.port, remote.DEFAULT_PORT)\n\n port = 1234\n url = \"ssh://127.0.0.1:{}/path/to/dir\".format(port)\n config = {\"url\": url}\n remote = RemoteSSH(None, config)\n self.assertEqual(remote.port, port)\n\n port = 4321\n config[\"port\"] = port\n remote = RemoteSSH(None, config)\n self.assertEqual(remote.port, 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/test_azure.py_from_unittest_import_Test_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_azure.py_from_unittest_import_Test_", "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": 38, "span_ids": ["TestRemoteAzure.test_init", "imports", "TestRemoteAzure.test_init_compat", "TestRemoteAzure"], "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 unittest import TestCase\n\nfrom dvc.remote.azure import RemoteAzure\n\n\nclass TestRemoteAzure(TestCase):\n container_name = \"container-name\"\n connection_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 def test_init_compat(self):\n url = (\n \"azure://ContainerName={container_name};{connection_string}\"\n ).format(\n container_name=self.container_name,\n connection_string=self.connection_string,\n )\n config = {\"url\": url}\n remote = RemoteAzure(None, config)\n self.assertEqual(remote.url, url)\n self.assertEqual(remote.prefix, \"\")\n self.assertEqual(remote.bucket, self.container_name)\n self.assertEqual(remote.connection_string, self.connection_string)\n\n def test_init(self):\n prefix = \"some/prefix\"\n url = \"azure://{}/{}\".format(self.container_name, prefix)\n config = {\"url\": url, \"connection_string\": self.connection_string}\n remote = RemoteAzure(None, config)\n self.assertEqual(remote.url, url)\n self.assertEqual(remote.prefix, prefix)\n self.assertEqual(remote.bucket, self.container_name)\n self.assertEqual(remote.connection_string, self.connection_string)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_base.py_mock_TestMissingDeps.test.for_remote_class_in_remot.with_mock_patch_object_re.with_self_assertRaises_Re.remote_class_None_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_base.py_mock_TestMissingDeps.test.for_remote_class_in_remot.with_mock_patch_object_re.with_self_assertRaises_Re.remote_class_None_", "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": 15, "span_ids": ["imports", "TestMissingDeps", "TestMissingDeps.test"], "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 mock\nfrom unittest import TestCase\n\nfrom dvc.remote import REMOTES, RemoteLOCAL, RemoteSSH, RemoteHDFS\nfrom dvc.remote.base import RemoteBase, RemoteCmdError, RemoteMissingDepsError\n\n\nclass TestMissingDeps(TestCase):\n def test(self):\n remotes = REMOTES + [RemoteLOCAL, RemoteBase]\n for remote_class in remotes:\n REQUIRES = {\"foo\": None, \"bar\": None, \"mock\": mock}\n with mock.patch.object(remote_class, \"REQUIRES\", REQUIRES):\n with self.assertRaises(RemoteMissingDepsError):\n remote_class(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_base.py_TestCmdError_TestCmdError.test.for_remote_class_in_Remo.with_mock_patch_object_.with_self_assertRaises_Re.remote_class_repo_config": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_base.py_TestCmdError_TestCmdError.test.for_remote_class_in_Remo.with_mock_patch_object_.with_self_assertRaises_Re.remote_class_repo_config", "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": 18, "end_line": 35, "span_ids": ["TestCmdError.test", "TestCmdError"], "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 TestCmdError(TestCase):\n def test(self):\n for remote_class in [RemoteSSH, RemoteHDFS]:\n repo = None\n config = {}\n\n remote_name = remote_class.scheme\n cmd = \"sed 'hello'\"\n ret = \"1\"\n err = \"sed: expression #1, char 2: extra characters after command\"\n\n with mock.patch.object(\n remote_class,\n \"remove\",\n side_effect=RemoteCmdError(remote_name, cmd, ret, err),\n ):\n with self.assertRaises(RemoteCmdError):\n remote_class(repo, 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_TestCacheExists_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_base.py_TestCacheExists_", "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": 38, "end_line": 62, "span_ids": ["TestCacheExists", "TestCacheExists.test"], "tokens": 176}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCacheExists(TestCase):\n def test(self):\n for remote_class in REMOTES:\n config = {\n \"url\": remote_class.scheme + \"://example/prefix\",\n \"connection_string\": \"1234567\",\n }\n remote = remote_class(None, config)\n\n with mock.patch.object(remote, \"changed_cache\", return_value=True):\n with mock.patch.object(remote, \"copy\") as cp:\n remote.save(\n remote.path_info, {remote.PARAM_CHECKSUM: \"1234567890\"}\n )\n cp.assert_called_once()\n\n with mock.patch.object(\n remote, \"changed_cache\", return_value=False\n ):\n with mock.patch.object(remote, \"copy\") as cp:\n remote.save(\n remote.path_info, {remote.PARAM_CHECKSUM: \"1234567890\"}\n )\n cp.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/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": 41, "span_ids": ["TestRemoteGS.test_gs", "TestRemoteGS.test_init", "TestRemoteGS.test_gs_no_credspath", "imports", "TestRemoteGS"], "tokens": 282}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import mock\nfrom unittest import TestCase\n\nfrom dvc.remote.gs import RemoteGS\n\n\nclass TestRemoteGS(TestCase):\n BUCKET = \"bucket\"\n PREFIX = \"prefix\"\n URL = \"gs://{}/{}\".format(BUCKET, PREFIX)\n CREDENTIALPATH = \"/path/to/gcp_credentials.json\"\n PROJECT = \"PROJECT\"\n CONFIG = {\n \"projectname\": PROJECT,\n \"url\": URL,\n \"credentialpath\": CREDENTIALPATH,\n }\n\n def test_init(self):\n remote = RemoteGS(None, self.CONFIG)\n self.assertEqual(remote.url, self.URL)\n self.assertEqual(remote.prefix, self.PREFIX)\n self.assertEqual(remote.bucket, self.BUCKET)\n self.assertEqual(remote.projectname, self.PROJECT)\n self.assertEqual(remote.credentialpath, self.CREDENTIALPATH)\n\n @mock.patch(\"google.cloud.storage.Client.from_service_account_json\")\n def test_gs(self, mock_client):\n remote = RemoteGS(None, self.CONFIG)\n self.assertTrue(remote.credentialpath)\n remote.gs()\n mock_client.assert_called_once_with(self.CREDENTIALPATH)\n\n @mock.patch(\"google.cloud.storage.Client\")\n def test_gs_no_credspath(self, mock_client):\n config = self.CONFIG.copy()\n del config[\"credentialpath\"]\n remote = RemoteGS(None, config)\n remote.gs()\n mock_client.assert_called_with(self.PROJECT)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/scm/test_git.py_os_", "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": 18, "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": 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 os\n\nfrom tests.basic_env import TestDvc\n\n\nclass TestGit(TestDvc):\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_dvc_repo_import_Repo_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/scm/test_scm.py_from_dvc_repo_import_Repo_", "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": 38, "span_ids": ["imports", "TestScmContext.test_should_throw_and_cleanup", "TestScmContext", "TestScmContext.test_should_successfully_perform_method", "TestScmContext.setUp"], "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": "from dvc.repo import Repo\nfrom dvc.repo.scm_context import scm_context\nfrom dvc.scm import NoSCM\nfrom unittest import TestCase\nimport mock\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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_daemon.py_os_", "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": 32, "span_ids": ["imports", "TestDaemon.test", "TestDaemon"], "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 os\nimport mock\nimport inspect\nfrom unittest import TestCase\n\nimport dvc.daemon as daemon\n\n\nclass TestDaemon(TestCase):\n @mock.patch(\"dvc.daemon._spawn_posix\")\n @mock.patch(\"dvc.daemon._spawn_windows\")\n def test(self, mock_windows, mock_posix):\n daemon.daemon([\"updater\"])\n\n if os.name == \"nt\":\n mock_posix.assert_not_called()\n mock_windows.assert_called()\n args, kwargs = mock_windows.call_args\n else:\n mock_windows.assert_not_called()\n mock_posix.assert_called()\n args, kwargs = mock_posix.call_args\n\n env = args[1]\n self.assertTrue(\"PYTHONPATH\" in env.keys())\n\n file_path = os.path.abspath(inspect.stack()[0][1])\n file_dir = os.path.dirname(file_path)\n test_dir = os.path.dirname(file_dir)\n dvc_dir = os.path.dirname(test_dir)\n self.assertEqual(env[\"PYTHONPATH\"], dvc_dir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_mock_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_progress.py_mock_", "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": 28, "span_ids": ["TestProgressAware", "imports", "TestProgressAware.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": "import mock\nfrom unittest import TestCase\n\nfrom dvc.progress import progress, progress_aware\n\n\nclass TestProgressAware(TestCase):\n @mock.patch(\"sys.stdout.isatty\", return_value=True)\n @mock.patch(\"dvc.progress.Progress.print\")\n def test(self, mock_print, _):\n # progress is a global object, can be shared between tests when\n # run in multi-threading environment with pytest\n progress.reset()\n function = progress_aware(lambda: None)\n\n function()\n # first - called once for progress.clearln()\n mock_print.assert_called_once()\n\n progress.update_target(\"testing\", 0, 100)\n function()\n # second - progress.clearln() on refresh on update_target\n # third - progress.print on refresh on update_target\n # fourth - progress.clearln()\n self.assertEqual(4, mock_print.call_count)\n\n progress.finish_target(\"testing\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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": 15, "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": "import mock\nfrom unittest import TestCase\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/test_repo.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_repo.py__", "embedding": null, "metadata": {"file_path": "tests/unit/test_repo.py", "file_name": "test_repo.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 14, "span_ids": ["TestIsDvcInternal", "imports", "TestIsDvcInternal.test_return_false_on_non_dvc_file", "TestIsDvcInternal.test_return_true_on_dvc_internal_file"], "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\nfrom tests.basic_env import TestDvc\n\n\nclass TestIsDvcInternal(TestDvc):\n def test_return_false_on_non_dvc_file(self):\n path = os.path.join(\"path\", \"to-non-.dvc\", \"file\")\n self.assertFalse(self.dvc.is_dvc_internal(path))\n\n def test_return_true_on_dvc_internal_file(self):\n path = os.path.join(\"path\", \"to\", \".dvc\", \"file\")\n self.assertTrue(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/test_stage.py_mock_TestStageChecksum.test.with_mock_patch_object_st.self_assertEqual_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_stage.py_mock_TestStageChecksum.test.with_mock_patch_object_st.self_assertEqual_", "embedding": null, "metadata": {"file_path": "tests/unit/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 16, "span_ids": ["imports", "TestStageChecksum.test", "TestStageChecksum"], "tokens": 149}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import mock\nfrom unittest import TestCase\nfrom dvc.stage import Stage\n\n\nclass TestStageChecksum(TestCase):\n def test(self):\n stage = Stage(None, \"path\")\n outs = [{\"path\": \"a\", \"md5\": \"123456789\"}]\n deps = [{\"path\": \"b\", \"md5\": \"987654321\"}]\n d = {\"md5\": \"123456\", \"cmd\": \"mycmd\", \"outs\": outs, \"deps\": deps}\n\n with mock.patch.object(stage, \"dumpd\", return_value=d):\n self.assertEqual(\n stage._compute_md5(), \"e9521a22111493406ea64a88cda63e0b\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_stage.py_TestStageChecksum.test_wdir_default_ignored_TestStageChecksum.test_wdir_default_ignored.with_mock_patch_object_st.self_assertEqual_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_stage.py_TestStageChecksum.test_wdir_default_ignored_TestStageChecksum.test_wdir_default_ignored.with_mock_patch_object_st.self_assertEqual_", "embedding": null, "metadata": {"file_path": "tests/unit/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 18, "end_line": 33, "span_ids": ["TestStageChecksum.test_wdir_default_ignored"], "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 TestStageChecksum(TestCase):\n\n def test_wdir_default_ignored(self):\n stage = Stage(None, \"path\")\n outs = [{\"path\": \"a\", \"md5\": \"123456789\"}]\n deps = [{\"path\": \"b\", \"md5\": \"987654321\"}]\n d = {\n \"md5\": \"123456\",\n \"cmd\": \"mycmd\",\n \"outs\": outs,\n \"deps\": deps,\n \"wdir\": \".\",\n }\n\n with mock.patch.object(stage, \"dumpd\", return_value=d):\n self.assertEqual(\n stage._compute_md5(), \"e9521a22111493406ea64a88cda63e0b\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_stage.py_TestStageChecksum.test_wdir_non_default_is_not_ignored_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_stage.py_TestStageChecksum.test_wdir_non_default_is_not_ignored_", "embedding": null, "metadata": {"file_path": "tests/unit/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 35, "end_line": 65, "span_ids": ["TestStageChecksum.test_wdir_non_default_is_not_ignored", "TestPathConversion.test", "TestPathConversion"], "tokens": 240}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestStageChecksum(TestCase):\n\n def test_wdir_non_default_is_not_ignored(self):\n stage = Stage(None, \"path\")\n outs = [{\"path\": \"a\", \"md5\": \"123456789\"}]\n deps = [{\"path\": \"b\", \"md5\": \"987654321\"}]\n d = {\n \"md5\": \"123456\",\n \"cmd\": \"mycmd\",\n \"outs\": outs,\n \"deps\": deps,\n \"wdir\": \"..\",\n }\n\n with mock.patch.object(stage, \"dumpd\", return_value=d):\n self.assertEqual(\n stage._compute_md5(), \"2ceba15e87f6848aa756502c1e6d24e9\"\n )\n\n\nclass TestPathConversion(TestCase):\n def test(self):\n import posixpath\n import ntpath\n\n stage = Stage(None, \"path\")\n\n stage.wdir = posixpath.join(\"..\", \"..\")\n self.assertEqual(stage.dumpd()[\"wdir\"], \"../..\")\n\n stage.wdir = ntpath.join(\"..\", \"..\")\n self.assertEqual(stage.dumpd()[\"wdir\"], \"../..\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_updater.py_os_mocked_requests_get.return.MockResponse_version_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_updater.py_os_mocked_requests_get.return.MockResponse_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": 27, "span_ids": ["MockResponse.__init__", "imports", "mocked_requests_get", "MockResponse", "MockResponse.json"], "tokens": 136}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport json\nimport mock\n\nfrom dvc import VERSION\nfrom tests.basic_env import TestDvc\n\n\nclass MockResponse(object):\n def __init__(self, json_data, status_code):\n self.json_data = json_data\n self.status_code = status_code\n\n def json(self):\n return self.json_data\n\n\ndef mocked_requests_get(*args, **kwargs):\n class MockResponse:\n def __init__(self, json_data, status_code):\n self.json_data = json_data\n self.status_code = status_code\n\n def json(self):\n return self.json_data\n\n return MockResponse({\"version\": VERSION}, 200)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_TestUpdater_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_updater.py_TestUpdater_", "embedding": null, "metadata": {"file_path": "tests/unit/test_updater.py", "file_name": "test_updater.py", "file_type": "text/x-python", "category": "test", "start_line": 30, "end_line": 40, "span_ids": ["TestUpdater.test_fetch", "TestUpdater"], "tokens": 116}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestUpdater(TestDvc):\n @mock.patch(\"requests.get\", side_effect=mocked_requests_get)\n def test_fetch(self, mock_get):\n self.assertFalse(os.path.exists(self.dvc.updater.updater_file))\n self.dvc.updater.fetch(detach=False)\n mock_get.assert_called_once()\n self.assertTrue(os.path.isfile(self.dvc.updater.updater_file))\n with open(self.dvc.updater.updater_file, \"r\") as fobj:\n info = json.load(fobj)\n self.assertEqual(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/utils/test_fs.py_os_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_os_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": 1, "end_line": 35, "span_ids": ["imports", "TestMtimeAndSize.test", "TestMtimeAndSize"], "tokens": 236}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nfrom unittest import TestCase\n\nimport dvc\nfrom dvc.system import System\nfrom dvc.utils.compat import str\nfrom dvc.utils.fs import (\n get_mtime_and_size,\n contains_symlink_up_to,\n BasePathNotInCheckedPathException,\n)\nfrom mock import patch\nfrom tests.basic_env import TestDir\nfrom tests.utils import spy\n\n\nclass TestMtimeAndSize(TestDir):\n def test(self):\n file_time, file_size = get_mtime_and_size(self.DATA)\n dir_time, dir_size = get_mtime_and_size(self.DATA_DIR)\n\n actual_file_size = os.path.getsize(self.DATA)\n actual_dir_size = (\n os.path.getsize(self.DATA_DIR)\n + os.path.getsize(self.DATA)\n + os.path.getsize(self.DATA_SUB_DIR)\n + os.path.getsize(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_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/tests/unit/utils/test_fs.py_TestContainsLink.test_should_call_recursive_on_no_condition_matched_TestContainsLink.test_should_call_recursive_on_no_condition_matched.with_patch_object_.self_assertEqual_2_conta": {"__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_call_recursive_on_no_condition_matched_TestContainsLink.test_should_call_recursive_on_no_condition_matched.with_patch_object_.self_assertEqual_2_conta", "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": 64, "end_line": 77, "span_ids": ["TestContainsLink.test_should_call_recursive_on_no_condition_matched"], "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 TestContainsLink(TestCase):\n\n @patch.object(System, \"is_symlink\", return_value=False)\n def test_should_call_recursive_on_no_condition_matched(self, _):\n contains_symlink_spy = spy(contains_symlink_up_to)\n with patch.object(\n dvc.utils.fs, \"contains_symlink_up_to\", contains_symlink_spy\n ):\n\n # call from full path to match contains_symlink_spy patch path\n self.assertFalse(\n dvc.utils.fs.contains_symlink_up_to(\n os.path.join(\"foo\", \"path\"), \"foo\"\n )\n )\n self.assertEqual(2, contains_symlink_spy.mock.call_count)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_": {"__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_", "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": 79, "end_line": 93, "span_ids": ["TestContainsLink.test_should_return_false_when_base_path_is_symlink"], "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 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))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_yaml_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/utils/__init__.py_yaml_", "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": 51, "span_ids": ["spy", "get_gitignore_content", "reset_logger_error_output", "reset_logger_standard_output", "imports", "load_stage_file", "cd"], "tokens": 235}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import yaml\nimport os\n\nfrom dvc.scm import Git\nfrom dvc.utils.compat import StringIO\nfrom mock import MagicMock\nfrom contextlib import contextmanager\n\n\ndef spy(method_to_decorate):\n mock = MagicMock()\n\n def wrapper(self, *args, **kwargs):\n mock(*args, **kwargs)\n return method_to_decorate(self, *args, **kwargs)\n\n wrapper.mock = mock\n return wrapper\n\n\ndef get_gitignore_content():\n with open(Git.GITIGNORE, \"r\") as gitignore:\n return gitignore.read().splitlines()\n\n\ndef load_stage_file(path):\n with open(path, \"r\") as fobj:\n return yaml.safe_load(fobj)\n\n\ndef reset_logger_error_output():\n from dvc.logger import logger\n\n logger.handlers[1].stream = StringIO()\n\n\ndef reset_logger_standard_output():\n from dvc.logger import logger\n\n logger.handlers[0].stream = StringIO()\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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}}}