{"docstore/metadata": {"/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": "1c84933d99dafac7b27f23ee1753e44dc6d0745eee42c17ff34c82f560fc51ab"}, "/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": "24a2533166690bc0231f4181dc9f1745bd8aeb63c15d5e818beb27db2e25c3c8"}, "/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/cli.py__Command_line_interface_VersionAction.__call__.sys_exit_0_": {"doc_hash": "d035989991abed1f762d68073e02f619a631cd0e8874504be78472dfc5d4515f"}, "/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": "386b26a2142eda43ccb9b6c9249cc3c4b528eaa91bed034094ec6dc047440ef2"}, "/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": "d65c95b9a034b221d1eaf2bea89826594f666d86cdbc165d067cff13abfe643d"}, "/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": "1445c67fc869cf6e6221a35660289c4587e90b2410692a6c82a65ce598e5424d"}, "/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": "0e914c1a5636276271fb7fcb3595b936705df59b069e99be6fec11e4ae018882"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/commit.py_add_parser_": {"doc_hash": "1af7c899eec9faafccc93c5212048fb7f74cdba284e7ca1c23257fb8c7c29a98"}, "/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": "d2888cb37f6cf693d0feeb3c7f3f494fa9adbbd6cb2826e172fa128e2c469aee"}, "/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": "07559e455efd6e0eb09f7c7b41ddb7af2d1fe4284486893fff5efa3132f0486b"}, "/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": "30aff665f7face8db8be3ea9cbdb3d213651e612d2dffe5f7db723eb61cb1848"}, "/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": "9de9a5f3b582fdf575afc2317dd0c80c685d8428e906db53dca0301c1b639c1d"}, "/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": "ed9a2da536e1fc0a2666190a8e84101d1b46343242d1f37c148fc470f0a6afc1"}, "/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": "86eeaca6f2f62c181348ebfbffb7e6a123301e5f015ecb50f78b13811aee3fca"}, "/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": "241cd230a5dcab4e77ab5adb73b2e028a26b70e880b283590300b37862767e5b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/destroy.py_add_parser_": {"doc_hash": "2ce107d7fe9bb3dc44061eb3c99584b7e34936f0b6956dd32d6c3474512d75c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/gc.py_from___future___import_un_CmdGC.run.return.0": {"doc_hash": "b959dfef033e6ee5cb693eae545557caf5639315aa50fc6d21e0e8dde015ccf3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/gc.py_add_parser_": {"doc_hash": "d26374d09465770b36120f226473525bac7699e1ee347c51e0dfe694ecc6e3e2"}, "/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": "e0c20e76a7e90ded097692d52100a8746c996aa429dda5d344a0cee5a354481a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/imp.py_add_parser_": {"doc_hash": "113e43f0cdfc0459db50278430200dc583261417c4a47266cebba2a8fb38255d"}, "/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": "9a365d28a95fcf423cde27d5abb721acd178d30467c5074139cf2ed80d8b1aa7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/lock.py_add_parser_": {"doc_hash": "0fb442aff36b0dc670a43939ff3ad1e33cd70f8f25ed8525719cf9cc0550b498"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_CmdMetricsModify_CmdMetricsRemove.run.return.0": {"doc_hash": "1634e649419be0bf2621b7efba1b7e6c66915c2773f16c4d69d888ada8741801"}, "/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": "f1e21d983f036436c86ba5d70b404c69fd937dc083b86711dbb70d2f1b988897"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pipeline.py_add_parser_": {"doc_hash": "85a5226a5a021e19d3c0dab096fe613d4ba1de90a252c28068423a7fc2abc712"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_add_parser_": {"doc_hash": "025925761ec1bbafd169527deeeb11bfba3cf2c73a5a0028dbd509dbe2d13b50"}, "/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": "cb6f6163ce2ffac1b1960b5f9229fbca9c570a16f2dadcd037323e2bc119d6c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remove.py_add_parser_": {"doc_hash": "2b9a918b3c22f309c6194963d07c2782051d0b953e8ad360085a7e80ad0ea8ee"}, "/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": "4ef15cec734271b25621586235b7f0a5b6adeb332c0b2b555b1dd68998e2583c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/repro.py_add_parser_": {"doc_hash": "0f68a33859aecba49ce70df6607305e85a43d55f3883c24b7683ffe0504b307b"}, "/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": "a4684740e672b2a78db1f35933846db9e1d0ee59b2780614aa6c4901f56687cb"}, "/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": "3e570a9818a200b4c78b8087323f923dd11a1463ffc23db777ec39058a690452"}, "/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": "a832f96d1bc5fd76c8c6592862beacad5b70ff5f56f139b2ec78b267f0723988"}, "/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": "ce33cd0afa9547ebdedf3beb252eda592fee3f539f570d7da316cb5d73c13c43"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/status.py_CmdDataStatus.do_run_": {"doc_hash": "54421e8fccdc568914472f80e902d064542b5434c75e9bdaa122bacce5f7f35f"}, "/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": "395743aa6cfd0badc709f3b23af7a78eeef677f64bd6d7908006093d0e9c62ed"}, "/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": "b70d395c62653fa3ab7b0a40aa360945fe46b607060e47542b0a248ac54f0986"}, "/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": "083c34aee0f46c541f775aba9f942f22a10aac908794e5877b39679570341995"}, "/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_DataCloud._init_compat_DataCloud._init_compat.return.self__init_cloud_cloud_co": {"doc_hash": "17e1b39c040a3df88dedd20ba56c5443fac18b8bfa478cf6844288b4c3f82aee"}, "/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": "5d7faeeaba11bbf92be749a7ea26146af5b2abe8f6c44612fc8919d5df42fe7d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud.status_": {"doc_hash": "d6c7715f8fd2fa0efed0608bebbfd0458209e2dd9b4c4825019688f5ca01a7de"}, "/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": "1e3f4769b333fd8c8e600bf1f6b3ecaeba1bd8b7c5a7377a3b2c7b980e4dd404"}, "/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/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": "8755c6273d2f9b512fcc1067caf2f6dca54bf74724e3216097bb19fe51dfca1a"}, "/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": "2e9246c72d4a66f76597f1630f6a0416a6a09919196e013505f50e94f06b4f9d"}, "/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": "87a0a6d472c098baaedd789c0f64db3e7da6b5fffe9a86db73db6f8d8fabc3a4"}, "/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": "a716d630ee0310263f28fca13fd78da26248724fcc5c63a5bd63a0fa1ce48b5c"}, "/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/main.py__Main_entry_point_for_d_": {"doc_hash": "3676144cd80b60dd93e7d0f7640f96cff74ca7d0b9ad26aca54caf68ada28b67"}, "/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": "5dccc1bf28d992416e5ec404b0184bb2151b787c0954dbcecab3c964deb49ca0"}, "/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/progress.py__Manages_progress_bars__Progress.finish_target.with_self__lock_.self._line.None": {"doc_hash": "a85edff5f38f7f00e24381078522812a92a27c3d7ab09546431d6ba845c945f4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/prompt.py__Manages_user_prompts__": {"doc_hash": "443abe276087203e157a0f7b7b9b49199e48d10141cf49a91e91f7e508b99640"}, "/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": "4f6b9662c987339d8285e1c0d81d6c6f1e8aa274bcf59f9311ad4365ab3a80cd"}, "/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": "007b008eeaae2f1795de6b7cc6fcd99bad1392750b1e58c79a5a9c3bfb5fbb9c"}, "/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": "122f3157b2afccb76c7b9505da90cf9a90965910ff0a86cdfa5183be58b09f67"}, "/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": "b262dbd56db77f7c9eb1bde448f7b461bfdb8c5561cef4e5296c517fdd599f0b"}, "/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": "337d7e413c4d10cbcc2437ea993fc2338f8bcce85186a106c96dc3a4cbe0dda8"}, "/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": "c827165add6154df74cf846fe8adaa1a33d82d63abe5d52bc23fed19f46365b8"}, "/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": "9cdf6520e5e25d43aad6dcf5ae413993a19ecc09d7018a35e66482ff8adb5d3a"}, "/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": "2bfa25896ff19882d8330a8959f076939f73aed32dd059372032e9856a06a961"}, "/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": "0f64aa54fc01b44f4564a4c777aad39d9fbd42ef882165980a1fc1d395b34350"}, "/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": "6c3af10f8363439f16b46e134f05f665dd7ff6f2cbbb3e079eb7043e42b79ca8"}, "/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": "d16a44672961a6f47a8e54e3256d0a9d2e68df0f6be43d7ebbad0b1a84b79d1d"}, "/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": "9e55e6a3148ae9d9b9bdfd2246945eab41b0ff97b59d8f4579ea90647ac1c3e2"}, "/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": "e2b0378dad415e06e2f8d4b42878002add1578187a2bbd1213f6990bd72f0346"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/gc.py_gc_": {"doc_hash": "ae153d4c028df815d7ea918451f2482837fcfd0f3e77ed164abb096950f0aed1"}, "/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": "d3a3e2f689e01a14208e5539222d9ac0b949aef0de25523bc88aeeb2ad485d96"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/init.py_init_": {"doc_hash": "76d1b2a3ea3a1c6bb481b15a7b936aaeea08ce3e6691a3b12289fcd9a69950a7"}, "/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": "a613094d5951db7c5bc77ac44fd6bfbe2b11d717062d86c472d016cb2e16c2a2"}, "/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": "1ad1f81addac44cc88331298ae39551c2eaeb690187576960a4d5aedda592651"}, "/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": "fffbb1f251298e602481bd177fc8c8213c1ca815d8c6720c07862604b28a8075"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/move.py_os_": {"doc_hash": "ad36f11f4aa781110cea8eea426ff79a317a11a216a5ef2290e747dd37f9e202"}, "/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": "b8e7808f1ba33a41ac7ad845b828f2c910856957b86e8e5fec587708eb81b4aa"}, "/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": "f972dbca0d353076d60bbd3285fc62fa95ee36cc424398b613c9e647a123f33e"}, "/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": "7fb50d98124282996b8c53d5c605cebacb12f963f03bb0fc61750181d489317d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/reproduce.py__reproduce_stages_": {"doc_hash": "dc58d0e9eddbbc5b38a7c68c23520f296fb2471435c75039db77d0e3a511db81"}, "/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": "908b3e4f7b64c194b2db534ff5bad42a700fdaed6fdfa46f92b6149eb31f06ca"}, "/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": "f941760953ac33a970732c9d6f7c28b329a81de36ad01e9cb32034f8e77334bd"}, "/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_Stage._changed_deps_Stage._changed_deps.return.False": {"doc_hash": "fbb8e6db5aa55ab772eb0e85176ba4b685d01dc53ccba96d9d65e17c63d6acef"}, "/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": "e04fca53cfdc0742e3b926609f50b2427b0ad0fd3c27bce1b3b8e0b1fb80ded3"}, "/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": "8e9096c8bf7115b04d4e23c11dc1aa2398afa7b1f9d5ae227033fb50f13e6b10"}, "/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": "ca53a7b263e68dc7ed1eca755d128324596b0088e129dcc84bf145a203958a78"}, "/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": "cb85b30f1a53daf857ac0cc0c7d5404aabaf006189b165a41ba3502910fea068"}, "/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": "e9c19e97e33fdaa0298f56432ae26e4787e91d39b73f5d3cf5beb1a5f2e0204b"}, "/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.run_Stage.run.if_not_dry_.if_not_no_commit_.self_commit_": {"doc_hash": "9d897e4cd72fdc09332493988cedd543d910cff4078c2db9a609ea238b658a68"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage.check_missing_outputs_": {"doc_hash": "c554905ae76cc79994f25092f6e40e0ef69e10bb3a76878c475da1963d6c7bd7"}, "/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": "3bc6699954cc624d7d20a0de556290738565831e08eefd1a71e2074729c78f9e"}, "/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": "4d5d211143aa53374eeaa8558735650e9a3e7f229b68568ce5617b5a69be2c1d"}, "/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": "f0d60c46db6cbc600b6a09663428cfe4df2042d485f2900de7c72c855ef5367e"}, "/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": "eaa2f94a1be69fc5aa5ab9d79150c2ded1819718e53f457ad2f1c2272632914f"}, "/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": "dc282eca2d31228fa3b67610cd5ae874f5939f8ba27472e49c355148127f7873"}, "/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": "5704f2086301a6a8729bdcd9eb35bd8f67081b0d16cf0bcea8a5a52fd141d28c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System._reflink_windows_System._reflink_linux.return.ret": {"doc_hash": "dd7fc757a506f747dde6a05d600956be5cc6418a01275367800c71883db2db3a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System.reflink_System.reflink.if_ret_0_.raise_DvcException_refli": {"doc_hash": "76a66c3be5cca8b5858265d031f256113e56868ea07b0737e1b495534d6fca15"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System.inode_System.inode.return.inode": {"doc_hash": "fdf43391e4beea1c303b93290a9195d743d0db57cf005103bd2e04f44afcf1c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System._wait_for_input_windows_System._wait_for_input_windows.if_rc_not_in_WAIT_OBJECT.raise_RuntimeError_rc_": {"doc_hash": "b4704775075c72b107fc79d774e3912795732ca0cf27827c55f4b580a10aeee4"}, "/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": "4b1c9c1825cffef111a771b8b0104e395f2c9682a2400886a55a78c7d81fcaed"}, "/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": "e2967f79fcdb7012adf61bad1a94d9eea67cedd92a970079cb52f22cb44127c1"}, "/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._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/scripts/hooks/hook-google.cloud.storage.py__": {"doc_hash": "256bfd168f99306f3d2eaaced6aa70d2d9b94fb8982b895ad1c77ce72200cf54"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/hooks/hook-google_compute_engine.logger.py__": {"doc_hash": "da126273167e3367df6b4152ac179e4638b8dacd8c4935b9540a059fdb34a4d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/innosetup/config_gen.py__": {"doc_hash": "84992c09e93bd47422614ca7a3efcd2044d1648e9ac22196593c65b6851a7039"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/__main__.py_os_": {"doc_hash": "313a28b2c4cd32d51fa012c771cbb07abb2e888ba4bbdbe8c97f2434efac2fc0"}, "/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/dvc/stage.py_Stage._compute_md5_Stage._compute_md5.return.m": {"doc_hash": "beddb383be1696b364a017185f730827bd4ce9b78593b27e95786396d6234a34"}, "/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": "c61a8d8c4cb8d8e9aac906e95ac810f26d09996a7595b7af81ac0730b9deae44"}, "/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": "f56ca545e7c9a5979c7d6e7843e084ce7bd7a8574357b1371c5a2676df508c2b"}, "/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": "edd97d1012fce66a747aab638886a5937d3bec74f40dabeac7ea11fe83169efa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/fs.py_BasePathNotInCheckedPathException_": {"doc_hash": "f35b36a80e27a7779ad62776a37572109bd5a11d89344b635cbdb5e4df94c0c5"}, "/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": "9b88cb497ff921b0c5c8a3f432dc473940eb613577b59c5fe2040b49425240cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/add.py_add_parser_": {"doc_hash": "f4d7a81ece968b18946ecbe2e329b3aaab8aaac215d281e4cae5e4513d0b0844"}, "/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": "e1de35abae87dc893a8c4de6b3cd53a7895c5890f505127f863b8dfbaca7b50a"}, "/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": "5185b7f21f245d75efe364b2282dc63bf780ddff02d95d736a73cfe6eb09f289"}, "/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": "00f73deea2fc3ca4413e49d9306b880a477326bb4a7ad5e830ccacd81b93d995"}, "/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_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": "ddb0362af229a5355bead0f3915c1cd3dfe00fa2fd2ab301e67bfa00a8987173"}, "/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": "31d8f800fd643a1fbe93d67409f71a93623de27bdb612a1843744210370c3452"}, "/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": "10684c25b2d5d64849602d09c45fd0e8b81db05e1c7410a95b98d1eaf946b698"}, "/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": "fff7b18761bd563cf22337fe6c7ced5cc625bab62e98c69e7821f7cfee3d54c6"}, "/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": "c42b6fa454495029d3dfc0e3555e20b3a5ed0ec8d609d0be2a08ea360269f7b0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/tag.py_add_parser_": {"doc_hash": "456548595c847509430dc4b2bc662510911249326285e9cf9acc80cc305f7c3d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_NotDvcRepoError_RecursiveAddingWhileUsingFilename.__init__.super_RecursiveAddingWhil": {"doc_hash": "953f68b4a535b85a4fb1cfb0c13ad32d5307efdd4b5d51d0d80cbf7f0e0de859"}, "/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": "817b0f2ce1cb04aaffeff0721bce46fabae3960f3a36e43990772a17edd62d19"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/__init__.py__get__get.return.OutputLOCAL_": {"doc_hash": "dbbb8c036fa09bc2775d22cfc82c132296aaa76ae9acdd56764d12fcf7624404"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/checkout.py_from___future___import_un_get_progress_callback.return.ProgressCallback_total_fi": {"doc_hash": "a90a383617019d40d061cb7aa81b2e899f2940e5a959e3f8ba37f0202c0f8a4f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/checkout.py_checkout_": {"doc_hash": "0f5f68052c3684425e6fd922b065b0eb2b1591c1b1267a9b0988d054ea02b607"}, "/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": "a3396e7067b1a836a733022249a70aaf58b9e0bbf083eedd279b730a66841824"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/show.py_show_": {"doc_hash": "598cd8433faa8261e3bd637b3745d88a411dd7a04ff0eeb3198ce678ac3bba34"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/scm_context.py__": {"doc_hash": "7fa4b14fc72e63a564e4af3b60ee0ec39aee4a133d6b83c5bac44dc1d2d3cf95"}, "/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": "f82650cf9d771f04b125967e352d9d307cb0b4056b9e3a9e77a8417a4e7fdf52"}, "/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": "023c77bcfc4a79bee20866baf15e3c027b992525c152d57340a7a6cd4418ae4b"}, "/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": "19ba8090c4e9c611fbf5e45dfdc4a59f697ea7aaec47a86e7b1f82070dd460f7"}, "/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_Git._get_gitignore_Git._get_gitignore.return.entry_gitignore": {"doc_hash": "2f4474ef264e3771eb7cd5f6216b7ef111056e0d95a3187537a0ed5bdc3e84d8"}, "/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": "59080bdc0f211b36976a9632953babb9018e05602b0a2d13b1acfe391f3d6e2b"}, "/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": "0f93fca51a57cddbfeaaf74ba7e6c9c4d97b0e4d9a58a02712b97c24feb667ac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/tree.py_WorkingTree.walk_": {"doc_hash": "190572e67f2c11021a351a6be95b7bff4e9c4ba713a1e3da576d26782958ac77"}, "/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": "915a312d4b24ebb472d5ff7c7842f65a21cc627a5cfc64f21b76c7812a576edb"}, "/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": "072277092ef7cc6754f6bae8f8abc59bdc8f2b7bfd14d6fd2c92134c57e4958e"}, "/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": "928faac9e43a9d8be0d505e7ac63fd628fb8166fea71e49ee0bd25fc70dbc0d8"}, "/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/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": "be7ffce4e1b5f8712bcca3881f88da1fa319a3910c4e81bd4b20446dc023a8fb"}, "/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/test_azure.py_from_unittest_import_Test_": {"doc_hash": "bf5a09d24382adb7984cc0597365619b224655e553efbdfe2777b75ca56ce30d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_base.py_TestCacheExists_": {"doc_hash": "5f0b7b59b124428e3f85fd72562f7f1d74f75e4962ee26b5384276b4ca9c71f7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_gs.py_mock_": {"doc_hash": "f826db4c37738a62607ffba469eaa9c24b43300864003d2ca81f38e6f686a17b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/scm/test_git.py_os_": {"doc_hash": "853fadc7e0245e4f0bb6f8e9565c3359672cf5a27ddcf6d5afcdd6e1731b1fcd"}, "/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": "9ca3d8793f8eea9e8ecc7102ddf9e5d17bccee5abdb6b8945a31885b4f0e3c08"}, "/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_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_updater.py_os_mocked_requests_get.return.MockResponse_version_": {"doc_hash": "99695297cba30c5d7883ca7247f1a90722897013ffe03bf902aeb02f729a8b3f"}, "/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": "dd8c233a08b6959fd09056962470d9b41f48276e356f07799dbf7fc380675a88"}, "/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/dvc/__init__.py___": {"doc_hash": "c282218d4e20374a2d8975792deb17ebf77874ef59d84b2370caccb6ba3b631a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cache.py_Cache._get_remote_": {"doc_hash": "343ff2d8a998429597fc8c848a69a27c00df8c49c1965b7e692bcb787e908a76"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/diff.py_from___future___import_un_CmdDiff._get_md5_string.return.sample_msg": {"doc_hash": "8c39bef75b532908b9fd60b81ef9a0e0dab2a2fa4646d0714891245117b96623"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/diff.py_CmdDiff._get_dir_changes_CmdDiff._get_dir_changes.return.changes_msg": {"doc_hash": "730b735780696c37e0d9562a0abde0525fc2847235ad25fcea133c972b33ec51"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/diff.py_CmdDiff._get_file_changes_CmdDiff._get_royal_changes.return._size_is_": {"doc_hash": "422b3bfe68aa4270468b434a088ca5551febc8eda9a666ed5b775da03b2ec98a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/diff.py_CmdDiff._show_CmdDiff.run.return.0": {"doc_hash": "c485287f50ee3d51ca6e963b3f622daeb426cedba1da134121ca3af9e59ffee9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/diff.py_add_parser_": {"doc_hash": "57d6080eecddfd020fc575714a4e91c8678027dba7e8948c1b3770e6bbc1baa0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_add_parser_add_parser.None_14": {"doc_hash": "39ab96ebdaa7f5e934239986216f833ce737879133bb8c7f0e3662cb99a3f840"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_add_parser.metrics_modify_parser_set_": {"doc_hash": "7f81f9d12231c26051c2e408314edd1a8f12b43de8b7573e76ec119a7aa079a8"}, "/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_nodes_.if_commands_.else_.logger_info_n_": {"doc_hash": "51e605f06aa5907627eb1cef5bca581c573a5042ad7d380f45f56a42415aadd7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/tag.py_logging_CmdTagList.run.return.0": {"doc_hash": "d95c43c31e84826951dc78dd61bbbcf5fdaaa1ede23dcd91256b381e66d0fd8e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/daemon.py__spawn_": {"doc_hash": "84e87e9da94fe3348cbccb44a454025e489510836bf789fd4006aced62f20b19"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py__Manages_dvc_remotes_th_logger.logging_getLogger___name_": {"doc_hash": "e4950bf39f188e10ef472432504cee89137545dab5fcb7ea9509eb3dd243e8c6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/env.py__": {"doc_hash": "7af401eec268000fe0a550617452f119bc0adb200ce5265cbad7a13990bbab65"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_OverlappingOutputPathsError_OverlappingOutputPathsError.__init__.super_OverlappingOutputPa": {"doc_hash": "65faa7f033a27e020ef6e33fde7f43e36adfdc3a46beb5fadcb89fa5e5c8cfce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_TargetNotDirectoryError_": {"doc_hash": "42cce8a2b3c61e58efb92d1b99ece9207482716a086470fa4d6d63e5763f4ae3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_DvcIgnoreFromFile_DvcIgnoreFromFile.__hash__.return.hash_self_ignore_file_pat": {"doc_hash": "cfe720fdb9d76ff73bf30656ef770485fe7b7b00773ae6a0f153e0e7f363dc3a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_DvcIgnoreConstant_DvcIgnoreFile.__call__.return.dirs_files": {"doc_hash": "0a40534d86765bc02a3bbdc737923c87d7f9716af8b852cc5fa229d67a9322a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_DvcIgnoreFilter_": {"doc_hash": "777c811e38d25ff36f4ca462683135e2f62625211a919c6525fdde2aa57d147f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py__Manages_logging_config_ColorFormatter.footer._": {"doc_hash": "c6830d0f64cf69feb635ff9a73314d75d9ed0362818bd43b1b331d761244b724"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py_ColorFormatter.format_ColorFormatter.format.return._color_levelname_nc_": {"doc_hash": "927c735d1f6ddb2d50e559213d06fc7645053075cd312a0d4077ebbbb6fc2f2c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py_setup_": {"doc_hash": "4e8b7c3ab6f539c096806b41d82ee2b3298123e94f686e259201fa6e3eabe40c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.commit_OutputBase.dumpd.return.ret": {"doc_hash": "5fcfa0fb586df3e53be39bbc6936decd34f8d0f5b917b4e4f39ce04e9c949637"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3_RemoteS3.get_head_object.return.obj": {"doc_hash": "0287732a453616c0a4fe60bd3328ce20865f5dbd856ac8b9fb663be4eba81172"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3._copy_multipart_RemoteS3._copy_multipart.s3_complete_multipart_upl": {"doc_hash": "25dad20f9f620819d7429cb22d2489b9b3319a1c2f412ef8e79fd59b6ae0c766"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3._copy_RemoteS3._copy.if_etag_cached_etag_.raise_ETagMismatchError_e": {"doc_hash": "fa44bcc933a6f3e97533bcf6f5f16bb37fe95e2f7a28662e703811611bd02146"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.walk_SSHConnection.walk.if_not_topdown_.yield_directory_dirs_no": {"doc_hash": "7483240608232b32771fa6c2364162ec771cf70307038ca02602bec073ae9882"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/diff.py_from___future___import_un__file_not_exists.if_error_errno_ENOENT_.else_.raise_error": {"doc_hash": "b1d58cd8a779d6a2097bcdb960441880d0e3f33bf7a79805889b342b042518c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/diff.py__extract_dir__extract_dir.return._": {"doc_hash": "cacb81ae36592be100a60fd2f84d3757634d2eeef00f6cfff5aae0220e722964"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/diff.py__get_dir_info__new_files.return.new_count_diff_size": {"doc_hash": "fd8f443aa692990c5fd4d32f742dcfd0e2cef32cf54c744319cc0f0abc7d7c9f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/diff.py__get_tree_changes__is_dir.if_a_outs_get_path_.else_.return.b_outs_path_is_dir_check": {"doc_hash": "5dd2164edb92a6a7652dc88d04367e6c9c86b06b1157f6b1d78550df50711f90"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/diff.py__get_diff_outs__get_diff_outs.return.results": {"doc_hash": "03e1b8afa5c6d9f3896dc7cfdcc7544ea014d3cdb391978a4ec231ddea3ba790"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/diff.py__diff_dir__diff_dir.return.result": {"doc_hash": "a66a87dae49a8ff48589aeae99005574f755ff0d41e9b52581ab127b710d82cd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/diff.py__diff_file__diff_royal.return._diff_file_self_target_": {"doc_hash": "844adbdaea76acb519b5e7f4280331b95af6fd0af2426f25ccaa74ceae43133d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/diff.py_diff_": {"doc_hash": "ae90220a0fe5124c08f834abd012fc6ab274ffef23c03aaaafca378166764062"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py__Manages_Git__DIFF_EQUAL._equal_": {"doc_hash": "5f5f669d19153f6dc8e8b6523263131367e1a6e660e42b4c5420f33196f8688e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git_Git.ignore_file.return.self_GITIGNORE": {"doc_hash": "397c452a398e0d639c4412faf9de348137d3530888083379409ab53989378768"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git._get_diff_trees_Git._get_diff_trees.return.trees_commits": {"doc_hash": "f4081efb233c46f73759fd3d8555be124e762edafde00899ced76fc3806b79d9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.get_diff_trees_": {"doc_hash": "6c56a613dc4f46b187545534b2b8649d0d5b6514b389d82aa23ebfe952e34571"}, "/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_data_decode_utf": {"doc_hash": "3537a323fe26613bc6898b4ce3671a7f088baa039d9e3a2e8578f71c3dbe8ff0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_GitTree._walk_": {"doc_hash": "e50544139c0cd01afa393cc6ef608f1cbbdde6564fe7a425fc98cc20f68c0475"}, "/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.True": {"doc_hash": "67a47c1e5f7ed30f845db7ea9880b8250b2d8df55e812069fe52429bc28ed8aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py__Manages_state_database_StateBase.save_link.pass": {"doc_hash": "16442388da3140d62537510e11dafb15fda7ed96c56b460f30e5a63129f00e84"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State._file_metadata_changed_State._update_state_for_path_changed.self__execute_": {"doc_hash": "03c5e022f9d3ad4acdbbb86a8f344a72cf71bb8f1f4e6de18368c0b6804b0c6d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State._insert_new_state_record_State.get_state_record_for_inode.return.None": {"doc_hash": "ce8c0fade2f6e12e86b61242e7b0bb8d2e1c6189f00ad5e0f2b7bafdedbf5a17"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.save_State.save.self__update_state_for_pa": {"doc_hash": "d0aa207706f044a14ae4b108a8feabeeea6263e0481882167776f9f1ca4c3181"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.get_State.get.return.checksum": {"doc_hash": "5b8a189a7280e2136de204b5ccb6b06c54b7277c3c64a06f43d743133dfd3e00"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater.fetch_Updater._is_outdated.return.parse_version_self_curren": {"doc_hash": "258d7b723915f9d04a43d9762851b7b9667f9895ed9bacc925b24a4dd466871a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater._notify_Updater._notify.logger_info_boxify_messag": {"doc_hash": "0922f33855ba11ebeaa74e9527a6fdcd2a22a564357ddcd31df1db106c97d4b2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_move_to_yaml_string.return.stream_getvalue_": {"doc_hash": "de826c552dbb597837648fcd8ceb13241199aec2c9ab2b1421a3bde2b767ffc3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_dvc_walk_dvc_walk.for_root_dirs_files_in_.yield_root_dirs_files": {"doc_hash": "f55bcb70ceb97e0fe561681d802bffa33ff7bb6dfa5175cfa019d492e4ec364f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_walk_files_colorize.return._color_message_nc_fo": {"doc_hash": "0f620071f0b6e45cad1310b1ccad2db9f435c9c48bdf45ba02400e0fdb3c9b67"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_boxify_boxify.return.box_str": {"doc_hash": "53b8e5bb1187fae6f3bc1b06591fca1068704c81933c713deccfece5e4bbb7aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py__visual_width_": {"doc_hash": "c06d1a30c41e66e6af872f93135c306d47db1bca383e525d031d8b5d45549bef"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/collections.py_from___future___import_ab_": {"doc_hash": "e12a21ee50d231c990e36b934346d2250a5f426af883536475417b06bfe23b34"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/stage.py_from_dvc_utils_compat_imp_": {"doc_hash": "0ea6160789231d4e42bfc1c1fba51fe809d0e94faadedd433f8107e7abfa469b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/version.py__Used_in_setup_py_so_do__generate_version.return._base_version_short_sh": {"doc_hash": "442678e8aedc2155a6878e249498c1cc2034464d86ea06c107bd9f9ee062182b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/version.py__is_git_repo_": {"doc_hash": "d7057213128d6d43ef4fd3e56e002621d6d9a3a38ec5dda59a154a752297767e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_from___future___import_un_from_tests_utils_import_s": {"doc_hash": "7930972088f716c884f9b5d2c350968300f65cd50f7904a62f794778ab2d02d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAdd_TestAdd.test_unicode.self_assertTrue_os_path_i": {"doc_hash": "443cd4bc9abacf2bde42f2c1c37d264571e82dadf0f418a22a5de5b3ffb02d3a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddDirWithExistingCache_TestAddDirWithExistingCache.test.None_5": {"doc_hash": "8c55e738d001a6ef2a306b5cdb22bff1e48612debbb41481f3c96b9a0dd7dd61"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddModifiedDir_TestAddFileInDir.test.self_assertEqual_stage_re": {"doc_hash": "aff241cc3db57bd74c27523164e61eee6b1b9bca19923e9cee9cc84c382eff32"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddExternalLocalFile_TestAddExternalLocalFile.test.self_assertTrue_filecmp_c": {"doc_hash": "f2142f640aa3a88a1272c7bb3d9f80564b3fbb13268cdd92cf989a9d4fd57349"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddLocalRemoteFile_TestAddLocalRemoteFile.test.None_4": {"doc_hash": "0760939874b995c675d1ebaca4410b185182ac8f0e567ef282447d382e464bc1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestCmdAdd_TestDoubleAddUnchanged.test_dir.None_1": {"doc_hash": "5826619b9a822bd6c9b0db85665896b80e6bb879d2056d697f768d6f59623a17"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddCommit_TestAddCommit.test.None_5": {"doc_hash": "0da9d22c4f961e9d26e1af0c03c09630e5e9a0a56c001b2479fee8010dc27347"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestShouldCollectDirCacheOnlyOnce_TestShouldCollectDirCacheOnlyOnce.test.self_assertEqual_1_get_d": {"doc_hash": "e5fb0b8f0676f9239c2f53c06c395d84e807b435a8ca986b6e55cefb926b9214"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_SymlinkAddTestBase_SymlinkAddTestBase._test.self_assertEqual_relative": {"doc_hash": "e9aeace6bc8216dfb73daffcb89d2e063708e831817d726c63c615fb27ef84b2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestShouldAddDataFromExternalSymlink_TestShouldPlaceStageInDataDirIfRepositoryBelowSymlink.test.with_patch_object_.self_assertTrue_os_path_e": {"doc_hash": "956dcfa1d1c0db1db8b1d803eab5fb15c22de1be44c7fd59d6b827e6be971888"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestShouldThrowProperExceptionOnCorruptedStageFile_TestShouldThrowProperExceptionOnCorruptedStageFile.test.assert_expected_error_in_": {"doc_hash": "48fb08bdc913a95a85e846d636f602eb2daaf58a48ebb5174e34a04f26c263ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddFilename_TestAddFilename.test.None_10": {"doc_hash": "a3629ac604b953a37dff765ca0777cfdd5df2d2750e492ae0a3e4e30c41d2223"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestShouldCleanUpAfterFailedAdd_TestShouldCleanUpAfterFailedAdd.test.self_assertNotIn_se": {"doc_hash": "450762c5511bacfb928810ad8905e562aa7332d60906eb181d88c7d1f96222ba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestShouldNotTrackGitInternalFiles_TestShouldNotTrackGitInternalFiles.test.for_fname_in_created_stag.self_assertNotIn_git_": {"doc_hash": "5d4cdb608fbd33090559bdedd1ec44bed2a301f47b7486fc4cb71854af8fa88a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddUnprotected_": {"doc_hash": "1a5235352847a186bcfff9e5095448d1e0db5d22ac4fdf9cfaa975ba791d3131"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_analytics.py_os_TestAnalytics.test_send.self_assertTrue_mockpost_": {"doc_hash": "dcca6d93c9c1496de3c331be9f21e2cc6f10e852a898854e1085a6495187d8a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_analytics.py_TestAnalytics.test_send_failed_TestAnalytics.test_send_failed.self_assertTrue_mockpost_": {"doc_hash": "50fd9b06d8e5d59ac5a0a02384a540a634342b14a722d070423c24deac9e946d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_analytics.py_TestAnalyticsGit_": {"doc_hash": "63bde2842dac0fab27252782aa89f33bd12998d8c94534c600509476e35ee515"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cache.py_os_TestCache.test_get.self_assertEqual_cache_s": {"doc_hash": "4efa33b68b5b0f536ae652c4922455d39ab89f9fc0a3a4c7977209faf32fe949"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cache.py_TestCacheLoadBadDirCache_TestCacheLoadBadDirCache.test.None_3": {"doc_hash": "c58ec44b5b6885b00800ab68c67ff6cea5683428390f91c6af1a6d0a8b08572b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cache.py_TestExternalCacheDir_TestExternalCacheDir.test_remote_references.assert_self_dvc_cache_ssh": {"doc_hash": "0420fd26c8b218b9237bb5c68170b98f680f7376c693226bca0746928b259b50"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cache.py_TestSharedCacheDir_TestSharedCacheDir.test.None_5": {"doc_hash": "f1889ae88dabd1ccda66f4beb47661d4b8bddf73d0df30182f9869e504240e13"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cache.py_TestCacheLinkType_": {"doc_hash": "200134178e905b194ae116ece7dbcfc723264fc01216bd5987aec8a91cdd4015"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_os_logger.logging_getLogger_dvc_": {"doc_hash": "777d0a55ca91a871b38cf8e0b7e93bd4c41bb9845c01344a32913214236e4232"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckout_TestCheckout._test_checkout.self_assertTrue_filecmp_c": {"doc_hash": "853bc3c35b09aa423d3058e0a418cd9fce5c792bacf52ee0bd7f8dcf1b48b38f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutSingleStage_TestCheckoutCorruptedCacheFile.test.None_2": {"doc_hash": "21abf549f763c9c477642a18eba97bf860e3b6b891051f38537f9eb62935566b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutCorruptedCacheDir_TestCheckoutCorruptedCacheDir.test.self_assertFalse_os_path_": {"doc_hash": "139973a15af66217c454276af9821cf4143136440c0a0216918c9349564f342a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCmdCheckout_CheckoutBase.outs_info.return._": {"doc_hash": "62eed42ba70a8c4dd945a16959d6ac8b6fc785db0593d04cc1da75858dc7c6bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestRemoveFilesWhenCheckout_TestRemoveFilesWhenCheckout.test.self_assertFalse_os_path_": {"doc_hash": "f22ebf106cec84e9982f621aac5edf678a11e8933d94c3782d45d5049c29f0de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutCleanWorkingDir_TestCheckoutCleanWorkingDir.test.self_assertFalse_os_path_": {"doc_hash": "d017d0b1a56ec16037090cc79f8373bf24f4a28145e68a738ea5a2df452bb9e4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutCleanWorkingDir.test_force_TestCheckoutCleanWorkingDir.test_force.self_assertRaises_DvcExce": {"doc_hash": "3288548f7d9143dbffc713e86159c9f844ac12876bbd2af20e5bea7dfce1bc1c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutSelectiveRemove_TestCheckoutSelectiveRemove.test.None_7": {"doc_hash": "4f9e36a8e1f15add2da2c16e1d8fbd991b4c8ee0d199a6ae48e86d23e2e9be92"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestGitIgnoreBasic_TestGitIgnoreBasic.test.None_9": {"doc_hash": "db0929b6be6c8e9dd7afbada9eb2fd2cda50031d14180d2cae3492285eb4a4cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestGitIgnoreWhenCheckout_TestGitIgnoreWhenCheckout.test.None_12": {"doc_hash": "1a8f7704d6a7fa45f7e40be1759d6d6e8470dfc1a47743a5cc412605faa768b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutMissingMd5InStageFile_TestCheckoutEmptyDir.test.self_assertEqual_len_os_l": {"doc_hash": "d2ea3052fe19b4f21e67ef1627739c88ef6aed1bad87253f3b36e65c3cfa7ade"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutNotCachedFile_TestCheckoutDirectory.test.self_assertTrue_os_path_e": {"doc_hash": "5d38ef599b71e5207576d9ca69c61caccc0f08d6f6154e65d747d590c1d13c19"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutHook_TestCheckoutHook.test.with_self_assertRaises_Co.self_dvc_checkout_": {"doc_hash": "ecac212801ab7329ce42c59a9143b851cbdae03611e47140f161d0721692b650"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutSuggestGit_TestCheckoutSuggestGit.test.None_1.except_DvcException_as_ex.self_assertIsNone_exc_cau": {"doc_hash": "1b9b04af267a812a019eae6e8980eef8c377c11b3169b030ec90324a60e1b2bd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutShouldHaveSelfClearingProgressBar_TestCheckoutShouldHaveSelfClearingProgressBar.test.self_assertTrue_finish_ba": {"doc_hash": "116f74a676efcf703baf2e50921d457afebf29ed96f7e9287e3865a4f55d72be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutShouldHaveSelfClearingProgressBar.filter_out_empty_write_calls_TestCheckoutShouldHaveSelfClearingProgressBar._prepare_repo.os_unlink_self_BAR_": {"doc_hash": "cc9748e4ad4b07fefe9217bc28b5d9d562191bde5d4e8b3a6f3898075fe6a45b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutShouldHaveSelfClearingProgressBar.assertCaretReturnFollowsEach_TestCheckoutShouldHaveSelfClearingProgressBar.assertAnyEndsWith.self_assertTrue_any_ub_fo": {"doc_hash": "dab70b0d312278515154dc4e5f49dab8ec8bb8a3dd8a2070524c0536ddda134a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutMovedCacheDirWithSymlinks_": {"doc_hash": "24305b39c32c846477eb5f93426f66c82bb1c83c9700f3a4e4944471443f40a4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cli.py_os_TestArgParse.test.self_assertIsInstance_arg": {"doc_hash": "637e5dae29e6ccbe2feb21e8981ccce6a7241b9fcbdd2204f78ab83391e11db7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cli.py_TestRun_TestRun.test.self_assertEqual_args_com": {"doc_hash": "49a40c7c199451bef433b72c22a807fe9d099c41811f8e24f7c49c5c3df33ad7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cli.py_TestPull_": {"doc_hash": "086cc3727389af1ff8e9032a1f1a4f74d7ca9d45b98a0e1d68fac6ecd6c66c03"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_config.py_configobj_TestConfigCLI.test_root.None_1": {"doc_hash": "3bbe96bddd075b62b256595b00241998dc4663e1054ec5db60896e4ca2c9dc50"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestDataCloud_TestDataCloud.test.for_scheme_cl_in_clist_.self__test_cloud_config_": {"doc_hash": "0ee9d1ee54b2fc5ce4c011ca63b8bd752ba9ba8d1eb43e44a255519bf93e75e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestDataCloudBase_TestDataCloudBase._setup_cloud.self_assertIsInstance_sel": {"doc_hash": "29f6cecdc458b75a01d5e62653b2d2b222d4861fdf29868938b68eb228a08612"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestDataCloudBase._test_cloud_TestDataCloudBase.test.self__test_cloud_": {"doc_hash": "a9de126f01ed0abb76eea60c121e291728552ab4e0af6ea5b77b4a0eee1f0055"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRemoteS3_TestRemoteGS._get_cloud_class.return.RemoteGS": {"doc_hash": "5e1080c81f08e9a68be45285cc22391233807d24acb7ba2387989810eab6d675"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestCompatRemoteLOCALCLI_TestDataCloudErrorCLI.test_error.self_main_fail_fetch_": {"doc_hash": "8348f17ee608997adda2e215a194e63a41a27034f4c9b07f59a0dee054cc3b38"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestWarnOnOutdatedStage_TestWarnOnOutdatedStage.test.self__test_": {"doc_hash": "05f2614ee040d1ea7da8caab37fd6517a06489e3352c3c4a677d159fa9a7f6a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRecursiveSyncOperations_TestRecursiveSyncOperations._clear_local_cache.shutil_rmtree_self_dvc_ca": {"doc_hash": "bd6f3d3d08ea0b50dd6fcea449072e65695b5edf09c51513d8d3cd698e823b7d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRecursiveSyncOperations._test_recursive_fetch_TestRecursiveSyncOperations._test_recursive_fetch.None_5": {"doc_hash": "b3d8eb592a34c18730907b2f359f14aa62a16f0ebd74851e1edb42553ca030ac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRecursiveSyncOperations._test_recursive_push_TestRecursiveSyncOperations.test.self__test_recursive_pull": {"doc_hash": "751847692d547c5789d62a94d68578eeb13dd93f979f70f1df3c458bdc528995"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestCheckSumRecalculation_TestCheckSumRecalculation.test.self_assertEqual_test_get": {"doc_hash": "43090b87a64f91e2740080026bbcb143f9d8cce5fd361f6cfb616959fc35d36d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestShouldWarnOnNoChecksumInLocalAndRemoteCache.test_": {"doc_hash": "165df387d455f1f2612b5535f98b0df17ce8afc048843be53b2d3f19e8f033f0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_destroy.py_os_": {"doc_hash": "3f376cfb8b3b2669b48f5a62c6ddbb22e4f17812ffe5eaded0a18be7a2100c6d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_TestDiffDirRepo_TestDiffDirRepo.test.self_assertEqual_test_dct": {"doc_hash": "b751249234a893e186f4d009dc00e554238383b6090a8295f4d055e7c78ef240"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_TestDiffDirRepoDeletedFile_": {"doc_hash": "af2393843db81377785fe3318c0cbf69a3af9c3067d5697b0d119b4344e5b195"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_os_TestGC._test_gc.for_c_in_self_good_cache_.self_assertTrue_os_path_e": {"doc_hash": "43b3789b42422dfdf20afe229fb4fae191c74ce03769c1cc3f1bac4d1e95be95"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_TestGCBranchesTags_TestGCBranchesTags.test.self__check_cache_1_": {"doc_hash": "3671358674156dc0beccdd6e5e7bdfce40e678a1d8580540d82479ed9f520139"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_TestGCMultipleDvcRepos_TestGCMultipleDvcRepos.setUp.self.additional_dvc_7.DvcRepo_self_additional_p": {"doc_hash": "89d32b0b399ecb8cb422c76e303d1fa618d9afb550ac8f1525b77cceebd3676c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_TestGCMultipleDvcRepos.test_": {"doc_hash": "a9e89ea6c26df6c5823daf4df5851a2142f6be60398155e965f0ec3e652b1e2f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ignore.py_os_": {"doc_hash": "9df3d66e4b2208c086ead105edf8a64bea71e159c59fd68a02afc728ae7cd6b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_init.py_os_": {"doc_hash": "bc89e8cc222f3e9c78ffc84ab279b407dd2ea7aacb540c2045d2b9f581294695"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_lock.py_from_dvc_lock_import_Lock_": {"doc_hash": "604a75613cfa4c31b078e250c7ccb73cf4c61d9226c37cc00e8d7fa8e8cfed56"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestMetrics.test_unknown_type_ignored_TestMetrics.test_xpath_all_with_header.for_b_in_foo_bar_.self_assertSequenceEqual_": {"doc_hash": "a2753f9a51deb609b4e99ef3e37b07509d05c6e4b3725f658bd32f7da016615f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestMetrics.test_formatted_output_TestMetrics.test_formatted_output.expected_tsv._": {"doc_hash": "92ba0fdb0804a442589311533ce924f93c2ac4c53aa60ffbcd862e92da7ff80c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestMetrics.test_formatted_output.expected_txt_TestMetrics.test_formatted_output.assert_expected_json_in_s": {"doc_hash": "6af28733cc69ef6493192c7b14a33f1326a1ab55c197f77dfad8cebbe6cf4bfc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestMetrics.test_show_all_should_be_current_dir_agnostic_TestMetrics.assertMetricsHaveRelativePaths.for_branch_in_bar_ba.self_assertEqual_": {"doc_hash": "776b80fc9d8aefbf1c3608e96cc3957c75c719224388d42c872fdf1521bbed75"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestMetricsRecursive_TestMetricsRecursive.setUp.self_dvc_scm_checkout_ma": {"doc_hash": "82e4bff73e2b0a686ab461a93be898c6299c0036ad82c2511a864279d9eed60b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestMetricsRecursive.test_TestMetricsRecursive.test.None_2": {"doc_hash": "27612023f90221d025400f8c7f28baca1a4e8837e700fcdd6493db4f09c54da0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestMetricsReproCLI_TestMetricsReproCLI.test_binary.with_self_assertRaises_Dv.self_dvc_run_metrics_no_c": {"doc_hash": "12096356474bd441ea526e7f3e45adfe99e1e96fb0d9d308e8af7378ef31c88b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestMetricsCLI_TestMetricsCLI.test.None_5": {"doc_hash": "2318a054ff345279e0e5d3c3ffac42205c141a083eddbf856ee75c62af3f3fa7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestMetricsCLI.test_dir_TestMetricsCLI.test_non_existing.None_2": {"doc_hash": "abe21195d1fd1c89d4dd7ba5368c3b74d452e7bdeb4457a60da8003770217eb0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestMetricsCLI.test_wrong_type_add_TestMetricsCLI.test_wrong_type_add.assert_tmetric_unknown_": {"doc_hash": "491cd5f50d463a88c524734978188000ebee1d1d6396c00f5d2f4ac845d9835d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestMetricsCLI.test_wrong_type_modify_TestMetricsCLI.test_wrong_type_modify.assert_tmetric_unknown_": {"doc_hash": "c03ac1f7c2b234426d5a99ba369b14fcf7879fc0f4744fe3182e85d3a0aaada0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestMetricsCLI.test_wrong_type_show_TestNoMetrics.test_cli.self_assertNotEqual_ret_": {"doc_hash": "b3d08d5a6ebfc53f7de8d8356be4bcd9c649dcd5417d03126fcfe88d75f46355"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestCachedMetrics_TestCachedMetrics._do_add.self_dvc_scm_commit_branc": {"doc_hash": "3a0db011382a500d290c8dd80af07898e6eb707fa22f32f2489a83c2f3526617"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestCachedMetrics._do_run_TestCachedMetrics._do_run.self_dvc_scm_commit_branc": {"doc_hash": "bc1ff53ccdcd820fdf532827f8db6bd740542e5c7fed165d24959e385f3cfe71"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestCachedMetrics._test_metrics_TestCachedMetrics.test_run.self__test_metrics_self__": {"doc_hash": "a11cceee1088c6828d5915b9634b3c9da5f7bcd1ebd0bc6050484111663423ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestMetricsType_TestMetricsType.setUp.self_dvc_scm_checkout_ma": {"doc_hash": "7bdd456f1711c8802c5239682cc5ed895b190a1a95dfde3f71530e2658fae24d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_os_TestMoveNotDataSource.test.self_assertNotEqual_ret_": {"doc_hash": "7af4834f0f009c2986d3d494f2880b8dfe54077963b10ea47d1f17d2fbe41305"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveFileWithExtension_TestMoveFileWithExtension.test.None_7": {"doc_hash": "17f900b6fc674b75eeab0164f8a94f06e441f8943a1f65caf2b48bfbb03beadf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveFileToDirectory_TestMoveFileToDirectory.test.None_6": {"doc_hash": "f2da472bc529e1106dacecb96d0f8926518a3c22d816fac0640f0d6cba26c49a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveFileToDirectoryWithoutSpecifiedTargetName_TestMoveFileToDirectoryWithoutSpecifiedTargetName.test.self_assertEqual_self_FOO": {"doc_hash": "f3f1899df392bc67f15426ec6c2ba0f32f2a0b21c9c973bb013dea86aef7da0c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveDirectoryShouldNotOverwriteExisting_TestMoveDirectoryShouldNotOverwriteExisting.test.self_assertEqual_set_os_l": {"doc_hash": "ee3105aacce2a30d39c843b7adbc44e1946ac3a8909a2f292d1af5f73419f764"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveFileBetweenDirectories_TestMoveFileBetweenDirectories.test.self_assertEqual_": {"doc_hash": "c5a6a1cbe57500a2cb9f6e449de7078cd85539171594e026b1a8f0fc854d260c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveFileInsideDirectory_": {"doc_hash": "4b732651b595ff5d1e3a16597e12cea76cc2253c428df2a8cdedcbc162285204"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_output.py_pytest_": {"doc_hash": "c503923a9b99304e6c04a85812ad0b3985b4a354581ea53059307582d01cc9b8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_logging_TestPipelineShowSingle.test_non_existing.self_assertNotEqual_ret_": {"doc_hash": "023e656b3b75e891d365ebc61c5577322e3c06664f24aec7aa875305bd88c3a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_TestPipelineListEmpty_TestDvcRepoPipeline.one_pipeline.None_5": {"doc_hash": "df448e0170def3aa30517d053f3c499001524be3e334104bb7ebaa7e7acb65d7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_TestDvcRepoPipeline.two_pipelines_": {"doc_hash": "018cfbd6673429f0f9c08e13ac494020ba78104805c4c48923defbd87faf3213"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_os_TestRemote.test.None_5": {"doc_hash": "4a6f41fbf804cf00ffde57b22c998e30a159f6a3e898fef71632f465c97827c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_TestRemote.test_overwrite_TestRemote.test_referencing_other_remotes.assert_config_remote_ba": {"doc_hash": "7fc6ed97633ca0f9cccf52daea1bb988ce6790683f0b1916cceec0ceaaea086e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_TestRemoteRemoveDefault_TestRemoteRemoveDefault.test.None_1.self_assertTrue_Config_SE": {"doc_hash": "4ae44fc280a651625638e574d4167251478ebdd83d5155324fc9e5dd6626e032"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_TestRemoteRemove_TestRemoteDefault.test.None_4": {"doc_hash": "87f5bb643503c7df3237db735429f3d54ce19e2016aa21982ac3e960bf440138"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remove.py_os_TestRemove.test.None_8": {"doc_hash": "3e78a0319fbffaef248ed1f83a1eb53ddad7615f10ad6fe20d5975f87fce65e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remove.py_TestRemoveNonExistentFile_TestRemoveBrokenSymlink.test.self_assertFalse_os_path_": {"doc_hash": "36cea77ff2b2c86f260737052d70c2e3b9127d5cd47dfa9618ae57966eb7d0be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remove.py_TestRemoveDirectory_TestCmdRemove.test.self_assertNotEqual_ret_": {"doc_hash": "6d45ad7cd8faee6663762118d10520645c6308acf979404dc249f17cdda78186"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remove.py_TestRemovePurge_": {"doc_hash": "ddd16381db0e1dd6c725c0e8462e0b3710563f1e4e841e6fa60e1e6510090cf7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_from_dvc_main_import_main_TestCollect.setUp.self_dvc_scm_checkout_ma": {"doc_hash": "78231705445dd83006356e50ce11e2d019d3d1ea3aa0568bb6ba5642a50aeab0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_TestIgnore_": {"doc_hash": "0f44e32d625fd8b1642ee2009ed3e1cc585659dd7413f3077d24952cb2456dd3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_from___future___import_un_from_mock_import_patch": {"doc_hash": "6968a67b1dba348ab6303fd58a625d0139a2b8c3ff9fec41a931f1c3c563b392"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestRepro_TestReproFail.test.self_assertNotEqual_ret_": {"doc_hash": "6e46cff070380084aa3ec23d4916bcedafd4b645cbc61998f14a2812c234cf73"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproCyclicGraph_TestReproCyclicGraph.test.with_self_assertRaises_Cy.self_dvc_reproduce_cycle": {"doc_hash": "59ea9e7c30790a7ed26f0c94df946a5e2c80a979aad27f5f63c4b1aa2b99ccee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproWorkingDirectoryAsOutput_TestReproWorkingDirectoryAsOutput.test.with_self_assertRaises_St.self_dvc_reproduce_faulty": {"doc_hash": "b82882ccce4dcb5f2c23fb65f0aeaf3d14fac9939efd6e2093ac6e7a5f95b7e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproWorkingDirectoryAsOutput.test_nested_TestReproWorkingDirectoryAsOutput.test_nested.with_patch_object_DvcRepo.with_self_assertRaises_St.self_dvc_reproduce_error_": {"doc_hash": "76dfe2fe0f1227085fcdc780df56faec7d117e27995f0de984d709f80c5578b8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproWorkingDirectoryAsOutput.test_similar_paths_TestReproWorkingDirectoryAsOutput.test_similar_paths.try_.except_StagePathAsOutputE.self_fail_should_not_rai": {"doc_hash": "a7cf78f3595b1f3719f48aff28e680c505d03c29370044512fbac24ca5450fd5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproDepUnderDir_TestReproDepUnderDir.test.None_7": {"doc_hash": "d57898a9df729acfcd6429befa8e20df963cec7735fe925be94195dbbfb04ff8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproDepDirWithOutputsUnderIt_TestReproDepDirWithOutputsUnderIt.test.None_8": {"doc_hash": "18f2b338c1bd6ac3ee670293823f90b3f829ca8c4ec5202e2327ae9dca8fc936"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproNoDeps_TestReproNoDeps.test.self_assertEqual_len_stag": {"doc_hash": "092fe692c7640e973b50032b3ee92b7a421e693859b88bc8c0decb43b3932783"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproForce_TestReproChangedCode.swap_code.self_create_self_CODE_ne": {"doc_hash": "2ed5afa03b2d6553bacca9af04f33430254bcbcbe44cb4f944cafa07aae0249d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproChangedData_TestReproUpToDate.test.self_assertEqual_ret_0_": {"doc_hash": "3e420b50f4f3a68c9eb35aa054be4d311a96746d5b196fa264c64ced54e255f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproDryNoExec_TestReproDryNoExec.test.None_1": {"doc_hash": "f21583a9334d4203e8a188bca77260756f418e8a42ed5438fd99dc5382f44dc5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproChangedDeepData_TestReproChangedDeepData.test.self_assertEqual_len_stag": {"doc_hash": "dbb6d9f1fdd64aeda13cf9da90389570b4d6a00139322c2647d7f46323283ad0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproIgnoreBuildCache_TestReproIgnoreBuildCache.test.self_assertEqual_stages_1": {"doc_hash": "be1c8777af498b0b47e27129490a2ac8d9db481c51168514eac81b26f6bc4048"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproPipeline_TestReproPipelines.setUp.None_6": {"doc_hash": "e86184362d51fde1705842a4ae11f4a6402dc91bd1f61ffc7082aa474f41aced"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproPipelines.test_TestReproPipelines.test_cli.self_assertEqual_ret_0_": {"doc_hash": "337e7dfedcad381f99a6bcae5af69c6b00ff82dd8ec07296e593ecdeda1972b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproLocked_TestReproLocked.test_non_existing.self_assertNotEqual_ret_": {"doc_hash": "dd2c8b8ecbd71cf4fc86733795c18353562d84b4a410b85611dffd841cb2bd24"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproLockedCallback_TestReproLockedUnchanged.test.None_3": {"doc_hash": "c71490d41aafc258a9ea15d422ad5fac07d71b1402d1cd4d52f388acb5d0e6c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproMetricsAddUnchanged_TestReproMetricsAddUnchanged.test.None_7": {"doc_hash": "de8ed754efb0a3fe91cc2aea9dafa6824f2a92c3bfa5377557c5a8c3b2d201ca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproPhony_TestReproDataSource.test.self_assertEqual_stages_0": {"doc_hash": "d2f1120bf286f0004d33f1b26c13df313c6968d797393bd2560a835076a33b2a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproChangedDir_TestReproChangedDir.test.None_5": {"doc_hash": "1007025d7604c91becca320611e8cffb39676931913ebed1cd03f664ff3e06d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproChangedDirData_TestReproChangedDirData.test.None_9": {"doc_hash": "34cc54776120b29cbb71b0af834f1fa527d175915bf9ea3cab98fb0aee367734"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproMissingMd5InStageFile_TestCmdRepro.test.self_assertNotEqual_ret_": {"doc_hash": "4711ee438570dc0fde02311bea510f2bd55376941c4c31135a195db044af3802"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestCmdReproChdirCwdBackwardCompatible_TestCmdReproChdirCwdBackwardCompatible.test.None_11": {"doc_hash": "8d29ccc4a502659f711536a2952bd115b493acd85234ba8ba4150e39b59da79a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestCmdReproChdir_TestCmdReproChdir.test.None_11": {"doc_hash": "2902ac1a9dddf588b5580a1fe5f08f2ac435ba5f0fa5d162df5de49615627707"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_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": "1312fea6bddba9a2a1834fad4fa947c5f193f37f1c766d1e22a912e7e58b86a4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalBase.test_TestReproExternalBase.test.None_30": {"doc_hash": "f330e9da963d353a4d17115c17c2250e4f3ed533bb07646d92c028a5fb1480f7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalS3_TestReproExternalGS.write.bucket_blob_key_upload_f": {"doc_hash": "7979069ea514fdefe16dacf32ef8d0ca21e65169c34a444052930e23a4a9151b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalHDFS_TestReproExternalHDFS.write.None_2": {"doc_hash": "f59455635b984aff100f33b067b665a52297154792268c55000413ab4bc99604"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalSSH_TestReproExternalSSH.cmd.return._scp_format_i_o_": {"doc_hash": "89d850a98b8409d94dc8a3408262f0aa146d6155b3f0232175cfe42b3b79af69"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalSSH.write_TestReproExternalSSH.write.with_sftp_open_path_w_.fobj_write_body_": {"doc_hash": "e4824d6d25e16947559a140e5a537111ae3511c89a545011378690465c3b968c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalLOCAL_TestReproExternalLOCAL.write.with_open_path_w_as_.fd_write_body_": {"doc_hash": "268ae1746b21846349b8d766bbcd9c86ec39befe367407bc688f7c5bed5ed35f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalHTTP_TestReproExternalHTTP.test.None_12": {"doc_hash": "39f666102579ce41cf09b012b9d1a34282bbb804cf2e7fe4ca46145ea49079ee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproAllPipelines_TestReproNoCommit.test.self_assertEqual_len_os_l": {"doc_hash": "a3f598f3998d29637f181be69e112285f2e26ce2c0fdc80a05aaca69b25c0d63"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproAlreadyCached_TestReproAlreadyCached.test_force_with_dependencies.self_assertNotEqual_run_o": {"doc_hash": "b2a914f4dd27e107118a01442922868c068deb64144a95db43883c5f33363cf4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproAlreadyCached.test_force_import_TestReproAlreadyCached.test_force_import.with_patch_download_as_mo.with_patch_checkout_as_mo.self_assertEqual_mock_che": {"doc_hash": "415189ed10c73f513b7bdbbcc97e7463e3ae69dbe41048ba8295d333f4b3eeb5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestShouldDisplayMetricsOnReproWithMetricsOption_TestShouldDisplayMetricsOnReproWithMetricsOption.test.self_assertIn_expected_me": {"doc_hash": "b89b090e5866a51820e3dfb8c9ea622d731fd800ae2e6bc29583b07a0b330d05"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_foo_copy_foo_copy.return._fname_fname_stage_f": {"doc_hash": "0b724d01a906aa1c2824f5a68c0b63e05ba31b96bb61077e1b1aac480d9e78aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_dvc_formatting_retained_test_dvc_formatting_retained.assert__hide_md5_stage_te": {"doc_hash": "82ec9a533522880b010b5364e4bbaa844f675e9f1e8eee7a0f405ef1c958302c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_os_from_tests_basic_env_impo": {"doc_hash": "9b55d91fafdf6a72b2feec58c1bb7e27447b4866817f3a05341eaf2dbdb2542a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestRun_TestRun.test.with_self_assertRaises_Ou.self_dvc_run_": {"doc_hash": "cb79fc5710f594159d2691916fe6dacf5efc0d157b44cce3f1f87f94b6327f04"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestRunCircularDependency_TestRunCircularDependency.test_graph.with_self_assertRaises_Cy.self_dvc_run_": {"doc_hash": "6368ee61b85a7c8be717d16344832e747e80ca2e6de51da789cf74648ed69e49"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestRunDuplicatedArguments_TestRunDuplicatedArguments.test_non_normalized_paths.with_self_assertRaises_Ar.self_dvc_run_": {"doc_hash": "80069519c2320a425fbcdc6fcf697cf90cb442892421331a0ad72e7489951354"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestRunStageInsideOutput_TestRunBadCwd.test_same_prefix.with_self_assertRaises_St.self_dvc_run_cmd_cwd_": {"doc_hash": "db567e463a2ac412d3aabed11f7fa9cdf03494518d26e6a8ce2319884ecd6638"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestRunBadWdir_TestRunBadWdir.test_not_dir.with_self_assertRaises_St.self_dvc_run_cmd_wdir": {"doc_hash": "20686c1c12484a723cb6c0c80632989b3b8b97aab0142a089cb6300f37ee161a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestRunBadName_TestRunBadName.test_not_found.with_self_assertRaises_St.self_dvc_run_": {"doc_hash": "42e54bd03fd65c6b1f77a130f4213a5b57b0a483bb1341cf0b5f95de70069f09"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestRunRemoveOuts_TestRunRemoveOuts.test.self_assertEqual_ret_0_": {"doc_hash": "fad030c0ceced71a0b4a282e9bc2cf9849da654cf6174a350d56a369d896b621"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestCmdRunOverwrite_TestCmdRunOverwrite.test.None_9": {"doc_hash": "b233b23295f727a85117be6731457f918418a25073dd354c554a75cf3320c083"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestCmdRunWorkingDirectory_TestCmdRunWorkingDirectory.test_default_wdir_is_written.None_1": {"doc_hash": "89954f987aad64229b5d304f9ad5102e65779087fef0b1574477409dc895c259"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestCmdRunWorkingDirectory.test_fname_changes_path_and_wdir_TestCmdRunWorkingDirectory.test_fname_changes_path_and_wdir.self_assertEqual_d_Stage_": {"doc_hash": "b8825b47ff2170172db46d05e9e13831678a367092ac523002def5265792e810"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestCmdRunWorkingDirectory.test_cwd_is_ignored_TestCmdRunWorkingDirectory.test_cwd_is_ignored.self_assertEqual_": {"doc_hash": "fefcff93b1e41ddca90bbcce513a3797a5ed6e3255087e003c65a951d0afa861"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestRunDeterministicBase_TestRunDeterministicBase._run.self.stage.self_dvc_run_": {"doc_hash": "edfc5da8d35ffa944a06260d2559ed606ed82e953dc54c0954a767d78afff145"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestRunDeterministic_TestRunDeterministicChangedCmd.test.with_self_assertRaises_St.self__run_": {"doc_hash": "1815f77a1b519401e8e8e273257ee1a234d6c62b7c35a5cb86d3e4e3954c000d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestRunCommit_TestRunCommit.test.None_5": {"doc_hash": "6b3e5a507b58d53d7c2b000ee3458ea88afd266b961da3ff747b8204739e0b86"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestRunPersist_TestRunPersist.should_remove_persistent_outs.self_assertFalse_os_path_": {"doc_hash": "06cb656d372e6bd54cf9c25fb6b8162156f2b0218daa4d55f68f09d3d9f2dd28"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestRunPersistOuts_TestShouldRaiseOnOverlappingOutputPaths.test.None_4": {"doc_hash": "649500c48299b8b529b5ff511d146fbfdd0b316dd26ac67b9a8667eca31b591b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestRerunWithSameOutputs_TestRerunWithSameOutputs._run_twice_with_same_outputs.None_2": {"doc_hash": "5e25030140358e4e9a01131404d7f431bcad40ac90433069d3bb5130831a64b5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestNewRunShouldRemoveOutsOnNoPersist_TestNewRunShouldNotRemoveOutsOnPersist._outs_command.return._outs_persist_": {"doc_hash": "5a3f3f9798e25f634b29e977a4c89f701a13f75eb6d11c2a4aa68248708d7e76"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_s3.py__upload_multipart_": {"doc_hash": "c43e2180949d81e60deeab98ad8b38b3c473db8937ef908f70f4e3d2a8363680"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_from___future___import_un_TestSCM.test_git.self_assertIsInstance_SCM": {"doc_hash": "d98d5d83b943f104d9e27a30454efc01fdaf32e7c4a6df731e7765f688002b2b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_TestSCMGit_TestSCMGit.test_is_tracked.None_10": {"doc_hash": "1507596065f20fa4ad2ff6294e96878bdefbbe519f5f49de03f8bdd28048341f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_tempfile_TestSchemaCmd.test_cmd_str.Stage_validate_d_": {"doc_hash": "dca1ea5651ba08de64e11c48629c0d70b6959281065566cf670bf4a3eb724869"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_TestSchemaDepsOuts_TestSchemaDepsOuts.test_empty_list.None_1": {"doc_hash": "feaff2dccce5e8e210c080bc4b06813bc7185cb6115f42536820f7f89ffa08c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_TestSchemaDepsOuts.test_list_TestSchemaDepsOuts.test_list.None_1": {"doc_hash": "a594a33b04222cb481c126881feb2b1312671b169d18a6b31f055c36118057e2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_TestReload_TestReload.test.self_assertEqual_d_stage_": {"doc_hash": "7a493de1f4f9c248ec438a4a6382514f93659cc654f06cf2c9f885abb01124a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_TestDefaultWorkingDirectory_TestDefaultWorkingDirectory.test_ignored_in_checksum.with_self_dvc_state_.self_assertFalse_stage_ch": {"doc_hash": "de58f5cc83583af27d4e88104768f9a01c256848c367567538d4d78913840ad4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_TestExternalRemoteResolution_TestExternalRemoteResolution.test_remote_output.assert_os_path_exists_fil": {"doc_hash": "88dd8046377c1acf053525113dc3ce60cfa40e7bc6dfa661fd220659c346b515"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_TestExternalRemoteResolution.test_remote_dependency_TestExternalRemoteResolution.test_remote_dependency.assert_os_path_exists_mo": {"doc_hash": "0ca7f915891cef43072be5f63467ced9c884c5bc58da060682280d3dd1eb7e87"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_test_md5_ignores_comments_": {"doc_hash": "208563da36f7c77631142e9656c5dfa67a3e3b40b335f575d19123b8b1b4ab0c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_status.py_os_": {"doc_hash": "fbbf8c9018b8b7770c84cb1432756488561de0dbdfbe354598851b9dcaa30081"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_system.py__": {"doc_hash": "44b31e2c777db94c4cd10d69a700f0951db9ccbf8698c048daaf2fd1942b65b6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tag.py_os_TestTag.test.None_12": {"doc_hash": "9d935d5a072315d7b3f70cec736aec30f955144033ff0df22a5948bdf300cd8c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tag.py_TestTagAll_TestTagAll.test.None_10": {"doc_hash": "3ebf17d6842acbc32ee206e1be7261429240216c95af59d9ce3e5dcf66574d8b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tag.py_TestTagAddNoChecksumInfo_": {"doc_hash": "e1efe1fca5130cfc9abbd32afa9181517389cac46a07ae6e4d7e47bab498c0ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py__encoding_utf_8_TestWorkingTree.test_isfile.None_2": {"doc_hash": "dbf70c6235dd0991afdf6e843fc43c7beaf5ef8c8c6dd9676b2edbf9b09b670a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_TestGitTree_TestGitTree.test_isfile.None_4": {"doc_hash": "06d82022c180d91f961b71cdc63f87cf7b41b0241acf8af33a2ce1123a3ec9ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_AssertWalkEqualMixin_TestWalkInNoSCM.test_subdir.self_assertWalkEqual_": {"doc_hash": "52d11f5c51e12e93deef58274618fd59c82a0da671e1f3b16574aadc635be04d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_TestWalkInGit_TestWalkInGit.test_nobranch.None_1": {"doc_hash": "2c239ddd0dcfe3e7e546e9c244853250ac547c292397820511279d7eda6fc06e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_TestWalkInGit.test_branch_": {"doc_hash": "df1dd8db7103ca04a2f95e4922708cfda2e4d365c481f72f7bdaf88128ed896b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_unprotect.py_os_": {"doc_hash": "4f7b7187b6a0e82265f401fe28f735170e15025050c032d0e5307e7613a1093b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_utils.py_os_TestUtils.test_file_md5_crlf.self_assertEqual_utils_fi": {"doc_hash": "7ec1406c80779aa6f3c2d2a23a3dee18765ef13f39f0ec93b42f707dbc3a116b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_utils.py_TestUtils.test_dict_md5_": {"doc_hash": "97c0a34d56b18092011c725c171ba30ac26c60d5d736b5bc65eae47915c6343a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_connection.py_from___future___import_un_test_makedirs.assert_os_path_isdir_path": {"doc_hash": "6b14b66d8d520035aca44f1e3618d06c5020dd416b03278361755d0149720e37"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_connection.py_test_walk_": {"doc_hash": "fbda58f2b76f752f91da3f9c67c962f5998420f677faf29cf3ef1132d25f450a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_base.py_mock_TestMissingDeps.test.with_mock_patch_object_se.with_self_assertRaises_Re.self_REMOTE_CLS_None_": {"doc_hash": "5ed7121fbec2f7aeaa189a8f6db5c31ac280dc61c23b7e95605fe030d8b2b7f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_base.py_TestCmdError_TestCmdError.test.with_mock_patch_object_.with_self_assertRaises_Re.self_REMOTE_CLS_repo_con": {"doc_hash": "ef72c69fdca99450b9e2723c88d9460eefe15b612cd38a17f1370e914b579917"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_ignore.py_os_mock_dvcignore.return.ignore_file": {"doc_hash": "ed5ec6cae9c28ee51acbe5e9e67a5efa5d2df166518fbdc5f628a7559970ef3e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_ignore.py_test_ignore_from_file_should_filter_dirs_and_files_test_ignore_from_file_should_filter_dirs_and_files.assert_file1_file2_": {"doc_hash": "cd52665bcd4399c00bae9c47eaf9c8ad4ef76b47a937b324ac28957e1fd8a7c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_ignore.py_test_match_ignore_from_file_test_match_ignore_from_file.assert_": {"doc_hash": "f8823b23dca80fef2676d763914c035360aceb6fdc4c10667adcb3a9e57b67fc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_ignore.py_test_should_ignore_dir_": {"doc_hash": "e6f856cb2d999fc602940a978f3ce3d77488bed81d85321c7604c67e35ad66fb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_from___future___import_un_TestColorFormatter.test_exception_with_description_and_message.with_caplog_at_level_logg.assert_expected_format": {"doc_hash": "729b3c7a64c727361e655cbe99b42d2a9d12895fa328ed8adafbdf5dd58cf755"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_TestColorFormatter.test_exception_under_verbose_TestColorFormatter.test_exception_under_verbose.with_caplog_at_level_logg.assert_expected_format": {"doc_hash": "d4d87e62a4fffc8cc8a0ae28534c5f4e079d5eb9619cb8767a6c014457308b3f"}, "/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_TestStageChecksum.test_wdir_non_default_is_not_ignored.with_mock_patch_object_st.self_assertEqual_": {"doc_hash": "7a2d86fa841a112241f59b54306d6872428429659e393fe8f445bd567a3d5f48"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_version.py_mock_": {"doc_hash": "bf5287e03f556db8fe0faaa74711fc718fd2f39f413cfe87e8c3909c3f40e7e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_collections.py_from_dvc_utils_collection_": {"doc_hash": "eb26b598ee88da6856afc08c8e1dfb8e1f0bd79bc3bbabebe32bc656ce4ba28d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_TestContainsLink.test_should_return_false_when_base_path_is_symlink_TestContainsLink.test_should_return_false_when_base_path_is_symlink.with_patch_object_.self_assertFalse_contains": {"doc_hash": "9fa1b06094207ad40a24b30bd221f564a2b6a49ed2f364c06681e8c27a35d1a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_test_get_parent_dirs_up_to_should_raise_on_no_absolute_test_get_parent_dirs_up_to_should_raise_on_no_absolute.with_pytest_raises_Assert.get_parent_dirs_up_to_pat": {"doc_hash": "fa59e30da3b5125794bac22e085c389c21257f4c20cf7bb1e428190ce1065e3e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/utils/__init__.py_os_": {"doc_hash": "664cd9862672646b8e7834fc4df743deebafa79df2411489bbbe64661c26fe03"}, "/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.return.0": {"doc_hash": "254d5d9d35b3b5e5c359c0e0c480ef4e83e835f03267cb2ead085334312c02a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud._init_cloud_DataCloud.push.return.self_repo_cache_local_pus": {"doc_hash": "eb85d1207b45a69e8de422214c22f5df2eaa16bc91be441f751cdfba86b4c0fe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/https.py__": {"doc_hash": "b44664da51bde3056ca1c07aa773e10c8259088b8401e100616957df2219da2a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py_ColorFormatter._current_level_ColorFormatter._walk_exc.return.exc_list_tb_list": {"doc_hash": "db2399ca27198022ac682be3e29d40a2723997e4276bb1ebd17150f0bbde221c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/progress.py_Progress._bar_Progress._bar.return.num_pbar_percent_ta": {"doc_hash": "16e10a5b636d7cf1a483c861b9d438b96621490b8aff16f9810fa6024b91b313"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/progress.py_Progress._print_": {"doc_hash": "8d1c840511d59a48f50110328e6ebe3ba0fafa5e3615d01bfeea06efa41dc88d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_RemoteAZURE.blob_service_RemoteAZURE.blob_service.return.self___blob_service": {"doc_hash": "055ee2db256b454606ff7e217d76487d9ae0d8784030f30165e2760934713d0d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE_RemoteBASE.get_file_checksum.raise_NotImplementedError": {"doc_hash": "df5bbb39a68fe451de15784201f46f0ae68a350bebfaf32976468a64b436f461"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.is_dir_checksum_RemoteBASE.save_info.return._self_PARAM_CHECKSUM_sel": {"doc_hash": "4526eb49eeba66e609fd4ec7a2417715b567b347f7e37ff870b6fa5b8ccb6135"}, "/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": "343cc1bbf9083d33d862dcf002f23e2a39baa9e2512f512a017c5e7a455c5afc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.link_RemoteBASE._save_file.self_state_save_cache_inf": {"doc_hash": "b979fb2bed793656a92baec47114189dc3705e88b7257c9141efb9bda69aea03"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.changed_cache_file_RemoteBASE.changed_cache_file.return.True": {"doc_hash": "ff0b83e8276da99e60de2d4060cb32c00d8e5cc30196f0e840a80932458fe436"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.already_cached_RemoteBASE.safe_remove.self_remove_path_info_": {"doc_hash": "03ce712eb8b02df7331588dbfcdf246be3ca7a00bd281d0fc8b79e557c6ffb16"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._checkout_file_RemoteBASE.makedirs.raise_NotImplementedError": {"doc_hash": "d7d7ecceba573656cda69a7d42e341ceee59f6558f0e9452154a3985bab059dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._checkout_dir_RemoteBASE._checkout_dir.self_state_save_path_info": {"doc_hash": "0d822c3e403a7ff1ab5aaa223b0f7c26978c1d9e5989645032289c1972922d61"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/https.py__": {"doc_hash": "cade8c280d19958100d66b30fce7ab5b2063cd70a160c4d1a13986edaf0ccf4d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_from___future___import_un_logger.logging_getLogger___name_": {"doc_hash": "b1abd63987f978807b87dd035a6d237ebbee49d0f4a7b33bf440f9b4c554516b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_RemoteLOCAL._group_RemoteLOCAL._group.return.by_md5": {"doc_hash": "9aaa43511ad630688d20fc3d1535f1931299239a524163a6758edf202bc15805"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_RemoteLOCAL.status_RemoteLOCAL.status.return.ret": {"doc_hash": "b8d4a7ba7119a27bed1fc1b7333f7a76bb2785e06e56ca2795cbadaaa49227d6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_RemoteLOCAL._unprotect_file_RemoteLOCAL._unprotect_file.os_chmod_path_os_stat_pa": {"doc_hash": "863b43344d43370cfbc2d5c2136f88e78522b00c238cc42d8da79195ebd30afc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/slow_link_detection.py_logging_SlowLinkDetectorDecorator.__call__.return.result": {"doc_hash": "57489fd65bbcd74cedb1ef171fe9f45bfa6318cdc5b6e74f5e1e3ad37a846f98"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/slow_link_detection.py_slow_link_guard_": {"doc_hash": "0831e13eb27f767095c92c12d7b81ff5e1148a8ece90f98f35a63dfd1b3668dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3.copy_RemoteS3._list_paths.for_page_in_paginator_pag.for_item_in_contents_.yield_item_Key_": {"doc_hash": "f780928b1fa816963f2ba51b2df8d81315087ee8f91399e6998a82729f5309cc"}, "/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._try_get_ssh_config_keyfile.return.None": {"doc_hash": "b062da94a0cdf57ee08faed43df9f778a99216651f8da4e87debaacc52f6a628"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.active_stages_Repo.find_outs_by_path.return.matched": {"doc_hash": "24c7b1fadf5f036d77fae07bd6f670a938fd5a30ca2a7f53e824bbf7f36d2951"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/add.py_os_add.return.stages": {"doc_hash": "bf09d6f5068ab8ec3faf3525414f5c687bfb4ec9205add3825f17982f9cf6739"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/add.py__find_all_targets_": {"doc_hash": "99c17044df91c3e1d4fb087e1dd3dcc2462095aec24966eacb205772ebd008be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/show.py__read_metrics__read_metrics.return.res": {"doc_hash": "e28602c6ec3124f09aef243f7a07fa6d3bbbb7069921484cf63a664ec89d077b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scheme.py__": {"doc_hash": "d26af2965dc0c2a51f42c6c58a43432d08b91428b01121cc198583c7db78140f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.commit_Git.list_tags.return._t_name_for_t_in_self_git": {"doc_hash": "2baf16cced7b6fb9d891a65dab79a26411fbe9e71ad99d19e3439b500a241ae5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git._install_hook_Git._install_hook.os_chmod_hook_0o777_": {"doc_hash": "50804a575454f697e7d23c7956b6e53c78d720f6610220fa50a498eb3fb46889"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.install_Git.get_tree.return.GitTree_self_git_rev_": {"doc_hash": "9dd1917b8dd5aa9c4b2f502bfc266c0ea63f6db2ea365848d19016caacda3d96"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State_State._from_sqlite.return.num": {"doc_hash": "99d1f3346324207b066e10b20bcffabf1102b270bd0b50ed8a0a8b806fdc33c6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_copyfile_copyfile.if_not_no_progress_bar_.progress_finish_target_na": {"doc_hash": "96d8845b941972300e2cb0534300bc5f08a711dc3f986d33f777ca5824d2513a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/hooks/hook-Crypto.py___": {"doc_hash": "f2bb09996a9fac77b2a2ec6a956c0fe2efcf7265bf177968ee4d69a0e8f17a24"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/hooks/hook-aliyunsdkcore.py__": {"doc_hash": "1f0379e08ca27dffebc4fb637a360b537a0785444a3059c558a6ea109102eb74"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py__encoding_utf_8_TestDirFixture.setUp.self_create_self_UNICODE_": {"doc_hash": "636d4053cd2ff7032924d67cb1710bacef98272e46743f0bf49b8082d0e0c83b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py_TestDirFixture.tearDown_TestDirFixture.tearDown.try_.except_OSError_as_exc_.if_os_name_nt_and_ex.else_.raise": {"doc_hash": "fe096e421d2b3d8d78f2bfa968a6939b243dd1af0be253c5696b2255f2400b85"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/conftest.py_from___future___import_un_repo_dir.try_.finally_.old_fixture_tearDown_": {"doc_hash": "adff0caa5d9a102b4d39f9e4417b782a88a7bc6340401e4e9535a486d9d867b5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/conftest.py__NOTE_this_duplicates_c_git.try_.finally_.git_close_": {"doc_hash": "679c029b679ec209863ae12ec527e503375875f988306fc4e6bb6967b0b2dd8a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/conftest.py_dvc_repo_ssh.yield_SSHConnection_": {"doc_hash": "512b19ddb30b82212197980b08ae2b8936ef84105aca2fe35ae82cea7d52431b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddUnupportedFile_TestAddDirectoryRecursive.test.self_assertEqual_len_stag": {"doc_hash": "802d671bd000aef90b7204006d71f49dbb8e68a38757107d1f84783a4be206f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddCmdDirectoryRecursive_TestAddCmdDirectoryRecursive.test_warn_about_large_directories.with_self__caplog_at_leve.assert_warning_in_self__c": {"doc_hash": "4a3644ef732b279e13bf528e896a306e1689ad8492c02f6126a145501014c7b2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddDirectoryWithForwardSlash_TestAddTrackedFile.test.with_self_assertRaises_Ou.self_dvc_add_fname_": {"doc_hash": "b187d9284aa0a10d204205b4b0a077eeaf906eec3a0bb440fecaa9dddb91570b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestShouldUpdateStateEntryForFileAfterAdd_TestShouldUpdateStateEntryForFileAfterAdd.test.with_patch_object_dvc_rem.None_11": {"doc_hash": "78cead0fecc4478093ce8b768aeafc558a1f3705c1c8c1114b749b54cc61677a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestShouldUpdateStateEntryForDirectoryAfterAdd_TestShouldUpdateStateEntryForDirectoryAfterAdd.test.with_patch_object_dvc_rem.None_11": {"doc_hash": "4c07c705f4f64ec70551738cd59c14329b99d7e60eeed1c1ae902ca2c67c738e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutTargetRecursiveShouldNotRemoveOtherUsedFiles_TestCheckoutRecursiveNotDirectory.test.try_.except_TargetNotDirectory.self_fail_should_not_rai": {"doc_hash": "8bacff433e2d3c3fd501363de18ee3f9b37e7e03c3d8bae090ac3db2d4db77e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_commit.py_pytest_test_commit_force.assert_dvc_repo_status_st": {"doc_hash": "23459c0389ddc85be41dfd97d701fad7b3668e32d85b027dabb92ec67d9549e2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_commit.py_test_commit_with_deps_test_commit_with_deps.None_1.assert_not_stage_outs_0_": {"doc_hash": "cac4c8bd61e77987e5d056e86a83f0f4bcf8e78b9c83b292b73d04ccf6dedcdf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_commit.py_test_commit_changed_md5_": {"doc_hash": "d6772ee2002f5c07698db567ab853db4ba56ce917ee31b645fdab9bb44017516"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_from_subprocess_import_Ca__should_test_ssh.return.True": {"doc_hash": "3622340198867b796956cbb5fc768988b7f0c70d860b136f3b99b5e266e98048"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py__should_test_hdfs_get_ssh_url.return._ssh_127_0_0_1_22_": {"doc_hash": "37789f8fc4994e895ee704a689f67072622ecaba811685066b977d418b8f6935"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_get_ssh_url_mocked_get_ssh_url_mocked.return.url": {"doc_hash": "dc3addd4d44e6e81209f268428f9e4d91bed3d4a01acc84501b17c2229b94ce7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_get_hdfs_url_get_oss_url.return._oss_format_get_oss": {"doc_hash": "4a612d4255995f2bb29bcde30d3f469f805e1987c3f9e299f536c0d669c5bd46"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRemoteSSHMocked_TestRemoteHDFS._get_cloud_class.return.RemoteHDFS": {"doc_hash": "b7a8ea1e6e8f5b8e13efdc161a89a5c09a66b8ab61eed24114be14b9da8746d9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestDataCloudCLIBase_TestDataCloudCLIBase.test.self__test_": {"doc_hash": "533963936c33499cb5963752b704810a5abf40be06891fd00eab25f8b274fd3f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_from___future___import_un_TestDiff.test.self_assertEqual_": {"doc_hash": "44b8d4b1c4da2060a7f07ea817e37761edf50b9bd56e235f46a3f88abc4ca104"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_TestDiffDir_TestDiffDir.test.self_assertEqual_": {"doc_hash": "41b56d598324eb93b6d6e9c0c7303177f8dec4e6744fa415f5ef4492b3e25fea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_install.py_TestInstall.test_should_post_checkout_hook_checkout_TestInstall.test_should_post_checkout_hook_checkout.assert_os_path_isfile_rep": {"doc_hash": "08d09982c5c81c32cf24a71d12053b766e5b457ce84afc780e9fe4a4dde42f69"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_install.py_TestInstall.test_should_pre_push_hook_push_": {"doc_hash": "7e9aaef937fa31aa8e302ccc5198e93378744d59359455a3a1de4e95afcecbc8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py__coding_utf_8__TestMetricsBase.setUp.self_dvc_scm_checkout_ma": {"doc_hash": "dd400c0b1e0f5841d7616fba984a52296bfe868a5ddbddfea2e0e2cb1d85fd41"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestMetrics_TestMetrics.test_show.None_27": {"doc_hash": "6ef592256e9ce2a615ca8dd9920722fdde10133c61dadd5c7a009ee8365d8e35"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestMetricsType.test_show_TestMetricsType._do_show.for_branch_in_self_branch.if_isinstance_ret_branch_.else_.self_assertSequenceEqual_": {"doc_hash": "d2fd9d1fb5422adac929a6120e25967332448b032aee3edb1f0f0d3ae00017cb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestShouldDisplayMetricsEvenIfMetricIsMissing_TestShouldDisplayMetricsEvenIfMetricIsMissing.setUp.self__commit_metric_dvc_": {"doc_hash": "1785b49b8470ff4629862cab0a9be3b8290f5f83c925ee5a29d075efe8dea1c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestShouldDisplayMetricsEvenIfMetricIsMissing.test_": {"doc_hash": "f68f50e64554056adf09bf343a777b0309073a87066903e32d64e8ff78034458"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_TestRemoteShouldHandleUppercaseRemoteName_test_large_dir_progress.with_patch_object_progres.assert_update_target_call": {"doc_hash": "2e829622f4636bcf184156d674ba2050e4d8f3db70bf157adcd916ac45b027f5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_repro_dir_repro_dir.yield_repo_dir": {"doc_hash": "7bbb2edd90f21828a3262922211b2409eca71a51fee4abcbeed0b82e72cf0bad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_recursive_repro_default_test_recursive_repro_default.None_5": {"doc_hash": "541d1ca95c51fa063f43d9fc563996076c5a9f8b3a1990e90af96c08d0c013ac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_recursive_repro_single_test_recursive_repro_single.assert_filecmp_cmp_repro_": {"doc_hash": "5b976e15d12d3964e08df21c6430c40a284d0bc6315115800a049af836afe8e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_recursive_repro_single_force_test_recursive_repro_single_force.None_5": {"doc_hash": "6fb4e572ea25ec77129cccb5359dea652a08c8d82ca225c971b9ff0d2cab7307"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_recursive_repro_empty_dir_test_recursive_repro_on_stage_file.assert_repro_dir_first_st": {"doc_hash": "95fee39000060cf27ee7bbf28685b27d49697c2c7186388286d39c0ec9b52351"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py__format_dvc_line__hide_md5.return.re_sub_r_b_a_f0_9_32_b": {"doc_hash": "0dc2eba7eab04a24946f3ef1ad3983f36f474c2465991b47bd457746454dfbdc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestRunUnprotectOutsCopy_TestRunUnprotectOutsCopy.test.None_2.self_assertEqual_fd_read_": {"doc_hash": "2fe258b4770fb2aa52a4d486bf0f7ec21ebcf22f2564fd7efb8fc51f9f1e7623"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestRunUnprotectOutsSymlink_TestRunUnprotectOutsSymlink.test.None_2.self_assertEqual_fd_read_": {"doc_hash": "0483528e870c107d32bbedd47eee8e819013d397e0c28ed81ee94dde1b74c551"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestRunUnprotectOutsHardlink_TestRunUnprotectOutsHardlink.test.None_2.self_assertEqual_fd_read_": {"doc_hash": "ee7612a8a5b6c896649429106d38ae037996dc8c6fdc328cbd4dd565cc8a5974"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestCmdRunCliMetrics_TestCmdRunCliMetrics.test_not_cached.with_open_metrics_txt_.self_assertEqual_fd_read_": {"doc_hash": "f49155b34812c14d694e221de5971ae55bd86239cf0491b0b1f4d5c62d565509"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestShouldNotCheckoutUponCorruptedLocalHardlinkCache_TestShouldNotCheckoutUponCorruptedLocalHardlinkCache.test.with_self_dvc_state_.with_patch_checkout_as_mo.with_patch_run_as_mock_ru.mock_checkout_assert_not_": {"doc_hash": "9a0ca77fb2b3bce3d21be7e6e820368af983c18e22732fc331d2c770233b90ac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_repro.py_from_dvc_command_repro_im_": {"doc_hash": "f07cd01a70f2a756100433c9c59aa8bcf54bea59c1bb9cdb88f58a94aa5bbefd"}, "/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_no_path.self_assertEqual_remote_p": {"doc_hash": "2a8f1154569ae521b7cfe4b3fd77ca4790ca2d88c1d43d5c4be8c494a660053e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_test_ssh_keyfile_": {"doc_hash": "f9f60055934b6b5e4d4bec2c3f2ea34c0c1f21b6a89591fbcf0430c047031054"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_local.py_from_dvc_remote_local_imp_": {"doc_hash": "5c043cbdea6621b475223e162db4b6dcb7b95196593d84097d6203f1754b16c6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_oss.py_from_unittest_import_Test_": {"doc_hash": "d26dc8a54aae9793e1ec4cce2061ad6395902396345fb3e91beb0c9db08ac029"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_slow_link_detection.py_logging_TestSlowLinkGuard.test_should_decorate_on_slow_link_warning_and_no_cache_type.assert_0_self_method_c": {"doc_hash": "bcea023d18ac8407b1be7bbf354988f73c369eae33f48167010b56cfe320bce6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_slow_link_detection.py_TestSlowLinkGuard.test_should_not_decorate_TestSlowLinkGuard.test_should_not_decorate.assert_1_self_method_c": {"doc_hash": "78559add6afc831605d8b1490c2ab8f6bf2c35685600abf10d584d901df9c320"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_slow_link_detection.py_TestSlowLinkDetectorDecorator_": {"doc_hash": "3caeabdf2c22dbf56d36f4821524b29a67418a7d6173b484b20174a28371ac05"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_TestColorFormatter.test_nested_exceptions_TestColorFormatter.test_nested_exceptions.with_caplog_at_level_logg.assert_expected_format": {"doc_hash": "a3aa56db5e5950cbd5ac26f342c757f88b2d2a41193f51b4a50d62265066f438"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_TestColorFormatter.test_progress_awareness_": {"doc_hash": "263c6584ea9b66867ca48f199a7a83f3740fe148554134ae9c834143f2d878c1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cache.py__Manages_cache_of_a_dvc_CacheConfig.set_dir.self_config_set_": {"doc_hash": "e8b5f419e2705ff6c422c1e8b5a67d00063c37f77d99cfb34a609e2b0411beff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cache.py_Cache_Cache.__init__.self.azure.self__get_remote_config_": {"doc_hash": "961bf2ec7d925508ec93e0fa7928b22916a40b0067073cf4ec0ba95cdcfeb973"}, "/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.return.0": {"doc_hash": "6b55e59d6a1479401538a2e0e9576f5e208cfcf7b04c3078201848e02b927f3b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/config.py_parent_config_parser_parent_config_parser_set_": {"doc_hash": "27d34907453c899835431e48c37188aa422b12ac2ff61fcbc46243ca8916e302"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/config.py_add_parser_": {"doc_hash": "84f789d08501dc412b1ed7cbaf71058ae0299ffc5f8b26c5a346c9c6c9d71e97"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_from___future___import_un_CmdRemoteList.run.return.0": {"doc_hash": "20c0642643a49726dc3590875664c639633ca950105e52c78d62018a522dfca7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/version.py_from___future___import_un_CmdVersion.run.return.0": {"doc_hash": "bc9d8d29ff59bea88abc5a1f434911a3a4b0777145041026416989c229f9c96b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/version.py_CmdVersion.get_fs_type_": {"doc_hash": "2106cc4b7c1d4ec99b60b288c52ba203eb0ee1c207925937dd786c8cdb16f4e3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py__DVC_config_objects__Choices.__call__.return.value_in_self_choices": {"doc_hash": "e0c8c072bd1da30a6b2af8cbbadfc580996bbc347795f4d4ed072c53af094d2e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config._load_configs_Config._load_configs.self._local_config_9.configobj_ConfigObj_confi": {"doc_hash": "b52237a69bec3a4e16d548bb9113db9d01ab9ca6eaadbc090a4994e9451a33fc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config.config_local_file_Config.load.self.config_2.configobj_ConfigObj_d_wr": {"doc_hash": "cbd3090066475abf43ab02925f5275428ea0d0019517ffdba0e157d90429005a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config.save_Config._save.config_write_": {"doc_hash": "b6095d277ed8117ab97bcd8cfc7d064957da4cc6100db6c34e9174ab81325fd8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config.unset_Config.unset.self_save_config_": {"doc_hash": "42f387cd94e9876607dc65c1e45b0c91eee256d1b4477503d601399b304f99c1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config.set_Config.set.self_save_config_": {"doc_hash": "fd0c2a204fc3ef83e2fe2cc21f6e910bd8b26cb93caf5027e6fd02d3c15d844c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config.get_Config.get.return.config_section_opt_": {"doc_hash": "dec891e2e5f5414569f2110ee468973a15d71712c717bf4ffce5453c98b72b45"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config._lower_": {"doc_hash": "472f2db0ba963835e00a17d1868219bf9d9748147b848b8934eb9f23f1705e13"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud_DataCloud._core.return.self__config_get_Config_S": {"doc_hash": "2dd76365a0a6e3a1c1da8e7813f60e27050f2e2711c8e02bb1a0824d16c156bd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud.get_remote_DataCloud._init_remote.return.Remote_self_repo_name_re": {"doc_hash": "e73bf66cac23a2b5a38d7a1311653f56d482d57006cecb78461e61ceb930d0b5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/http.py__": {"doc_hash": "425aad7df34365a096c50bf5477c50ef1661e2b3273bdd3602667148238d63c0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase_OutputBase.changed_cache.return.self_cache_changed_cache_": {"doc_hash": "3f50333b60daaf6edce80f7bad6680f61f709b22d0e5f9c886a8fb64170e2f3a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.status_OutputBase.isfile.return.self_remote_isfile_self_p": {"doc_hash": "815853d5e09a87fbe239b069a8f0db7f3c505e323c28fd6b96d9e70c45f0f3e1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.save_OutputBase.save.self.info.self_remote_save_info_sel": {"doc_hash": "7d03d55ffee64fb9472922296f3c7c63ccc00e47b79363e8556f9a8df2657947"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/hdfs.py__": {"doc_hash": "3f01377b4db45d537a76123fb8234982a3f6549907bc6bfccd3f336db4f84e80"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/local.py_from___future___import_un_OutputLOCAL._parse_path.return.self_REMOTE_path_cls_abs_": {"doc_hash": "113f157723bd0337b0ba6719cc7756ae2a72d0c57c51dff379c0660d4fc0d03d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/local.py_OutputLOCAL.__str___": {"doc_hash": "555f43cdcb3e6da269e185b335d5baad2dffdf755b237e7bf3beaf1479314e4a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/s3.py__": {"doc_hash": "1b56aae682d1be711b73e9acb5576de6fffb04cf4e19c22d4b7ccc72792f4a37"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/ssh.py__": {"doc_hash": "579931c0b62c1c3ab336e9a328ed6b4bad24246057e56fb4be88f3a80494ea64"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_from___future___import_un_if_is_py2_.fs_encoding._utf_8_": {"doc_hash": "7174604dfb7908698a98b935eb61d7ba6ff2a1a1d83ce1f7cd68f391ce16fdaf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_URLInfo_": {"doc_hash": "efee498d26bf8f5e70a6ea407ffafd6a2f5be4d0f3332861201ec9bb7d4bb345"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_RemoteAZURE_RemoteAZURE.__init__.self.path_info._": {"doc_hash": "e6953bee98c904d7097aedfb7081a2dac395890c3d312bf1089d464269d9cf06"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.get_dir_checksum_RemoteBASE.get_dir_cache.return.dir_info": {"doc_hash": "a1d99c9e6e1102660b46e0e3e3cd641494bea6c83b53871cd3402198e66bd638"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.load_dir_cache_RemoteBASE.load_dir_cache.return.d": {"doc_hash": "28b79b4417b153737696602e2f290142d64e6a506ffda6b86580a16a0c1dc04c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._changed_dir_cache_RemoteBASE.changed_cache.return.self_changed_cache_file_c": {"doc_hash": "c4eae3b74258f649c1ba51e91e49fb3c53c10cf6c7b196a24278d169c09b928b"}, "/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_set_checksums_set": {"doc_hash": "210d5154a962e87b326542dff89cc79717efdbc641c7828b79ddf174e57c233e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._remove_redundant_files_RemoteBASE.checkout.return.self__checkout_path_info_": {"doc_hash": "23cd3463e82d02344194b2658c4553de48d35f2c30de85d40478ccd7d162434a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._checkout_": {"doc_hash": "241538dded15dccac9ddd07f66d4cd239f24b7e2a695f0437e116a93669c4e65"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/config.py_os_RemoteConfig.get_settings.return.settings": {"doc_hash": "16899d122b9b75604fec9d87a8d1e11d7141c39b9248568867382d9ef5fa289f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/config.py_RemoteConfig.add_RemoteConfig.add.if_default_.self_config_set_": {"doc_hash": "2f02bc396aafd0218346127aa0be32b50fafce68a0e3f3d833b819dc28400a37"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/config.py_RemoteConfig.remove_RemoteConfig.remove.for_lev_in_.if_lev_level_.break": {"doc_hash": "a6771bd8f9b1d4327a2f48bfde9a45fcd711513ef7777812508d010d4f9b9fe1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/config.py_RemoteConfig.modify_": {"doc_hash": "e7a4ccc71a01a7589d33be6032a068fcee6b74340b8811ac83b2e9e1aa15ea55"}, "/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__.if_not_self_user_.self.user.config_get_": {"doc_hash": "47b8f8e72c8bf66f379c34d4f8168cd41e239ce1a87fefca8bfaaac2d63000bd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_RemoteLOCAL_RemoteLOCAL.makedirs.if_not_self_exists_path_i.os_makedirs_fspath_py35_p": {"doc_hash": "00af4c46257fd14bc1856f8275a0c9577de51f6541087fb4d85b7c726dda8cf6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_RemoteLOCAL.link_RemoteLOCAL.link.self__try_links_from_info": {"doc_hash": "9e70989af7f3a52a316f51e3bbb363358a8b4ec544893e2bb3f7cc247c2dbd41"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_RemoteLOCAL._get_link_method_RemoteLOCAL._link.logger_debug_msg_": {"doc_hash": "18c7051112bec1dc52c2cfe99df3436255e3dd2f390a564ad7400a2c4dcce667"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_RemoteLOCAL._try_links_RemoteLOCAL._try_links.raise_DvcException_no_po": {"doc_hash": "ef2ea473442f9ed6edbd7e204abcc60d7d7ce7c0a01b04e5486dbcc5471f6842"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_RemoteLOCAL.push_RemoteLOCAL._log_missing_caches.if_missing_caches_.logger_warning_msg_": {"doc_hash": "069e090037f616869aa8b72af774d1d479ee55adf0d08e061e41e423086b95da"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_RemoteLOCAL._unprotect_dir_RemoteLOCAL._path_info_changed.return.True": {"doc_hash": "da2b8eb0a4d12489be4f17af05c96e065dae1ae6eea37f9ae9523cf6a6f4084c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_RemoteLOCAL._update_unpacked_dir_RemoteLOCAL._update_unpacked_dir.try_.except_DvcException_.self_remove_unpacked_dir_": {"doc_hash": "de8fdbf89c871478d9a9f9e79dd198f8d666cf1d428f0faa2562dd869b9375d7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_RemoteLOCAL._create_unpacked_dir_": {"doc_hash": "1c4c92923e52cbdfbca5729281192a21b985fd7d702cc069f8470974fd58447c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git._ignored_Git.ignore.self_ignored_paths_append": {"doc_hash": "0290013c22369c06e0ef5aeaaedf1f342340dc44f50e96c1786163ca3b51f7e2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git._add_entry_to_gitignore_Git._add_entry_to_gitignore.with_open_gitignore_a_.fobj_write_n_forma": {"doc_hash": "81a8f9abfe71fe8108748fd506170398500aa645614e60e7ca9e701b83b079e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.ignore_remove_Git.add.try_.except_AssertionError_.logger_exception_msg_": {"doc_hash": "1ac96044ef1dcbdd8c31107dc50afa9e7cd0ae5c89e7632550da1f6b5fa4fc75"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.remove_unused_links_": {"doc_hash": "a865eb4da48e63a9d40251afe523682248f950725e78fc093af0dea28d10c13b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/setup.py_from_setuptools_import_se__Extra_dependecies_to_ru": {"doc_hash": "249f3df7dd8966e3e4158b245d4739802148410bfc0847576f5e0eb8040a4dce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/setup.py_tests_requirements_": {"doc_hash": "8c6520ea9c6e3564ac9f4a438eb56195623675fcdf823b5d02df712578c5dfa2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_local.py_os_TestUnpackedDirStatusOptimization.test_should_not_fail_add_on_unpacked_dir_creation_exception.assert_unpacked_create_sp": {"doc_hash": "bf678c657c5103e5a65cc07ed68c5c24408d4bdf08971b8e47e0bbd39043e99d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_local.py_TestUnpackedDirStatusOptimization.test_should_remove_unpacked_dir_on_create_exception_TestUnpackedDirStatusOptimization.test_should_create_unpacked_dir_on_status_check.trees_equal_repo_dir_DATA": {"doc_hash": "5b071e96490098bd5213f75977a19430aae584a9f8cb0fc902d1eeff46f2ab6f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_local.py_TestUnpackedDirStatusOptimization.test_should_proceed_with_full_check_on_modified_cache_": {"doc_hash": "f505cd0d2fcfb3d71a4e5d52e89711addc40eb2a3baf3e9bee5c36ecbe81b5d7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_config.py_TestConfigCLI._do_test_TestConfigCLI._do_test.None_7": {"doc_hash": "db4a4520b82b69220ab27c45d54dc1bfbb4efc5ff3a60280e6d2c9da5cc8dc15"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_config.py_TestConfigCLI.test_": {"doc_hash": "df7a279a60115954d9d6020e4e562c7cc6ffa3e62593486e65aac8fd7b1dbc25"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRemoteAZURE_TestRemoteSSH._get_cloud_class.return.RemoteSSH": {"doc_hash": "1f7c825022f3279abcab8ed92c9d0ad04ec8f7bd488c5264a0782e6fdf101141"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestShouldWarnOnNoChecksumInLocalAndRemoteCache_TestShouldWarnOnNoChecksumInLocalAndRemoteCache.setUp.self.message_foo_part._name_md5_forma": {"doc_hash": "1fe84f04fdf7100215bc51582394e4bce9bdcc3fea194d80987ee28a245ea619"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dependency.py_from___future___import_un_": {"doc_hash": "10a9fa4ed5adba7acc6c6d45cb5f09a5de585aee22de1aafe8b92d34b82d94f0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_TestRemote.test_relative_path_TestRemote.test_relative_path.self_assertEqual_config_": {"doc_hash": "f70480b0205548eb0cb3d874aff3330eddde9b91910100476b5b720a7d71f172"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_TestCollect._check_TestCollect.test.self_assertEqual_str_i_": {"doc_hash": "fae95c7e39b72a3a018287107b0bd73e7d68a65ec56955381cf2339b4afbb7de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_s3.py_boto3_test_copy_singlepart_preserve_etag.RemoteS3__copy_s3_from_i": {"doc_hash": "84e2833376af8a2b1c1ac3342108bd5a9402a7466473042257a323ff9dac0900"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_TestSCMGitSubmodule_TestIgnore.test_ignore.None_4": {"doc_hash": "8e934c59e9ea1a5ff1b1269834b9739e9ad389ad5dd0cb2fdcd6fe91bfeb17eb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_TestIgnore.test_get_gitignore_TestIgnore.test_get_gitignore.None_5": {"doc_hash": "5fa60f7ab5979bf15f5748db41efb138a0d485f68c89a3462d8c86dcca56c4bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_TestIgnore.test_get_gitignore_subdir_TestIgnore.test_get_gitignore_subdir.None_5": {"doc_hash": "5410bc32b677190c84f8de6313ec6020438bc82d31d3189051d695e590ae8aa5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_TestIgnore.test_get_gitignore_ignorefile_dir_TestIgnore.test_get_gitignore_ignorefile_dir.None_5": {"doc_hash": "ebaa3cb4ae7c97eafeefbb04992d2a0965492f17217d965ffd681991b58e6567"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_TestIgnore.test_get_gitignore_ignorefile_dir_upper_level_TestIgnore.test_get_gitignore_ignorefile_dir_upper_level.with_pytest_raises_FileNo.git__get_gitignore_data_d": {"doc_hash": "9336c02e01f5fd200af8b3ef730076012086a508bf624759aa622dffce2638a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_TestIgnore.test_gitignore_should_end_with_newline_TestIgnore.test_gitignore_should_end_with_newline.None_1": {"doc_hash": "faee1cc908594a808f7d827e7de5d5888705e8834e1db6aa2980297dfa8d04f1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_TestIgnore.test_gitignore_should_append_newline_to_gitignore_": {"doc_hash": "95b8c6cd1f06a3df5cafe7526edeed4a20536a632387dee846111798d2c49f51"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_version.py_test_info_outside_of_repo_": {"doc_hash": "4ebf76dd81172beedb33c3568c80f73c3d393055892089d28388cfa54dc3e29b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_mock_ssh_config_test_ssh_host_override_from_config.assert_remote_path_info_h": {"doc_hash": "903e2f5fc023b4d6d932aab09dc48500b431d116ba1dfb36a756bcecd6817861"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_test_ssh_user_test_ssh_user.assert_remote_path_info_u": {"doc_hash": "b45361523eba3c4872df7a03758f159a31b32b72dafc2ef8d5f64a59154bf92d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_test_ssh_port_test_ssh_port.assert_remote_path_info_p": {"doc_hash": "3879329e91178123b9b92c6f490732ca75bb28ecd1f744ebda046df7fdc70f2a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_progress.py_logging_": {"doc_hash": "02c99a3bb456e70d34a4f574619b56839f0c95b8dd2311a682240e72d7af9c78"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_stage.py_from_dvc_path_info_import_TestStageChecksum.test.with_mock_patch_object_st.self_assertEqual_": {"doc_hash": "c19eab5a1a845b79586e028ce9323dc5731fdc16f24a5927af35b9b82c0b307b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/__init__.py_from___future___import_un_SCHEMA_schema_Optional_De": {"doc_hash": "90feed199f6129ee83c6d41f7119ffdf2607352ab85f2425f8bd8ed871e97809"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/__init__.py__get_": {"doc_hash": "4b3424aee086a8b2a031d7172ea45736c356e777a68f2af97e101fbca7c3a67a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_from___future___import_un_DvcIgnore.__call__.raise_NotImplementedError": {"doc_hash": "1633755033ccc1ed48ebb903462f50f5ba2f44205670dc92292a99d6597f902b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.verify_metric_OutputBase.unprotect.if_self_exists_.self_remote_unprotect_sel": {"doc_hash": "f94731031e6857091f9ddf4d327a1d4bf7ab9da6b20fa465b496e9667583eed3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase._collect_used_dir_cache_OutputBase._collect_used_dir_cache.return.ret": {"doc_hash": "cf68fd6398d2bce6f8a6d657048f683cc3857a99ad3109f84b8c70bd8d033987"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.get_used_cache_": {"doc_hash": "008312a03f9759c5511395b0ac7404e306c505d86e83371151c88fb7e809a5d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_RemoteAZURE.remove_": {"doc_hash": "882f058e2e77f39cc287ab8d98c24da467a853b9a943f675999a1d6a356343ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._save_dir_RemoteBASE.transfer_context.yield_None": {"doc_hash": "d0d54694447c1a05ef45bfd93233d33e7dfc37647d306520778486ff5df1708f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.upload_RemoteBASE.upload.return.fails": {"doc_hash": "73b773bc77cdc482e12a64c5eeaff4a40f8d8f3bcc3a4411c6b4eb34290f8535"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.download_RemoteBASE.download.return.fails": {"doc_hash": "33d54bef7dff028cc28b2c6896d70bfd9084ae132f0fbc3b9abe78028175f7ca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.remove_RemoteBASE.gc.return.removed": {"doc_hash": "d1934a9e7accdacc7d6d29f985770dedde369aea5b742284099e144f6356ccfc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/config.py_RemoteConfig.resolve_path_RemoteConfig.resolve_path.return.relpath_path_os_path_dir": {"doc_hash": "59bba4629daddd728e6e86878de1e48fa124bf2b87a386488ca4be17cdce4b50"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/gs.py_from___future___import_un_": {"doc_hash": "3436d881c6c54ef735ec751fa8912574725e1769951220564cf3b69536af3748"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_RemoteHDFS._group_": {"doc_hash": "77e1f751dc8e71542b9c997d652414413c3ae63756337cdfef211c8f67175365"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP_RemoteHTTP.download.return.fails": {"doc_hash": "e379099d0790e919555febcaa673596e8ce6b8232ddfed9ae6987b192d274cc2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_RemoteLOCAL.already_cached_RemoteLOCAL._download.copyfile_": {"doc_hash": "324d9ae68e570a40dcd8d7b8826a95e06a5758c0a757860d97d74a738e30be72"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_RemoteLOCAL._fill_statuses_RemoteLOCAL._get_chunks.return._": {"doc_hash": "f86ce01c323ab13b9ee763f1b52eef7263d9e75a11707adee79f9a991026a3fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_RemoteLOCAL._process_RemoteLOCAL._process.return.len_chunks_0_": {"doc_hash": "8302fcaf13974ba6de61ea956f91bed17709e675a2aa054cbed512763edb9454"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/oss.py_from___future___import_ab_RemoteOSS.__init__.self._bucket.None": {"doc_hash": "c00a7cee2e9cc90b61a26303d373bd8e5bfcf0af65ff1626e850cf839243919c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/oss.py_RemoteOSS.oss_service_RemoteOSS.oss_service.return.self__bucket": {"doc_hash": "542309d2727a964c1dab53e04be8fbde7d3fbe739dc5640fd5bc44eca1b940b1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/oss.py_RemoteOSS.remove_": {"doc_hash": "3ec1fd0631807949eff46b770b865e19ab39acf2c733de8e5a296d59c77a1c6b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3.list_cache_paths_RemoteS3._upload.ctx_upload_file_": {"doc_hash": "bdca60ea066fe93715f5da68f1c1a88ddc947d3a6919420572c5302694295d1c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3._download_": {"doc_hash": "dc9bbaeaf5c4ad2209bf3fb34c3bb590770e0a00c0dfe3aaf99651c20c3d1732"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.walk_files_SSHConnection.upload.self__sftp_rename_tmp_fil": {"doc_hash": "3d1e3b051b0f9a467f72dd823b65f369849f392df3391ce16825939253819057"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_GitTree.exists_GitTree._is_tree_and_contains.return.False": {"doc_hash": "8bfd18e746a1830193b28ab01ebff544eee394b3a83cbc3b0f96a4d762698d57"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_GitTree.git_object_by_path_GitTree.git_object_by_path.return.tree": {"doc_hash": "23fae66bce502454d54275652fd4f198f321e94e75449e54cd22a2ca8e641bc2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_from___future___import_un_MissingDep.__init__.super_MissingDep_self__": {"doc_hash": "395ff7d95d67acadd784668f6c6cf5cc3a08cdff36a3f8d40a97eeae7a00e4e8"}, "/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": "2014d36ae831c00c14a90b615362f0a5bc27a21ed058231a369701dd1e83896f"}, "/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": "a74a08701fb6f2c4874c96dd1f58618d783bd004c7739b3e2fd4f63667db9692"}, "/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": "b5ead93692a7b522eb37ec41bd121a85446b2e818858143f10a663f134f1bbda"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/compat.py_try__": {"doc_hash": "78032aff221c498fda53d0d151be688a16074420af7343b2301f3c33e1356e71"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/conftest.py_temporary_windows_drive_temporary_windows_drive.if_tear_down_result_0_.raise_RuntimeError_Could": {"doc_hash": "e7022be8586793f72245d5c482f03e8aab9cb916649adfbf0e296b6f6131d5fb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_TestDiffRepo_TestDiffCmdMessage.test.self_assertEqual_test_msg": {"doc_hash": "55fbef04a6ac1de2b554fb2bd40493539f100eea24a859b07e690bac1721d2c5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_dir_checksum_should_be_key_order_agnostic_test_dir_checksum_should_be_key_order_agnostic.assert_checksum1_check": {"doc_hash": "8c815aa4dd3870df49445e92d307c0c263fee4b47eb6d853f9412cc1854f0e0f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_partial_push_n_pull_": {"doc_hash": "e65bb8c7fa3232439f4033e2e0b6a190003c2ced71aec3e9b210b77bc72a4a4c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_updater.py_os_": {"doc_hash": "efcec9398bd25f0b5b9449edaeabc64d81b32e81875668ec69da76127069bf14"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_version.py_re_test_info_in_repo.None_7": {"doc_hash": "3bb3703d10ddde5e0ad1f9a90f7444e4cd128bbcf42fa2fccc829bd59a9a10a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_updater.py_test_fetch_": {"doc_hash": "b22010e46bc4366965c4e7a1a85e5eaa154bb7b03b2a6e1c312391fe91649788"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/api.py_from_contextlib_import_co_": {"doc_hash": "cd4bdb699c3dae64ab4b663652ac2a3d7c4a72ea8de34555b8192b2b6762e87e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/get.py_from___future___import_un_CmdGet.run.try_.except_DvcException_.return.1": {"doc_hash": "d53ce71934274d074d568f2c6d7f155da7a4e5c22d9fe09d757d2b5d31f6ba1c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/get.py_add_parser_": {"doc_hash": "66f44f1758300318d135a005f7eb94f07ea4be13947a2a3bc164b56247c8f415"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/get_url.py_from___future___import_un_": {"doc_hash": "dd32b785d2ef13c61db8264ffce56fe238cb931399a65aa5fea7a26ba778a060"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/imp_url.py_from___future___import_un_CmdImportUrl.run.return.0": {"doc_hash": "622512c31807e73eeee27a12c64144f465bd64ee06ba05f9e57ac81b99e177f7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/imp_url.py_add_parser_": {"doc_hash": "ddfbba49a1539bd99920ae510cfabe674a4a290e466b9d720d177a6ab95e8a93"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config_Config.SECTION_CORE_STORAGEPATH._storagepath_": {"doc_hash": "8cd6f184a173f6831b4f77e972606a4d2e9c0bedb55a9f6676edab0805b01987"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config.SECTION_CORE_SCHEMA_Config.SECTION_REMOTE_NO_TRAVERSE._no_traverse_": {"doc_hash": "0cca3632d06e21e4a75c54a11806400a4259e434063819377bf4545a79490dd9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config.SECTION_REMOTE_SCHEMA_Config.get_system_config_dir.return.site_config_dir_": {"doc_hash": "e72f98fd36a4407133e480c1751440282085a621b85a6f6b8f50ca876c8bacf5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config.init_Config._resolve_paths.return.ret": {"doc_hash": "5f864d08148582f296d57d4370e5166ac08d9c0866650da2c96523965f807479"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/repo.py_from___future___import_un_": {"doc_hash": "e947b25da17138850622402ab2375bef862b1ed3670cd524ffcbeacea54439f5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py_from___future___import_un_RevError.__init__.super_RevError_self___i": {"doc_hash": "10e677c3e863266887b6c3534b77c1aaefa7120dcc6037655d824b0f23b68cd6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py_ColorFormatter._parse_exc_LoggerHandler.handleError.raise_LoggingException_re": {"doc_hash": "5edef3cb64199dca91061655264900b8c4c8e15e1bc6db3a381914cee86b8607"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP.exists_RemoteHTTP.get_file_checksum.return.etag": {"doc_hash": "c06f91bc1fb120232a0103cfa33a33869c799a0fdaa223ec9a61e73f03d6fdd7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.ssh_RemoteSSH.exists.with_self_ssh_path_info_.return.ssh_exists_path_info_path": {"doc_hash": "b71b72e5548454c4b5ab3e165f2ff47be9dfb22334915e6e9f992b1b67a82437"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.batch_exists_RemoteSSH.batch_exists.with_self_ssh_path_infos_.return.results": {"doc_hash": "5000057d11319bda5600c3cd199fdbe71ade4cbbf883c399ebee63b81cd326b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.get_file_checksum_": {"doc_hash": "9eadec5373580252a7d1d44d02a3d19102e123519151df7daf307704582a4bbf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_os_create_cb.return.lambda_cur_tot_percent_": {"doc_hash": "53cd14c162e7a4eb7b1a26158ee78f23bfd117dfab53cc1ec730e98da307793e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection_SSHConnection.islink.return.stat_S_ISLNK_self_st_mode": {"doc_hash": "0a7bfbb775e68fe004b3383ffa060e58b32e4bff41c7477b4440bcab37dec3a9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.makedirs_SSHConnection.makedirs.if_tail_.try_.except_IOError_as_e_.if_e_errno_errno_EACCE.raise": {"doc_hash": "73a1706eae55d1c651502581c5e80ccdb22243ea5c512ff130ec657d26b6d371"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/brancher.py_from_dvc_scm_tree_import__": {"doc_hash": "c11e685a5baa4801a6d3988b156b64562db0d142e2d019a68fbb787bd072a9c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/get.py_os_": {"doc_hash": "dfd3d85edab0214af0f8d590039bdbb554a163587f7f580c853cfc0f4a22f5f1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/get_url.py__": {"doc_hash": "3843d82387656344046c198b56370807f3ed39ae90a77077a4b406e437b0e106"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/imp.py__": {"doc_hash": "e8a47f88ad413bc11d8a5f363f2fa4c38838073ccfa7e87f4412f36f29ea71dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_MissingDataSource_Stage.is_repo_import.return.isinstance_self_deps_0_": {"doc_hash": "c5aeaaa3828a1b69de66a034268fefde9ac733bc182d86979a853ff8f988bdd8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage._check_circular_dependency_Stage._check_duplicated_arguments.for_path_occurrence_in_p.if_occurrence_1_.raise_ArgumentDuplication": {"doc_hash": "cf71a068abbe887946941359876715cdc008368fb78260a5e2b94285981b8c32"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage._run_Stage._run.if_p_is_None_or_p_retu.raise_StageCmdFailedError": {"doc_hash": "0424b9b2c53baeefa73163adff5b353f42f60d98608c69f9c7a8932b18200504"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.save_link_State.save_link.self__execute_cmd_relat": {"doc_hash": "a3fcdddb2ea05722996faf5c035dede794ccd0e75421525a1a26a4010fe24266"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/compat.py_ignore_file_not_found__Backport_os_fspath_fr": {"doc_hash": "ba9decc1fd01d372c0f3d0bc02586078c62d4342bb9a05dedee0aa06191594da"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/__init__.py_os_": {"doc_hash": "1c179c09f2c310e0515e414007001aea7f0e28e7938303fee9b9821722dfd1ef"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py_TestGitFixture_TestGitFixture.tearDown.super_TestGitFixture_sel": {"doc_hash": "f0b2b2eddb197d83ceabf6a5a40b44e27a6472c27c80028e213974ffd7c7e3dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py_TestGitSubmoduleFixture_": {"doc_hash": "3a3bbb762f7ec45e9b2ca96bcb1fb421bbed8e97fa8cda13ab5ac1585210bf0d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/conftest.py_erepo_": {"doc_hash": "495c7a3d945b7dd53e4e30c5e4dd41b3ef66e7e5e326464b0fe8a623095629ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_api.py_pytest_test_get_url.assert_api_get_url_repo_d": {"doc_hash": "4cfdd2ff08948fb339fe5b8a60b49872c123dda6ae02f84d4edf597fa5780a15"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_api.py_test_get_url_external_test_open.with_api_open_repo_dir_FO.assert_fd_read_repo_": {"doc_hash": "53b6e46cd9d006123ea56a86b571a496d05ba2152aa8c7d83ff6eaa2ede483c5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_api.py_test_open_external_test_open_external.assert_api_read_version_": {"doc_hash": "4f75dcd8a087b8399d49ac6248292b51c2409da396f5923f425a4bd9f2c4f181"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_api.py_test_open_missing_": {"doc_hash": "5579b6faa25cc20eefd5d22b14d89df0ca929d7994019a32dc8de5fcaabe4be8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_os_": {"doc_hash": "1431d2969045339b951661abcd2c56d445b2c946f7e57cda0f473072ff9b7140"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get_url.py__": {"doc_hash": "836c1afdf3cfa79dad1b8d70da6cb3368ceea4d87d8ab1fa297a190bc9dc2a11"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_os_": {"doc_hash": "2b4ba91cb32dfe6613da034fdb3f482f49b56d07f5fb00738acad92d614c3cd7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import_url.py_dvc_TestDefaultOutput.test.with_open_filename_as_fd.self_assertEqual_fd_read_": {"doc_hash": "3096a554a62fd4a710fca7162da90782388a1ddeedb806a60dac2f0da66225d7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import_url.py_TestFailedImportMessage_TestFailedImportMessage.test.with_self__caplog_at_leve.assert_expected_error_in_": {"doc_hash": "5e7cee8f574675d70cae0ac7ab7b1ba0250244749e7c1f61b0b90f4858a5cda8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import_url.py_TestInterruptedDownload_TestInterruptedDownload._import_with_interrupt.with_patch_.with_patch_.self_assertEqual_result_": {"doc_hash": "0f42ef212eb1b7cc77631df2671e646f7ab16ef964d4f0ec3836c46f6d489552"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import_url.py_TestShouldResumeDownload_TestShouldResumeDownload.test.m_handle_write_assert_has": {"doc_hash": "bd4a9382d9c11e6f057f4b7f4d0ef5a0c4634d5b8099d3928a0d89ee8248aa30"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import_url.py_TestShouldNotResumeDownload_TestShouldNotResumeDownload.test.m_handle_write_assert_has": {"doc_hash": "054c6c175b11ee645c52a4f5d53a5a658e3ce8989f13c85e70d9cb559d020600"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import_url.py_TestShouldRemoveOutsBeforeImport_TestShouldRemoveOutsBeforeImport.test.self_assertEqual_1_remov": {"doc_hash": "e0bfa25275ed066c670f0af760e3d5a54ab3a267874cef524d44726c4d95f8d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import_url.py_TestImportFilename_": {"doc_hash": "dfb747c7daa339ce3ed578d37df9e7e901d049f99279fd58b92c524a9d886dec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_install.py_os_TestInstall.test_should_create_hooks.for_fname_command_in_hoo.with_open_self__hook_fnam.assert_command_in_fobj_re": {"doc_hash": "26553f523dc409e7559b64ec2b0c6a72ae4b4c4cd63d5d6ddb12b67947f66889"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_install.py_TestInstall.test_should_append_hooks_if_file_already_exists_TestInstall.test_should_be_idempotent.with_open_self__hook_pos.assert_fobj_read_exp": {"doc_hash": "8fc8a44e13227864fe34dd4df006490833952b94b94fbf3c7a685a7f2d897561"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_test_single_ascii_TestPipelineShow.test_dot_commands.self_assertEqual_ret_0_": {"doc_hash": "0df6a7552d2b70204b65c5208097a12c9ee5aa219fa538e614308c1395ac432a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_test_print_locked_stages_TestPipelineShowOuts.test_outs.self_assertEqual_ret_0_": {"doc_hash": "dc6893308542ee239aa24301ffeefae360b834f44b8b4cea75add53ee065dddc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_TestPipelineShowDeep_TestPipelineShowDeep.test_dot_outs.self_assertEqual_ret_0_": {"doc_hash": "10982f9fc5be4c0f35411d2cca524b3ee49173dcbbc4f5172997393bf8432bbf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproShell_TestReproShell.test.None_2.self_assertEqual_os_geten": {"doc_hash": "a03bb9039dd061af66a497f2bb34d12a77d40e127ac85087710df02bc0f02919"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestRunEmpty_TestRunNoExec.test.self_assertFalse_os_path_": {"doc_hash": "a6d280bee640153da83bea4505ffc5a1b1e15aa5c724aaf294e7c85dccb435c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_test_keyboard_interrupt_test_keyboard_interrupt.assert_": {"doc_hash": "7f359d49060b06724feeab30514f8eb915b2233a787482abc880e29374a4b510"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_test_keyboard_interrupt_after_second_signal_call_test_keyboard_interrupt_after_second_signal_call.assert_": {"doc_hash": "57f0e19e022c04bb2b452db096e84dcb4314f713f0d3698a1aefbea075bfc3a9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestPersistentOutput_TestPersistentOutput.test_ignore_build_cache.with_open_greetings_r.assert_hello_nhello_n_": {"doc_hash": "6280465e2f8d5a23c99ff482cb7a9ca950d3fb59a21e285b1948067bce9ac7a1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_test_bad_stage_fname_": {"doc_hash": "bdc3eda19558296d5d90093c640f234e32fa78c65766350feb5dd0bdc6e979ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_state.py_os_test_state.with_state_.None_2": {"doc_hash": "50dc0dfe81fe13e1be36da89059f2fd4426aa3dba0e6d75efc9d84e9ae86bdac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_state.py_test_state_overflow_mock_get_inode.return.get_inode_mocked": {"doc_hash": "1abf70d6e6cceff12fd6d24522d4548a36c15f5bb2fe5656e5bdaeecc9d0bf70"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_state.py_test_get_state_record_for_inode_test_get_state_record_for_inode.with_state_.assert_ret_is_not_None": {"doc_hash": "efb858702b1012a8588c656de96e68395813f2e247b5e66a04e742ba78fddf54"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_state.py_test_remove_unused_links_": {"doc_hash": "1d6e64b1189749a3c03f1ced9d241c3f31c9c55c36e56aa363bf6dc10d037042"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_get.py_from_dvc_cli_import_parse_": {"doc_hash": "dd25305510a5b9502ec6797df66577d2a52182da451669b2fd6d05f3af097d8c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_get_url.py__": {"doc_hash": "6b9c1cf96fe3d56e6758f28690849627b9d970781647becfa5d45f69fcd59ea6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_imp.py_from_dvc_cli_import_parse_": {"doc_hash": "35791c17dde8a6ce7836d46ac0743a8eee007f32a0e81f4373263c1dd21cb122"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_imp_url.py_from_dvc_cli_import_parse_": {"doc_hash": "005c4d9b8b9331c7ea244021455203ece8455a573e10c3d55dbda4e13a9bb594"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_run.py_from_dvc_cli_import_parse_test_run.m_assert_called_once_with": {"doc_hash": "f22915cb5ac13914db1be59736a43a76b39c8221efd6015d4db627d1b019aeb6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_run.py_test_run_args_from_cli_test_run_args_from_cli.m_assert_called_once_with": {"doc_hash": "adbabb744d96c6d098c84d5860efbf36c440a78f85b9e0d4c1274bc084845536"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_run.py_test_run_args_with_spaces_": {"doc_hash": "cc91094bb6295f6ccb22a367a23cc92e89797fb83528ca822351acf723f1b952"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_test_get_parent_dirs_up_to_test_get_parent_dirs_up_to.assert_set_result_set": {"doc_hash": "9f057c2ae956b16cb43f82965229107c8058f0c96d8e901cd8f45b55c2808684"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_test_relpath_windows_different_drives_": {"doc_hash": "9c16fa00cb7eb175bf74ce31e31c332c7cf3e27c8a6c555713a9be59bf8b7fe1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_utils.py_pytest_test_to_chunks_chunk_size.assert_result_expected": {"doc_hash": "10471f118f7c39cc9b4aa22d1afa568fca881db970d95f4540336437fccd9128"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_utils.py_test_to_chunks_should_raise_": {"doc_hash": "4997e44eed1f1526e9466d26fbeffebdeba421f0a2435b22b319f24cdfe90493"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/update.py_from___future___import_un_": {"doc_hash": "741c2dc04a0352eec73efd9d993d09b25ecff012a54ec53b669f3e83d5a5f5d9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py__clone_": {"doc_hash": "8fc59635dd25d9aae81a67302d87d0135cb1f81c013379763d241bbbb751cabf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_PathInfo_PathInfo.if_is_py2_.as_posix.return.str_self_replace_f_sep_": {"doc_hash": "5be745008d66e76dd6573218c35731af26668fce386919859c32b9fe06d0711a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_WindowsPathInfo__URLPathParents.__repr__.return._parents_format_sel": {"doc_hash": "37571b7327b6783ffab6df673c7936b9c03f223a759b30bbb25dc218d029ffe7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._collect_dir_RemoteBASE._collect_dir.return.sorted_dir_info_values_": {"doc_hash": "ae23633993245f4bbeaf12f11fb81a6255796d632d16775d623727672d34f6af"}, "/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": "20c891d78317f3868c167b749c33770b732f727ea89d7cc930a99f4a0c79df6a"}, "/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": "78e6093b3a605d545bc4d3d2892a97bb9ca6ee5c9cd6ed08098c63e26beab330"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.find_out_by_relpath_": {"doc_hash": "fcb6bd7f30414728ae443982f87725d88f706f3833c119f7836bcdd70dc56ef7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/imp_url.py_from_dvc_utils_compat_imp_": {"doc_hash": "35f9fe565dfde3c88286e5fcf75e38578784236b32e6b491d2c86e25704211c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/update.py__": {"doc_hash": "8fea944867ed1e90c671fc0120191808b517071be23e75dcd4a1f810d3263166"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage.update_Stage._check_stage_path.if_not_real_path_os_pa.raise_StagePathOutsideErr": {"doc_hash": "a8694a503922a8de21bcf5e0fa485804f83d90513dbd3dba208b9bf1b605fb39"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproDownstream_TestReproDownstream.test.assert_evaluation_2_relp": {"doc_hash": "6a7d2a0cac82ef092171109ccfde640839a41a0efa9d7c4e78a50d080978da24"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_ssh_dir_out_": {"doc_hash": "236dce6f6e5e4939f82a75dd39613ffb1f139d250a824bb7e6685624a59ab7a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_update.py_os_": {"doc_hash": "eccadd315dda5552556385ef47c657e7e8073c936f3e0809816b831246f90f98"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_update.py_from_dvc_cli_import_parse_": {"doc_hash": "031ac91f093a8b92fb4cd0dfe0930f8d044467a03d14e29a1c24cf98ba701adc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_path_info.py_pytest_": {"doc_hash": "b83821ab3a9601120ddfd8b5c2f8b0ac96df1950f3fbc19b899f829bb15102d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_stage.py_TestPathConversion_test_stage_fname.assert_fname_out_txt_": {"doc_hash": "020b94d8571e6864977fc05b3cee72170404f9c096c516f2cff3af194dd843e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_stage.py_test_stage_update_": {"doc_hash": "ced211d6b92979cff4e12b23eec09cd9651233121abb2653d41a6e0361bec6b0"}}, "docstore/data": {"/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/__main__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/__main__.py__", "embedding": null, "metadata": {"file_path": "dvc/__main__.py", "file_name": "__main__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 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": 146, "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": 902}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\nimport logging\n\nfrom dvc import __version__\n\n\nlogger = logging.getLogger(__name__)\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 except ValueError as exc:\n logger.debug(\"Failed to load user_id: {}\".format(exc))\n return None\n\n return info[self.PARAM_USER_ID]\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": 148, "end_line": 181, "span_ids": ["Analytics.collect", "Analytics._collect_system_info"], "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 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/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": 102, "span_ids": ["VersionAction.__call__", "docstring", "DvcParser", "DvcParser.error", "VersionAction"], "tokens": 548}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\nimport logging\n\nfrom dvc.command.base import fix_subparsers\nimport dvc.command.init as init\nimport dvc.command.get as get\nimport dvc.command.get_url as get_url\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.imp_url as imp_url\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\nimport dvc.command.diff as diff\nimport dvc.command.version as version\nimport dvc.command.update as update\nfrom dvc.exceptions import DvcParserError\n\n\nlogger = logging.getLogger(__name__)\n\nCOMMANDS = [\n init,\n get,\n get_url,\n destroy,\n add,\n remove,\n move,\n unprotect,\n run,\n repro,\n data_sync,\n gc,\n imp,\n imp_url,\n config,\n checkout,\n remote,\n cache,\n metrics,\n install,\n root,\n lock,\n pipeline,\n daemon,\n commit,\n tag,\n diff,\n version,\n update,\n]\n\n\nclass DvcParser(argparse.ArgumentParser):\n \"\"\"Custom parser class for dvc CLI.\"\"\"\n\n def error(self, message):\n \"\"\"Custom error method.\n Args:\n message (str): error message.\n\n Raises:\n dvc.exceptions.DvcParser: dvc parser exception.\n \"\"\"\n logger.error(message)\n self.print_help()\n raise DvcParserError()\n\n\nclass VersionAction(argparse.Action): # pragma: no cover\n # pylint: disable=too-few-public-methods\n \"\"\"Shows dvc version and exits.\"\"\"\n\n def __call__(self, parser, namespace, values, option_string=None):\n from dvc import __version__\n\n print(__version__)\n sys.exit(0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/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": 38, "end_line": 79, "span_ids": ["CmdBaseNoRepo.run_cmd", "CmdBase.run_cmd", "CmdBase.default_targets", "CmdBaseNoRepo.__init__", "CmdBase", "CmdBase.__init__", "CmdBase.run", "CmdBaseNoRepo"], "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 CmdBase(object):\n def __init__(self, args):\n from dvc.repo import Repo\n from dvc.updater import Updater\n\n self.repo = Repo()\n self.config = self.repo.config\n self.args = args\n updater = Updater(self.repo.dvc_dir)\n updater.check()\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 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.exception(\"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\n\n\nclass CmdBaseNoRepo(CmdBase):\n def __init__(self, args):\n self.args = args\n\n def run_cmd(self):\n return 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/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": 65, "span_ids": ["imports", "CmdCacheDir.__init__", "CmdCacheDir.run", "CmdCacheDir", "add_parser"], "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": "from __future__ import unicode_literals\n\nimport argparse\n\nfrom dvc.command.base import fix_subparsers, append_doc_link\nfrom dvc.command.config import CmdConfig\nfrom dvc.cache import CacheConfig\n\n\nclass CmdCacheDir(CmdConfig):\n def __init__(self, args):\n super(CmdCacheDir, self).__init__(args)\n self.cache_config = CacheConfig(self.config)\n\n def run(self):\n self.cache_config.set_dir(self.args.value, level=self.args.level)\n return 0\n\n\ndef add_parser(subparsers, parent_parser):\n from dvc.command.config import parent_config_parser\n\n CACHE_HELP = \"Manage cache settings.\"\n\n cache_parser = subparsers.add_parser(\n \"cache\",\n parents=[parent_parser],\n description=append_doc_link(CACHE_HELP, \"cache\"),\n help=CACHE_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n\n cache_subparsers = cache_parser.add_subparsers(\n dest=\"cmd\", 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 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": 61, "span_ids": ["imports", "CmdCheckout", "add_parser", "CmdCheckout.run"], "tokens": 345}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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 \"-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 \"-d\",\n \"--with-deps\",\n action=\"store_true\",\n default=False,\n help=\"Checkout all dependencies of the specified target.\",\n )\n checkout_parser.add_argument(\n \"-R\",\n \"--recursive\",\n action=\"store_true\",\n default=False,\n help=\"Checkout all subdirectories of the specified directory.\",\n )\n checkout_parser.add_argument(\n \"targets\",\n nargs=\"*\",\n help=\"DVC-files to checkout. Optional. \"\n \"(Finds all DVC-files in the workspace by default.)\",\n )\n checkout_parser.set_defaults(func=CmdCheckout)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/commit.py_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": 33, "span_ids": ["imports", "CmdCommit", "CmdCommit.run"], "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": "from __future__ import unicode_literals\n\nimport argparse\nimport logging\n\nfrom dvc.exceptions import DvcException\nfrom dvc.command.base import CmdBase, append_doc_link\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdCommit(CmdBase):\n def run(self):\n if not self.args.targets:\n self.args.targets = [None]\n\n for target in self.args.targets:\n try:\n self.repo.commit(\n target,\n with_deps=self.args.with_deps,\n recursive=self.args.recursive,\n force=self.args.force,\n )\n except DvcException:\n logger.exception(\n \"failed to commit{}\".format(\n (\" \" + target) if target else \"\"\n )\n )\n return 1\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/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": 36, "end_line": 74, "span_ids": ["add_parser"], "tokens": 249}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n COMMIT_HELP = \"Save changed data to cache and update DVC-files.\"\n\n commit_parser = subparsers.add_parser(\n \"commit\",\n parents=[parent_parser],\n description=append_doc_link(COMMIT_HELP, \"commit\"),\n help=COMMIT_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n commit_parser.add_argument(\n \"-f\",\n \"--force\",\n action=\"store_true\",\n default=False,\n help=\"Commit even if 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\",\n nargs=\"*\",\n help=\"DVC-files to commit. Optional. \"\n \"(Finds all DVC-files in the workspace by default.)\",\n )\n commit_parser.set_defaults(func=CmdCommit)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/daemon.py_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": 31, "span_ids": ["CmdDaemonAnalytics.run", "CmdDaemonBase", "imports", "CmdDaemonUpdater.run", "CmdDaemonAnalytics", "CmdDaemonUpdater"], "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\nfrom dvc.command.base import CmdBaseNoRepo, fix_subparsers\n\n\nclass CmdDaemonBase(CmdBaseNoRepo):\n pass\n\n\nclass CmdDaemonUpdater(CmdDaemonBase):\n def run(self):\n import os\n from dvc.repo import Repo\n from dvc.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": 32, "span_ids": ["CmdDataBase.check_up_to_date", "CmdDataBase.run", "imports", "CmdDataBase.do_run", "CmdDataBase"], "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": "from __future__ import unicode_literals\n\nimport argparse\nimport logging\n\nfrom dvc.command.base import CmdBase, append_doc_link\nfrom dvc.exceptions import DvcException\n\n\nlogger = logging.getLogger(__name__)\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": 35, "end_line": 53, "span_ids": ["CmdDataPull.do_run", "CmdDataPull"], "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 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 DvcException:\n logger.exception(\"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": 56, "end_line": 73, "span_ids": ["CmdDataPush.do_run", "CmdDataPush"], "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 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 DvcException:\n logger.exception(\"failed to push data to the cloud\")\n return 1\n self.check_up_to_date(processed_files_count)\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/data_sync.py_CmdDataFetch_CmdDataFetch.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": 76, "end_line": 93, "span_ids": ["CmdDataFetch.do_run", "CmdDataFetch"], "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 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 DvcException:\n logger.exception(\"failed to fetch data from the cloud\")\n return 1\n self.check_up_to_date(processed_files_count)\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/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": 96, "end_line": 119, "span_ids": ["shared_parent_parser"], "tokens": 166}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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\", \"--jobs\", type=int, 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\",\n nargs=\"*\",\n help=\"Limit command scope to these DVC-files. \"\n \"Using -R, directories to search DVC-files in can also be given.\",\n )\n\n return shared_parent_parser", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/destroy.py_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": 34, "span_ids": ["imports", "CmdDestroy.run_cmd", "CmdDestroy"], "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": "from __future__ import unicode_literals\n\nimport argparse\nimport logging\n\nimport dvc.prompt as prompt\nfrom dvc.command.base import CmdBase, append_doc_link\nfrom dvc.exceptions import DvcException\n\n\nlogger = logging.getLogger(__name__)\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.exception(\"failed to destroy DVC\")\n return 1\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/destroy.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/destroy.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/destroy.py", "file_name": "destroy.py", "file_type": "text/x-python", "category": "implementation", "start_line": 37, "end_line": 55, "span_ids": ["add_parser"], "tokens": 123}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n DESTROY_HELP = \"Remove DVC-files, local DVC config and data cache.\"\n\n destroy_parser = subparsers.add_parser(\n \"destroy\",\n parents=[parent_parser],\n description=append_doc_link(DESTROY_HELP, \"destroy\"),\n help=DESTROY_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n destroy_parser.add_argument(\n \"-f\",\n \"--force\",\n action=\"store_true\",\n default=False,\n help=\"Force destruction.\",\n )\n destroy_parser.set_defaults(func=CmdDestroy)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/gc.py_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": 49, "span_ids": ["imports", "CmdGC", "CmdGC.run"], "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 argparse\nimport os\nimport dvc.prompt as prompt\nimport logging\n\nfrom dvc.command.base import CmdBase, append_doc_link\n\n\nlogger = logging.getLogger(__name__)\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": 52, "end_line": 110, "span_ids": ["add_parser"], "tokens": 395}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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\", \"--jobs\", type=int, 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 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": 34, "span_ids": ["CmdImport.run", "imports", "CmdImport"], "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 logging\n\nfrom dvc.exceptions import DvcException\nfrom dvc.command.base import CmdBase, append_doc_link\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdImport(CmdBase):\n def run(self):\n logger.warning(\n \"This is a beta feature! Do not use in the production! Old \"\n \"`dvc import` is now called `dvc import-url`, please use \"\n \"it instead.\"\n )\n try:\n self.repo.imp(\n self.args.url,\n self.args.path,\n out=self.args.out,\n rev=self.args.rev,\n )\n except DvcException:\n logger.exception(\n \"failed to import '{}' from '{}'.\".format(\n self.args.path, self.args.url\n )\n )\n return 1\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/imp.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": 37, "end_line": 61, "span_ids": ["add_parser"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n IMPORT_HELP = (\n \"BETA: Download data from DVC repository and take it under DVC \"\n \"control.\"\n )\n\n import_parser = subparsers.add_parser(\n \"import\",\n parents=[parent_parser],\n description=append_doc_link(IMPORT_HELP, \"import\"),\n help=IMPORT_HELP,\n formatter_class=argparse.RawTextHelpFormatter,\n )\n import_parser.add_argument(\"url\", help=\"DVC repository URL.\")\n import_parser.add_argument(\n \"path\", help=\"Path to data within DVC repository.\"\n )\n import_parser.add_argument(\n \"-o\", \"--out\", nargs=\"?\", help=\"Destination path to put data to.\"\n )\n import_parser.add_argument(\n \"--rev\", nargs=\"?\", help=\"DVC repository git revision.\"\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": 32, "span_ids": ["imports", "add_parser", "CmdInstall.run_cmd", "CmdInstall"], "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": "from __future__ import unicode_literals\n\nimport argparse\nimport logging\n\nfrom dvc.command.base import CmdBase, append_doc_link\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdInstall(CmdBase):\n def run_cmd(self):\n try:\n self.repo.install()\n except Exception:\n logger.exception(\"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": 39, "end_line": 63, "span_ids": ["add_parser"], "tokens": 196}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n LOCK_HELP = \"Lock DVC-files.\"\n lock_parser = subparsers.add_parser(\n \"lock\",\n parents=[parent_parser],\n description=append_doc_link(LOCK_HELP, \"lock\"),\n help=LOCK_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n lock_parser.add_argument(\"targets\", nargs=\"+\", help=\"DVC-files to lock.\")\n lock_parser.set_defaults(func=CmdLock)\n\n UNLOCK_HELP = \"Unlock DVC-files.\"\n unlock_parser = subparsers.add_parser(\n \"unlock\",\n parents=[parent_parser],\n description=append_doc_link(UNLOCK_HELP, \"unlock\"),\n help=UNLOCK_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n unlock_parser.add_argument(\n \"targets\", nargs=\"+\", help=\"DVC-files to unlock.\"\n )\n unlock_parser.set_defaults(func=CmdUnlock)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/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": 58, "end_line": 94, "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.exception(\"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.exception(msg)\n return 1\n\n return 0\n\n\nclass CmdMetricsRemove(CmdBase):\n def run(self):\n try:\n self.repo.metrics.remove(self.args.path)\n except DvcException:\n msg = \"failed to remove metric file '{}'\".format(self.args.path)\n logger.exception(msg)\n return 1\n\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": 46, "span_ids": ["imports", "CmdMove.run", "add_parser", "CmdMove"], "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": "from __future__ import unicode_literals\n\nimport argparse\nimport logging\n\nfrom dvc.exceptions import DvcException\nfrom dvc.command.base import CmdBase, append_doc_link\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdMove(CmdBase):\n def run(self):\n try:\n self.repo.move(self.args.src, self.args.dst)\n except DvcException:\n msg = \"failed to move '{}' -> '{}'\".format(\n self.args.src, self.args.dst\n )\n logger.exception(msg)\n return 1\n return 0\n\n\ndef add_parser(subparsers, parent_parser):\n MOVE_HELP = \"Rename or move a DVC controlled data file or a directory.\"\n MOVE_DESCRIPTION = (\n \"Rename or move a DVC controlled data file or a directory.\\n\"\n \"It renames and modifies the corresponding DVC-file to reflect the\"\n \" changes.\"\n )\n\n move_parser = subparsers.add_parser(\n \"move\",\n parents=[parent_parser],\n description=append_doc_link(MOVE_DESCRIPTION, \"move\"),\n help=MOVE_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n move_parser.add_argument(\n \"src\", help=\"Source path to a data file or directory.\"\n )\n move_parser.add_argument(\"dst\", help=\"Destination path.\")\n move_parser.set_defaults(func=CmdMove)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/pipeline.py_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": 183, "end_line": 265, "span_ids": ["add_parser"], "tokens": 548}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 pipelines.\"\n pipeline_show_parser = pipeline_subparsers.add_parser(\n \"show\",\n parents=[parent_parser],\n description=append_doc_link(PIPELINE_SHOW_HELP, \"pipeline-show\"),\n help=PIPELINE_SHOW_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n pipeline_show_group = pipeline_show_parser.add_mutually_exclusive_group()\n pipeline_show_group.add_argument(\n \"-c\",\n \"--commands\",\n action=\"store_true\",\n default=False,\n help=\"Print commands instead of paths to DVC-files.\",\n )\n pipeline_show_group.add_argument(\n \"-o\",\n \"--outs\",\n action=\"store_true\",\n default=False,\n help=\"Print output files instead of paths to DVC-files.\",\n )\n pipeline_show_parser.add_argument(\n \"-l\",\n \"--locked\",\n action=\"store_true\",\n default=False,\n help=\"Print locked DVC stages\",\n )\n pipeline_show_parser.add_argument(\n \"--ascii\",\n action=\"store_true\",\n default=False,\n help=\"Output DAG as ASCII.\",\n )\n pipeline_show_parser.add_argument(\n \"--dot\",\n action=\"store_true\",\n default=False,\n help=\"Print DAG with .dot format.\",\n )\n pipeline_show_parser.add_argument(\n \"--tree\",\n action=\"store_true\",\n default=False,\n help=\"Output DAG as Dependencies Tree.\",\n )\n pipeline_show_parser.add_argument(\n \"targets\",\n nargs=\"*\",\n help=\"DVC-files to show pipeline for. Optional. \"\n \"(Finds all DVC-files in the workspace by default.)\",\n )\n pipeline_show_parser.set_defaults(func=CmdPipelineShow)\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_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": 65, "end_line": 179, "span_ids": ["add_parser"], "tokens": 842}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 of the remote\")\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.add_argument(\n \"-f\",\n \"--force\",\n action=\"store_true\",\n default=False,\n help=\"Force overwriting existing configs\",\n )\n remote_add_parser.set_defaults(func=CmdRemoteAdd)\n\n REMOTE_DEFAULT_HELP = \"Set/unset 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(\n \"name\", help=\"Name of the remote to remove.\"\n )\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 of the remote.\")\n remote_modify_parser.add_argument(\n \"option\", help=\"Name of the option to modify.\"\n )\n remote_modify_parser.add_argument(\n \"value\", nargs=\"?\", help=\"(optional) Value of the option.\"\n )\n remote_modify_parser.add_argument(\n \"-u\",\n \"--unset\",\n default=False,\n action=\"store_true\",\n help=\"Unset option.\",\n )\n remote_modify_parser.set_defaults(func=CmdRemoteModify)\n\n REMOTE_LIST_HELP = \"List 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": 42, "span_ids": ["CmdRemove.run", "imports", "CmdRemove._is_outs_only", "CmdRemove"], "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": "from __future__ import unicode_literals\n\nimport argparse\nimport logging\n\nimport dvc.prompt as prompt\nfrom dvc.exceptions import DvcException\nfrom dvc.command.base import CmdBase, append_doc_link\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdRemove(CmdBase):\n def _is_outs_only(self, target):\n if not self.args.purge:\n return True\n\n if self.args.force:\n return False\n\n msg = \"Are you sure you want to remove {} with its outputs?\".format(\n target\n )\n\n if prompt.confirm(msg):\n return False\n\n raise DvcException(\n \"Cannot purge without a confirmation from the user.\"\n \" Use '-f' to force.\"\n )\n\n def run(self):\n for target in self.args.targets:\n try:\n outs_only = self._is_outs_only(target)\n self.repo.remove(target, outs_only=outs_only)\n except DvcException:\n logger.exception(\"failed to remove {}\".format(target))\n return 1\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/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": 45, "end_line": 83, "span_ids": ["add_parser"], "tokens": 250}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n REMOVE_HELP = \"Remove DVC-file outputs.\"\n remove_parser = subparsers.add_parser(\n \"remove\",\n parents=[parent_parser],\n description=append_doc_link(REMOVE_HELP, \"remove\"),\n help=REMOVE_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n remove_parser_group = remove_parser.add_mutually_exclusive_group()\n remove_parser_group.add_argument(\n \"-o\",\n \"--outs\",\n action=\"store_true\",\n default=True,\n help=\"Only remove DVC-file outputs. (Default)\",\n )\n remove_parser_group.add_argument(\n \"-p\",\n \"--purge\",\n action=\"store_true\",\n default=False,\n help=\"Remove DVC-file and all its outputs.\",\n )\n remove_parser.add_argument(\n \"-f\",\n \"--force\",\n action=\"store_true\",\n default=False,\n help=\"Force purge.\",\n )\n remove_parser.add_argument(\n \"targets\",\n nargs=\"+\",\n help=\"DVC-files to remove. Optional. \"\n \"(Finds all DVC-files in the workspace by default.)\",\n )\n remove_parser.set_defaults(func=CmdRemove)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/repro.py_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": 57, "span_ids": ["CmdRepro.run", "imports", "CmdRepro"], "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": "from __future__ import unicode_literals\n\nimport argparse\nimport os\nimport logging\n\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\nlogger = logging.getLogger(__name__)\n\n\nclass CmdRepro(CmdBase):\n def run(self):\n saved_dir = os.path.realpath(os.curdir)\n if self.args.cwd:\n os.chdir(self.args.cwd)\n\n # Dirty hack so the for loop below can at least enter once\n if self.args.all_pipelines:\n self.args.targets = [None]\n elif not self.args.targets:\n self.args.targets = self.default_targets\n\n ret = 0\n for target in self.args.targets:\n try:\n stages = self.repo.reproduce(\n target,\n single_item=self.args.single_item,\n force=self.args.force,\n dry=self.args.dry,\n interactive=self.args.interactive,\n pipeline=self.args.pipeline,\n all_pipelines=self.args.all_pipelines,\n ignore_build_cache=self.args.ignore_build_cache,\n no_commit=self.args.no_commit,\n downstream=self.args.downstream,\n recursive=self.args.recursive,\n )\n\n if len(stages) == 0:\n logger.info(CmdDataStatus.UP_TO_DATE_MSG)\n\n if self.args.metrics:\n metrics = self.repo.metrics.show()\n show_metrics(metrics)\n except DvcException:\n logger.exception(\"\")\n ret = 1\n break\n\n os.chdir(saved_dir)\n return ret", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/repro.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/repro.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/repro.py", "file_name": "repro.py", "file_type": "text/x-python", "category": "implementation", "start_line": 60, "end_line": 158, "span_ids": ["add_parser"], "tokens": 592}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 stages 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. 'Dvcfile' by default.\",\n )\n repro_parser.add_argument(\n \"-f\",\n \"--force\",\n action=\"store_true\",\n default=False,\n help=\"Reproduce even if dependencies were not changed.\",\n )\n repro_parser.add_argument(\n \"-s\",\n \"--single-item\",\n action=\"store_true\",\n default=False,\n help=\"Reproduce only single data item without recursive dependencies \"\n \"check.\",\n )\n repro_parser.add_argument(\n \"-c\",\n \"--cwd\",\n default=os.path.curdir,\n help=\"Directory within your repo to reproduce from.\",\n )\n repro_parser.add_argument(\n \"-m\",\n \"--metrics\",\n action=\"store_true\",\n default=False,\n help=\"Show metrics after reproduction.\",\n )\n repro_parser.add_argument(\n \"--dry\",\n action=\"store_true\",\n default=False,\n help=\"Only print the commands that would be executed without \"\n \"actually executing.\",\n )\n repro_parser.add_argument(\n \"-i\",\n \"--interactive\",\n action=\"store_true\",\n default=False,\n help=\"Ask for confirmation before reproducing each stage.\",\n )\n repro_parser.add_argument(\n \"-p\",\n \"--pipeline\",\n action=\"store_true\",\n default=False,\n help=\"Reproduce the whole pipeline that the specified stage file \"\n \"belongs to.\",\n )\n repro_parser.add_argument(\n \"-P\",\n \"--all-pipelines\",\n action=\"store_true\",\n default=False,\n help=\"Reproduce all pipelines in the repo.\",\n )\n repro_parser.add_argument(\n \"-R\",\n \"--recursive\",\n action=\"store_true\",\n default=False,\n help=\"Reproduce all stages in the specified directory.\",\n )\n repro_parser.add_argument(\n \"--ignore-build-cache\",\n action=\"store_true\",\n default=False,\n help=\"Reproduce all descendants of a changed stage even if their \"\n \"direct dependencies didn't change.\",\n )\n repro_parser.add_argument(\n \"--no-commit\",\n action=\"store_true\",\n default=False,\n help=\"Don't put files/directories into cache.\",\n )\n repro_parser.add_argument(\n \"--downstream\",\n action=\"store_true\",\n default=False,\n help=\"Reproduce the pipeline starting from the specified stage.\",\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": ["imports", "CmdRoot.run", "CmdRoot", "add_parser"], "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 logging\n\nfrom dvc.repo import Repo\nfrom dvc.command.base import CmdBaseNoRepo, append_doc_link\nfrom dvc.utils import relpath\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdRoot(CmdBaseNoRepo):\n def run(self):\n logger.info(relpath(Repo.find_root()))\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": 59, "span_ids": ["imports", "CmdRun", "CmdRun.run"], "tokens": 372}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import unicode_literals\n\nimport argparse\nimport logging\n\nfrom dvc.command.base import CmdBase, append_doc_link\nfrom dvc.exceptions import DvcException\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdRun(CmdBase):\n def run(self):\n overwrite = self.args.yes or self.args.overwrite_dvcfile\n\n if not any(\n [\n self.args.deps,\n self.args.outs,\n self.args.outs_no_cache,\n self.args.metrics,\n self.args.metrics_no_cache,\n self.args.outs_persist,\n self.args.outs_persist_no_cache,\n self.args.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.exception(\"failed to run command\")\n return 1\n\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/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": 83, "end_line": 196, "span_ids": ["add_parser"], "tokens": 726}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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\", \"--file\", help=\"Specify name of the DVC-file it generates.\"\n )\n run_parser.add_argument(\n \"-c\", \"--cwd\", help=\"Deprecated, use -w and -f instead.\"\n )\n run_parser.add_argument(\n \"-w\",\n \"--wdir\",\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=\"Deprecated, this is now the default behavior\",\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": 41, "span_ids": ["imports", "CmdDataStatus._normalize", "CmdDataStatus", "CmdDataStatus._show"], "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": "from __future__ import unicode_literals\n\nimport logging\n\nfrom dvc.command.data_sync import CmdDataBase\nfrom dvc.utils.compat import str\n\n\nlogger = logging.getLogger(__name__)\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": 43, "end_line": 68, "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.exception(\"failed to obtain data status\")\n return 1\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/unprotect.py_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": 38, "span_ids": ["imports", "add_parser", "CmdUnprotect", "CmdUnprotect.run"], "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": "from __future__ import unicode_literals\n\nimport argparse\nimport logging\n\nfrom dvc.exceptions import DvcException\nfrom dvc.command.base import CmdBase, append_doc_link\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdUnprotect(CmdBase):\n def run(self):\n for target in self.args.targets:\n try:\n self.repo.unprotect(target)\n except DvcException:\n msg = \"failed to unprotect '{}'\".format(target)\n logger.exception(msg)\n return 1\n return 0\n\n\ndef add_parser(subparsers, parent_parser):\n UNPROTECT_HELP = \"Unprotect data files or directories.\"\n unprotect_parser = subparsers.add_parser(\n \"unprotect\",\n parents=[parent_parser],\n description=append_doc_link(UNPROTECT_HELP, \"unprotect\"),\n help=UNPROTECT_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n unprotect_parser.add_argument(\n \"targets\", nargs=\"+\", help=\"Data files/directories to unprotect.\"\n )\n unprotect_parser.set_defaults(func=CmdUnprotect)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/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": 37, "span_ids": ["_spawn_windows", "docstring"], "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": "\"\"\"Launch `dvc daemon` command in a separate detached process.\"\"\"\n\nfrom __future__ import unicode_literals\n\nimport os\nimport sys\nimport inspect\nimport logging\nfrom subprocess import Popen\n\nfrom dvc.env import DVC_DAEMON\nfrom dvc.utils import is_binary, fix_env\nfrom dvc.utils.compat import cast_bytes_py2\n\n\nlogger = logging.getLogger(__name__)\n\nCREATE_NEW_PROCESS_GROUP = 0x00000200\nDETACHED_PROCESS = 0x00000008\n\n\ndef _spawn_windows(cmd, env):\n from subprocess import STARTUPINFO, STARTF_USESHOWWINDOW\n\n creationflags = CREATE_NEW_PROCESS_GROUP | DETACHED_PROCESS\n\n startupinfo = STARTUPINFO()\n startupinfo.dwFlags |= STARTF_USESHOWWINDOW\n\n Popen(\n cmd,\n env=env,\n close_fds=True,\n shell=False,\n creationflags=creationflags,\n startupinfo=startupinfo,\n ).communicate()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/daemon.py__spawn_posix__spawn_posix._pylint_disable_protect": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/daemon.py__spawn_posix__spawn_posix._pylint_disable_protect", "embedding": null, "metadata": {"file_path": "dvc/daemon.py", "file_name": "daemon.py", "file_type": "text/x-python", "category": "implementation", "start_line": 40, "end_line": 69, "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.exception(\"failed at first fork\")\n os._exit(1) # pylint: disable=protected-access\n\n os.setsid()\n os.umask(0)\n\n try:\n pid = os.fork()\n if pid > 0:\n os._exit(0) # pylint: disable=protected-access\n except OSError:\n logger.exception(\"failed at second fork\")\n os._exit(1) # pylint: disable=protected-access\n\n sys.stdin.close()\n sys.stdout.close()\n sys.stderr.close()\n\n Popen(cmd, env=env, close_fds=True, shell=False).communicate()\n\n os._exit(0) # pylint: disable=protected-access", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dagascii.py__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_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": 80, "end_line": 100, "span_ids": ["DataCloud._init_compat"], "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 DataCloud(object):\n\n def _init_compat(self):\n name = self._core.get(Config.SECTION_CORE_CLOUD, \"\").strip().lower()\n if name == \"\":\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.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": 128, "end_line": 144, "span_ids": ["DataCloud.pull"], "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 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_remote(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": 146, "end_line": 162, "span_ids": ["DataCloud.status"], "tokens": 161}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DataCloud(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 remote = self.get_remote(remote, \"status\")\n return self.repo.cache.local.status(\n targets, jobs=jobs, remote=remote, show_checksums=show_checksums\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/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": 26, "span_ids": ["DependencyBase", "DependencyDoesNotExistError", "DependencyDoesNotExistError.__init__", "DependencyIsNotFileOrDirError", "imports", "DependencyBase.update", "DependencyIsNotFileOrDirError.__init__"], "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.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\n\n def update(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/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/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": 30, "span_ids": ["DvcException.__init__", "DvcException", "docstring"], "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": "\"\"\"Exceptions raised by the dvc.\"\"\"\n\nfrom __future__ import unicode_literals\n\nfrom dvc.utils.compat import str, builtin_str\n\nimport traceback\n\nfrom dvc.utils import relpath\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": 33, "end_line": 68, "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 DVC-file with output '{path}'\".format(\n 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": 71, "end_line": 90, "span_ids": ["StagePathAsOutputError.__init__", "StagePathAsOutputError"], "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 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 DVC-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": 121, "span_ids": ["ArgumentDuplicationError", "ArgumentDuplicationError.__init__", "CircularDependencyError", "CircularDependencyError.__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": "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, builtin_str))\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, 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/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": 61, "span_ids": ["main", "docstring"], "tokens": 310}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Main entry point for dvc CLI.\"\"\"\n\nfrom __future__ import unicode_literals\n\nimport logging\n\nfrom dvc.cli import parse_args\nfrom dvc.config import ConfigError\nfrom dvc.analytics import Analytics\nfrom dvc.exceptions import NotDvcRepoError, DvcParserError\n\n\nlogger = logging.getLogger(\"dvc\")\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\n outerLogLevel = logger.level\n try:\n args = parse_args(argv)\n\n if args.quiet:\n logger.setLevel(logging.CRITICAL)\n\n elif args.verbose:\n logger.setLevel(logging.DEBUG)\n logging.getLogger(\"paramiko\").setLevel(logging.DEBUG)\n\n cmd = args.func(args)\n ret = cmd.run_cmd()\n except ConfigError:\n logger.exception(\"configuration error\")\n ret = 251\n except KeyboardInterrupt:\n logger.exception(\"interrupted by the user\")\n ret = 252\n except NotDvcRepoError:\n logger.exception(\"\")\n ret = 253\n except DvcParserError:\n ret = 254\n except Exception: # pylint: disable=broad-except\n logger.exception(\"unexpected error\")\n ret = 255\n finally:\n logger.setLevel(outerLogLevel)\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": 32, "span_ids": ["OutputIsNotFileOrDirError.__init__", "imports", "OutputDoesNotExistError.__init__", "OutputIsNotFileOrDirError", "OutputDoesNotExistError", "OutputAlreadyTrackedError.__init__", "OutputAlreadyTrackedError"], "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 logging\nfrom copy import copy\n\nfrom schema import Or, Optional\n\nimport dvc.prompt as prompt\nfrom dvc.exceptions import DvcException\nfrom dvc.utils.compat import str, urlparse\nfrom dvc.remote.base import RemoteBASE\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass OutputDoesNotExistError(DvcException):\n def __init__(self, path):\n msg = \"output '{}' does not exist\".format(path)\n super(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/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/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": 458}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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": 63, "span_ids": ["password", "confirm", "_ask", "docstring"], "tokens": 302}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Manages user prompts.\"\"\"\n\nfrom __future__ import unicode_literals\nfrom __future__ import print_function\n\nimport sys\nimport logging\nfrom getpass import getpass\n\nfrom dvc.utils.compat import input\n\n\nlogger = logging.getLogger(__name__)\n\n\ndef _ask(prompt, limited_to=None):\n if not sys.stdout.isatty():\n return None\n\n while True:\n try:\n answer = input(prompt + \" \").lower()\n except EOFError:\n return None\n\n if not limited_to:\n return answer\n\n if answer in limited_to:\n return answer\n\n logger.info(\n \"Your response must be one of: {options}. \"\n \"Please try again.\".format(options=limited_to)\n )\n\n\ndef confirm(statement):\n \"\"\"Ask the user for confirmation about the specified statement.\n\n Args:\n statement (unicode): statement to ask the user confirmation about.\n\n Returns:\n bool: whether or not specified statement was confirmed.\n \"\"\"\n prompt = \"{statement} [y/n]\".format(statement=statement)\n answer = _ask(prompt, limited_to=[\"yes\", \"no\", \"y\", \"n\"])\n return answer and answer.startswith(\"y\")\n\n\ndef password(statement):\n \"\"\"Ask the user for a password.\n\n Args:\n statement (str): string to prompt the user with.\n\n Returns:\n str: password entered by the user.\n \"\"\"\n logger.info(\"{statement}: \".format(statement=statement))\n return getpass(\"\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/__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": 44, "span_ids": ["imports", "Remote", "_get"], "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": "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\nfrom dvc.remote.https import RemoteHTTPS\nfrom dvc.remote.oss import RemoteOSS\n\nfrom .config import RemoteConfig\n\n\nREMOTES = [\n RemoteAZURE,\n RemoteGS,\n RemoteHDFS,\n RemoteHTTP,\n RemoteHTTPS,\n RemoteS3,\n RemoteSSH,\n RemoteOSS,\n # NOTE: RemoteLOCAL is the default\n]\n\n\ndef _get(config):\n for remote in REMOTES:\n if remote.supported(config):\n return remote\n return RemoteLOCAL\n\n\ndef Remote(repo, **kwargs):\n name = kwargs.get(\"name\")\n if name:\n remote_config = RemoteConfig(repo.config)\n settings = remote_config.get_settings(name)\n else:\n settings = kwargs\n return _get(settings)(repo, settings)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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": 31, "span_ids": ["Callback.__init__", "imports", "Callback", "Callback.__call__"], "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": "from __future__ import absolute_import\nfrom __future__ import unicode_literals\n\nimport os\nimport re\nimport logging\n\nfrom dvc.scheme import Schemes\n\ntry:\n from azure.storage.blob import BlockBlobService\n from azure.common import AzureMissingResourceHttpError\nexcept ImportError:\n BlockBlobService = None\n\nfrom dvc.utils.compat import urlparse\nfrom dvc.progress import progress\nfrom dvc.config import Config\nfrom dvc.remote.base import RemoteBASE\nfrom dvc.path_info import CloudURLInfo\n\n\nlogger = logging.getLogger(__name__)\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/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": 67, "span_ids": ["DataCloudError", "RemoteMissingDepsError", "imports", "RemoteCmdError", "RemoteActionNotImplemented", "DataCloudError.__init__", "RemoteCmdError.__init__", "RemoteActionNotImplemented.__init__"], "tokens": 434}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import unicode_literals\n\nfrom dvc.utils.compat import str, basestring, urlparse, fspath_py35, makedirs\n\nimport os\nimport json\nimport logging\nimport tempfile\nimport itertools\nfrom contextlib import contextmanager\nfrom operator import itemgetter\nfrom multiprocessing import cpu_count\nfrom concurrent.futures import as_completed, ThreadPoolExecutor\n\nimport dvc.prompt as prompt\nfrom dvc.config import Config\nfrom dvc.exceptions import DvcException, ConfirmRemoveError\nfrom dvc.progress import progress, ProgressCallback\nfrom dvc.utils import LARGE_DIR_SIZE, tmp_fname, to_chunks, move, relpath\nfrom dvc.state import StateBase\nfrom dvc.path_info import PathInfo, URLInfo\n\n\nlogger = logging.getLogger(__name__)\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\nCHECKSUM_JOBS = max(1, min(4, cpu_count() // 2))\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/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": 37, "end_line": 60, "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/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": 32, "span_ids": ["imports", "ProgressBarCallback.__call__", "ProgressBarCallback.__init__", "ProgressBarCallback"], "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": "from __future__ import unicode_literals\n\nfrom dvc.scheme import Schemes\n\nfrom dvc.utils.compat import open, makedirs, fspath_py35\n\nimport os\nimport threading\nimport requests\nimport logging\n\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\nlogger = logging.getLogger(__name__)\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._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/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": 34, "span_ids": ["Callback.__init__", "imports", "Callback", "Callback.__call__"], "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": "from __future__ import unicode_literals\n\nimport os\nimport threading\nimport logging\nimport itertools\nfrom contextlib import contextmanager\n\ntry:\n import boto3\nexcept ImportError:\n boto3 = None\n\nfrom dvc.progress import progress\nfrom dvc.config import Config\nfrom dvc.remote.base import RemoteBASE\nfrom dvc.exceptions import DvcException, ETagMismatchError\nfrom dvc.path_info import CloudURLInfo\nfrom dvc.scheme import Schemes\n\nlogger = logging.getLogger(__name__)\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/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": 278, "end_line": 323, "span_ids": ["SSHConnection.cp", "SSHConnection.open_max_sftp_channels", "SSHConnection.md5"], "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": "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))\n\n @contextmanager\n def open_max_sftp_channels(self):\n try:\n channels = []\n while True:\n try:\n channels.append(self._ssh.open_sftp())\n except paramiko.ssh_exception.ChannelException:\n if not channels:\n raise\n break\n yield channels\n finally:\n for channel in channels:\n channel.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/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": 180, "end_line": 246, "span_ids": ["Repo.used_cache"], "tokens": 432}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 \"\"\"Get the stages related to the given target and collect\n the `info` of its outputs.\n\n This is useful to know what files from the cache are _in use_\n (namely, a file described as an output on a stage).\n\n The scope is, by default, the working directory, but you can use\n `all_branches` or `all_tags` to expand scope.\n\n Returns:\n A dictionary with Schemes (representing output's location) as keys,\n and a list with the outputs' `dumpd` as values.\n \"\"\"\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 and os.path.isdir(target):\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 used_cache = out.get_used_cache(\n remote=remote, force=force, jobs=jobs\n )\n\n cache[scheme].extend(\n dict(entry, branch=branch) for entry in used_cache\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": 248, "end_line": 348, "span_ids": ["Repo.graph"], "tokens": 723}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 \"\"\"Generate a graph by using the given stages on the given directory\n\n The nodes of the graph are the stage's path relative to the root.\n\n Edges are created when the output of one stage is used as a\n dependency in other stage.\n\n The direction of the edges goes from the stage to its dependency:\n\n For example, running the following:\n\n $ dvc run -o A \"echo A > A\"\n $ dvc run -d A -o B \"echo B > B\"\n $ dvc run -d B -o C \"echo C > C\"\n\n Will create the following graph:\n\n ancestors <--\n |\n C.dvc -> B.dvc -> A.dvc\n | |\n | --> descendants\n |\n ------- pipeline ------>\n |\n v\n (weakly connected components)\n\n Args:\n stages (list): used to build a graph, if None given, use the ones\n on the `from_directory`.\n\n from_directory (str): directory where to look at for stages, if\n None is given, use the current working directory\n\n Raises:\n OutputDuplicationError: two outputs with the same path\n StagePathAsOutputError: stage inside an output directory\n OverlappingOutputPathsError: output inside output directory\n CyclicGraphError: resulting graph has cycles\n \"\"\"\n import networkx as nx\n from 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 if out.path_info in outs:\n stages = [stage.relpath, outs[out.path_info].stage.relpath]\n raise OutputDuplicationError(str(out), stages)\n outs[out.path_info] = out\n\n for stage in stages:\n for out in stage.outs:\n for p in out.path_info.parents:\n if p in outs:\n raise OverlappingOutputPathsError(outs[p], out)\n\n for stage in stages:\n stage_path_info = PathInfo(stage.path)\n for p in chain([stage_path_info], stage_path_info.parents):\n if p in outs:\n raise StagePathAsOutputError(stage.wdir, stage.relpath)\n\n for stage in stages:\n node = 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 if dep.path_info is None:\n continue\n\n for out in outs:\n if (\n out == dep.path_info\n or dep.path_info.isin(out)\n or out.isin(dep.path_info)\n ):\n dep_stage = outs[out].stage\n dep_node = 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": 446, "end_line": 503, "span_ids": ["Repo.pipelines", "Repo.stages"], "tokens": 417}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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\n ignore_file_handler = DvcIgnoreFileHandler(self.tree)\n for root, dirs, files in self.tree.walk(\n from_directory, ignore_file_handler=ignore_file_handler\n ):\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 if out.scheme == \"local\":\n outs.append(out.fspath + 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/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": 34}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.utils import remove\n\n\ndef destroy(self):\n for stage in self.stages():\n stage.remove(remove_outs=False)\n\n remove(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": 56, "span_ids": ["imports", "_load_all_used_cache", "_do_gc", "_merge_cache_lists"], "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": "from __future__ import unicode_literals\n\nimport collections\nimport logging\n\n\nlogger = logging.getLogger(__name__)\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": 59, "end_line": 114, "span_ids": ["gc"], "tokens": 335}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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_remote(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/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": 38, "span_ids": ["imports", "_welcome_message"], "tokens": 275}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport colorama\nimport logging\n\nfrom dvc.repo import Repo\nfrom dvc.scm import SCM, NoSCM\nfrom dvc.config import Config\nfrom dvc.exceptions import InitError\nfrom dvc.utils import boxify, relpath, remove\n\nlogger = logging.getLogger(__name__)\n\n\ndef _welcome_message():\n logger.info(\n boxify(\n \"DVC has enabled anonymous aggregate usage analytics.\\n\"\n \"Read the analytics documentation (and how to opt-out) here:\\n\"\n \"{blue}https://dvc.org/doc/user-guide/analytics{nc}\".format(\n blue=colorama.Fore.BLUE, nc=colorama.Fore.RESET\n ),\n border_color=\"red\",\n )\n )\n\n msg = (\n \"{yellow}What's next?{nc}\\n\"\n \"{yellow}------------{nc}\\n\"\n \"- Check out the documentation: {blue}https://dvc.org/doc{nc}\\n\"\n \"- Get help and share ideas: {blue}https://dvc.org/chat{nc}\\n\"\n \"- Star us on GitHub: {blue}https://github.com/iterative/dvc{nc}\"\n ).format(\n yellow=colorama.Fore.YELLOW,\n blue=colorama.Fore.BLUE,\n nc=colorama.Fore.RESET,\n )\n\n logger.info(msg)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/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": 41, "end_line": 95, "span_ids": ["init"], "tokens": 352}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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.realpath(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=relpath(dvc_dir)\n )\n )\n\n remove(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": 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": "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": 58, "span_ids": ["_read_metric_json", "_get_values", "imports", "_read_metric_hxsv", "_do_read_metric_xsv", "_read_metric_xsv"], "tokens": 415}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import unicode_literals\n\nimport errno\nimport os\nimport csv\nimport json\nimport logging\n\nfrom jsonpath_ng.ext import parse\n\nfrom dvc.exceptions import OutputNotFoundError, BadMetricError, NoMetricsError\nfrom dvc.utils.compat import builtin_str, open, StringIO, csv_reader\n\nNO_METRICS_FILE_AT_REFERENCE_WARNING = (\n \"Metrics file '{}' does not exist at the reference '{}'.\"\n)\n\nlogger = logging.getLogger(__name__)\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": 155, "end_line": 200, "span_ids": ["_collect_metrics"], "tokens": 319}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _collect_metrics(repo, 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 repo.stages() for out in stage.outs]\n\n if path:\n try:\n outs = repo.find_outs_by_path(path, outs=outs, recursive=recursive)\n except OutputNotFoundError:\n logger.debug(\n \"DVC-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": 70, "span_ids": ["imports", "_expand_target_path", "move"], "tokens": 433}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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):\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 DVC-file.\n\n E.g.\n Having: (hello, hello.dvc)\n\n $ dvc move hello greetings\n\n Result: (greeting, greeting.dvc)\n\n It only works with outputs generated by `add` or `import`,\n also known as data sources.\n \"\"\"\n import dvc.output as Output\n from dvc.stage import Stage\n\n from_out = Output.loads_from(Stage(self), [from_path])[0]\n assert from_out.scheme == \"local\"\n\n to_path = _expand_target_path(from_path, to_path)\n\n outs = self.find_outs_by_path(from_out.fspath)\n assert len(outs) == 1\n out = outs[0]\n stage = out.stage\n\n if not stage.is_data_source:\n raise MoveNotDataSourceError(stage.relpath)\n\n stage_name = os.path.splitext(os.path.basename(stage.path))[0]\n from_name = os.path.basename(from_out.fspath)\n if stage_name == from_name:\n os.unlink(stage.path)\n\n stage.path = os.path.join(\n os.path.dirname(to_path),\n os.path.basename(to_path) + 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.use_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": 31, "span_ids": ["imports", "_reproduce_stage"], "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": "from __future__ import unicode_literals\n\nimport os\nimport logging\n\nfrom dvc.exceptions import ReproductionError\nfrom dvc.repo.scm_context import scm_context\nfrom dvc.utils import relpath\n\nlogger = logging.getLogger(__name__)\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": 34, "end_line": 98, "span_ids": ["reproduce"], "tokens": 364}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@scm_context\ndef reproduce(\n self,\n target=None,\n single_item=False,\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 downstream=False,\n recursive=False,\n):\n import networkx as nx\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 recursive and os.path.isdir(target):\n G = self.graph(from_directory=target)[1]\n dir_targets = [\n os.path.join(self.root_dir, n) for n in nx.dfs_postorder_nodes(G)\n ]\n targets.extend(dir_targets)\n elif pipeline or all_pipelines:\n if pipeline:\n stage = Stage.load(self, target)\n node = 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 single_item=single_item,\n force=force,\n dry=dry,\n interactive=interactive,\n ignore_build_cache=ignore_build_cache,\n no_commit=no_commit,\n downstream=downstream,\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": 101, "end_line": 137, "span_ids": ["_reproduce"], "tokens": 176}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _reproduce(\n self,\n target,\n single_item=False,\n force=False,\n dry=False,\n interactive=False,\n ignore_build_cache=False,\n no_commit=False,\n downstream=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 = relpath(stage.path, self.root_dir)\n\n if single_item:\n ret = _reproduce_stage(\n stages, node, force, dry, interactive, no_commit\n )\n else:\n ret = _reproduce_stages(\n G,\n stages,\n node,\n force,\n dry,\n interactive,\n ignore_build_cache,\n no_commit,\n downstream,\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": 140, "end_line": 219, "span_ids": ["_reproduce_stages"], "tokens": 625}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _reproduce_stages(\n G,\n stages,\n node,\n force,\n dry,\n interactive,\n ignore_build_cache,\n no_commit,\n downstream,\n):\n r\"\"\"Derive the evaluation of the given node for the given graph.\n\n When you _reproduce a stage_, you want to _evaluate the descendants_\n to know if it make sense to _recompute_ it. A post-ordered search\n will give us an order list of the nodes we want.\n\n For example, let's say that we have the following pipeline:\n\n E\n / \\\n D F\n / \\ \\\n B C G\n \\ /\n A\n\n The derived evaluation of D would be: [A, B, C, D]\n\n In case that `downstream` option is specifed, the desired effect\n is to derive the evaluation starting from the given stage up to the\n ancestors. However, the `networkx.ancestors` returns a set, without\n any guarantee of any order, so we are going to reverse the graph and\n use a pre-ordered search using the given stage as a starting point.\n\n E A\n / \\ / \\\n D F B C G\n / \\ \\ --- reverse --> \\ / /\n B C G D F\n \\ / \\ /\n A E\n\n The derived evaluation of _downstream_ B would be: [B, D, E]\n \"\"\"\n\n import networkx as nx\n\n if downstream:\n # NOTE (py3 only):\n # Python's `deepcopy` defaults to pickle/unpickle the object.\n # Stages are complex objects (with references to `repo`, `outs`,\n # and `deps`) that cause struggles when you try to serialize them.\n # We need to create a copy of the graph itself, and then reverse it,\n # instead of using graph.reverse() directly because it calls\n # `deepcopy` underneath -- unless copy=False is specified.\n pipeline = nx.dfs_preorder_nodes(G.copy().reverse(copy=False), node)\n else:\n pipeline = nx.dfs_postorder_nodes(G, node)\n\n result = []\n for n in pipeline:\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": 25, "span_ids": ["imports", "_local_status"], "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": "from __future__ import unicode_literals\n\nimport logging\n\n\nlogger = logging.getLogger(__name__)\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": 90, "span_ids": ["_cloud_status"], "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": "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 \"\"\"Returns a dictionary with the files that are new or deleted.\n\n - new: Remote doesn't have the file\n - deleted: File is no longer in the local cache\n\n Example:\n Given the following commands:\n\n $ echo \"foo\" > foo\n $ echo \"bar\" > bar\n $ dvc add foo bar\n $ dvc status -c\n\n It will return something like:\n\n { \"foo\": \"new\", \"bar\": \"new\" }\n\n Now, after pushing and removing \"bar\" from the local cache:\n\n $ dvc push\n $ rm .dvc/cache/c1/57a79031e1c40f85931829bc5fc552\n\n The result would be:\n\n { \"bar\": \"deleted\" }\n \"\"\"\n import dvc.remote.base as cloud\n\n used = self.used_cache(\n 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 in [cloud.STATUS_OK, cloud.STATUS_MISSING]:\n continue\n\n prefix_map = {cloud.STATUS_DELETED: \"deleted\", cloud.STATUS_NEW: \"new\"}\n\n ret[name] = prefix_map[status]\n\n return ret", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/status.py_status_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/status.py_status_", "embedding": null, "metadata": {"file_path": "dvc/repo/status.py", "file_name": "status.py", "file_type": "text/x-python", "category": "implementation", "start_line": 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_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": 216, "end_line": 239, "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": 251, "end_line": 305, "span_ids": ["Stage.remove_outs", "Stage._changed_md5", "Stage.unprotect_outs", "Stage.remove", "Stage.changed", "Stage._changed_outs"], "tokens": 359}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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 logger.warning(\"Stage '{}' changed.\".format(self.relpath))\n else:\n logger.info(\"Stage '{}' didn't change.\".format(self.relpath))\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, remove_outs=True):\n if remove_outs:\n self.remove_outs(ignore_remove=True, force=force)\n else:\n self.unprotect_outs()\n os.unlink(self.path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.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": 315, "end_line": 335, "span_ids": ["Stage.reproduce"], "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 Stage(object):\n\n def reproduce(\n self, force=False, dry=False, interactive=False, no_commit=False\n ):\n if not force and not self.changed():\n return None\n\n msg = (\n \"Going to reproduce '{stage}'. \"\n \"Are you sure you want to continue?\".format(stage=self.relpath)\n )\n\n if interactive and not prompt.confirm(msg):\n raise DvcException(\"reproduction aborted by the user\")\n\n 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.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": 415, "end_line": 531, "span_ids": ["Stage.create"], "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": "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 erepo=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 \"DVC-file name '{fname}' may not contain subdirectories\"\n \" if '-c|--cwd' (deprecated) is specified. Use '-w|--wdir'\"\n \" along with '-f' to specify DVC-file path with 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, erepo=erepo)\n\n stage._check_circular_dependency()\n stage._check_duplicated_arguments()\n\n if not fname:\n fname = Stage._stage_fname(stage.outs, add=add)\n stage._check_dvc_filename(fname)\n\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 logger.warning(\n \"--remove-outs is deprecated.\"\n \" It is now the default behavior,\"\n \" so there's no need to use this option anymore.\"\n )\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 os.path.exists(path) and any(out.persist for out in stage.outs):\n logger.warning(\"Build cache is ignored when persisting outputs.\")\n ignore_build_cache = True\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": 579, "end_line": 618, "span_ids": ["Stage.load"], "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 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-file\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 with repo.tree.open(fname) as fd:\n d = load_stage_fd(fd, fname)\n # Making a deepcopy since the original structure\n # looses keys in deps and outs load\n state = copy.deepcopy(d)\n\n Stage.validate(d, fname=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 state=state,\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": 674, "end_line": 710, "span_ids": ["Stage.save", "Stage.check_can_commit", "Stage._changed_entries"], "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 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 return [\n str(entry)\n for entry in entries\n if entry.checksum and entry.changed_checksum()\n ]\n\n def check_can_commit(self, force):\n changed_deps = self._changed_entries(self.deps)\n changed_outs = self._changed_entries(self.outs)\n\n if changed_deps or changed_outs or self.changed_md5():\n msg = (\n \"dependencies {}\".format(changed_deps) if changed_deps else \"\"\n )\n msg += \" and \" if (changed_deps and changed_outs) else \"\"\n msg += \"outputs {}\".format(changed_outs) if changed_outs else \"\"\n msg += \"md5\" if not (changed_deps or changed_outs) else \"\"\n msg += \" of '{}' changed. 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.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": 822, "end_line": 868, "span_ids": ["Stage.run"], "tokens": 302}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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], out=self.outs[0]\n )\n )\n if not dry:\n if not force and self._already_cached():\n self.outs[0].checkout()\n else:\n self.deps[0].download(self.outs[0], resume=resume)\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": 825, "end_line": 880, "span_ids": ["Stage.status", "Stage.check_missing_outputs", "Stage.checkout", "Stage.get_all_files_number", "Stage._status", "Stage._already_cached"], "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 Stage(object):\n\n def check_missing_outputs(self):\n paths = [str(out) for out in self.outs if not out.exists]\n if paths:\n raise MissingDataSource(paths)\n\n def 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_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": 171, "end_line": 215, "span_ids": ["State._prepare_db"], "tokens": 356}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State(StateBase):\n\n def _prepare_db(self, empty=False):\n from dvc import __version__\n\n if not empty:\n cmd = \"PRAGMA user_version;\"\n self._execute(cmd)\n ret = self._fetchall()\n assert len(ret) == 1\n assert len(ret[0]) == 1\n assert isinstance(ret[0][0], int)\n version = ret[0][0]\n\n if version > self.VERSION:\n raise StateVersionTooNewError(\n __version__, self.VERSION, version\n )\n elif version < self.VERSION:\n 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": 217, "end_line": 249, "span_ids": ["State.load", "State._vacuum"], "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 State(StateBase):\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": 230, "end_line": 277, "span_ids": ["State.dump"], "tokens": 355}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State(StateBase):\n\n def dump(self):\n \"\"\"Saves state database.\"\"\"\n assert self.database is not None\n\n cmd = \"SELECT count from {} WHERE rowid=?\".format(\n self.STATE_INFO_TABLE\n )\n self._execute(cmd, (self.STATE_INFO_ROW,))\n ret = self._fetchall()\n assert len(ret) == 1\n assert len(ret[0]) == 1\n count = self._from_sqlite(ret[0][0]) + self.inserts\n\n if count > self.row_limit:\n msg = \"cleaning up state, this might take a while.\"\n logger.warning(msg)\n\n delete = count - self.row_limit\n delete += int(self.row_limit * (self.row_cleanup_quota / 100.0))\n cmd = (\n \"DELETE FROM {} WHERE timestamp IN (\"\n \"SELECT timestamp FROM {} ORDER BY timestamp ASC LIMIT {});\"\n )\n self._execute(\n cmd.format(self.STATE_TABLE, self.STATE_TABLE, delete)\n )\n\n self._vacuum()\n\n cmd = \"SELECT COUNT(*) FROM {}\"\n\n self._execute(cmd.format(self.STATE_TABLE))\n ret = self._fetchall()\n assert len(ret) == 1\n assert len(ret[0]) == 1\n count = ret[0][0]\n\n cmd = \"UPDATE {} SET count = ? WHERE rowid = ?\".format(\n self.STATE_INFO_TABLE\n )\n self._execute(cmd, (self._to_sqlite(count), self.STATE_INFO_ROW))\n\n self.database.commit()\n self.cursor.close()\n self.database.close()\n self.database = None\n self.cursor = None\n self.inserts = 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_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": 38, "span_ids": ["imports", "System.hardlink", "System.is_unix", "System"], "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": "from __future__ import unicode_literals\n\nfrom dvc.utils.compat import str, open, fspath\n\nimport os\nimport errno\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 source, link_name = fspath(source), fspath(link_name)\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": 40, "end_line": 64, "span_ids": ["System.symlink"], "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 System(object):\n\n @staticmethod\n def symlink(source, link_name):\n import ctypes\n from dvc.exceptions import DvcException\n\n source, link_name = fspath(source), fspath(link_name)\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": 62, "end_line": 92, "span_ids": ["System._reflink_darwin"], "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 System(object):\n\n @staticmethod\n def _reflink_darwin(src, dst):\n import ctypes\n import dvc.logger as logger\n\n LIBC = \"libc.dylib\"\n LIBC_FALLBACK = \"/usr/lib/libSystem.dylib\"\n try:\n clib = ctypes.CDLL(LIBC)\n except OSError as exc:\n logger.debug(\n \"unable to access '{}' (errno '{}'). \"\n \"Falling back to '{}'.\".format(LIBC, exc.errno, LIBC_FALLBACK)\n )\n if exc.errno != errno.ENOENT:\n raise\n # NOTE: trying to bypass System Integrity Protection (SIP)\n clib = ctypes.CDLL(LIBC_FALLBACK)\n\n if not hasattr(clib, \"clonefile\"):\n return -1\n\n clonefile = clib.clonefile\n clonefile.argtypes = [ctypes.c_char_p, ctypes.c_char_p, ctypes.c_int]\n clonefile.restype = ctypes.c_int\n\n return clonefile(\n ctypes.c_char_p(src.encode(\"utf-8\")),\n ctypes.c_char_p(dst.encode(\"utf-8\")),\n ctypes.c_int(0),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System._reflink_windows_System._reflink_linux.return.ret": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System._reflink_windows_System._reflink_linux.return.ret", "embedding": null, "metadata": {"file_path": "dvc/system.py", "file_name": "system.py", "file_type": "text/x-python", "category": "implementation", "start_line": 94, "end_line": 113, "span_ids": ["System._reflink_linux", "System._reflink_windows"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class System(object):\n\n @staticmethod\n def _reflink_windows(src, dst):\n return -1\n\n @staticmethod\n def _reflink_linux(src, dst):\n import os\n import fcntl\n\n FICLONE = 0x40049409\n\n try:\n ret = 255\n with open(src, \"r\") as s, open(dst, \"w+\") as d:\n ret = fcntl.ioctl(d.fileno(), FICLONE, s.fileno())\n finally:\n if ret != 0:\n os.unlink(dst)\n\n return ret", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System.reflink_System.reflink.if_ret_0_.raise_DvcException_refli": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System.reflink_System.reflink.if_ret_0_.raise_DvcException_refli", "embedding": null, "metadata": {"file_path": "dvc/system.py", "file_name": "system.py", "file_type": "text/x-python", "category": "implementation", "start_line": 119, "end_line": 140, "span_ids": ["System.reflink"], "tokens": 156}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class System(object):\n\n @staticmethod\n def reflink(source, link_name):\n import platform\n from dvc.exceptions import DvcException\n\n source, link_name = fspath(source), fspath(link_name)\n\n system = platform.system()\n try:\n if system == \"Windows\":\n ret = System._reflink_windows(source, link_name)\n elif system == \"Darwin\":\n ret = System._reflink_darwin(source, link_name)\n elif system == \"Linux\":\n ret = System._reflink_linux(source, link_name)\n else:\n ret = -1\n except IOError:\n ret = -1\n\n if ret != 0:\n raise DvcException(\"reflink is not supported\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System.inode_System.inode.return.inode": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/system.py_System.inode_System.inode.return.inode", "embedding": null, "metadata": {"file_path": "dvc/system.py", "file_name": "system.py", "file_type": "text/x-python", "category": "implementation", "start_line": 213, "end_line": 239, "span_ids": ["System.inode"], "tokens": 182}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class System(object):\n\n @staticmethod\n def inode(path):\n path = fspath(path)\n\n if System.is_unix():\n import ctypes\n\n inode = os.lstat(path).st_ino\n # NOTE: See https://bugs.python.org/issue29619 and\n # https://stackoverflow.com/questions/34643289/\n # pythons-os-stat-is-returning-wrong-inode-value\n inode = ctypes.c_ulong(inode).value\n else:\n # getdirinfo from ntfsutils works on both files and dirs\n info = System._getdirinfo(path)\n inode = abs(\n hash(\n (\n info.dwVolumeSerialNumber,\n info.nFileIndexHigh,\n info.nFileIndexLow,\n )\n )\n )\n assert inode >= 0\n assert inode < 2 ** 64\n return inode", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/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": 233, "end_line": 249, "span_ids": ["System._wait_for_input_windows"], "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 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 from win32event import WAIT_OBJECT_0, WAIT_TIMEOUT\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": 259, "end_line": 301, "span_ids": ["System.wait_for_input", "System._wait_for_input_posix", "System.is_hardlink", "System.is_symlink"], "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 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 path = fspath(path)\n\n if System.is_unix():\n return os.path.islink(path)\n\n # https://docs.microsoft.com/en-us/windows/desktop/fileio/\n # file-attribute-constants\n from winnt import FILE_ATTRIBUTE_REPARSE_POINT\n\n if os.path.lexists(path):\n info = System._getdirinfo(path)\n return info.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT\n return False\n\n @staticmethod\n def is_hardlink(path):\n path = fspath(path)\n\n if System.is_unix():\n return os.stat(path).st_nlink > 1\n\n info = System._getdirinfo(path)\n return info.nNumberOfLinks > 1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_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": 50, "span_ids": ["Updater._with_lock", "Updater.__init__", "imports", "Updater", "Updater.check", "Updater._is_outdated_file"], "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": "from __future__ import unicode_literals\n\nimport sys\nimport os\nimport time\nimport logging\nimport requests\nimport colorama\nfrom pkg_resources import parse_version\n\nfrom dvc import __version__\nfrom dvc.lock import Lock, LockError\nfrom dvc.utils import is_binary, boxify\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass Updater(object): # pragma: no cover\n URL = \"https://updater.dvc.org\"\n UPDATER_FILE = \"updater\"\n TIMEOUT = 24 * 60 * 60 # every day\n TIMEOUT_GET = 10\n\n def __init__(self, dvc_dir):\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 = parse_version(__version__).base_version\n\n def _is_outdated_file(self):\n ctime = os.path.getmtime(self.updater_file)\n outdated = time.time() - ctime >= self.TIMEOUT\n if outdated:\n logger.debug(\"'{}' is outdated(\".format(self.updater_file))\n return outdated\n\n def _with_lock(self, func, action):\n try:\n with self.lock:\n func()\n except LockError:\n msg = \"Failed to acquire '{}' before {} updates\"\n logger.debug(msg.format(self.lock.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._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/scripts/hooks/hook-google.cloud.storage.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/hooks/hook-google.cloud.storage.py__", "embedding": null, "metadata": {"file_path": "scripts/hooks/hook-google.cloud.storage.py", "file_name": "hook-google.cloud.storage.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 10, "span_ids": ["imports"], "tokens": 74}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from PyInstaller.utils.hooks import copy_metadata\n\ndatas = copy_metadata(\"google-cloud-storage\")\n\n# NOTE: including \"requests\" metadata because of google-resumable-media\n# bug. See [1] for more info.\n#\n# [1] https://github.com/googleapis/google-resumable-media-python/issues/59\ndatas += copy_metadata(\"requests\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/hooks/hook-google_compute_engine.logger.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/hooks/hook-google_compute_engine.logger.py__", "embedding": null, "metadata": {"file_path": "scripts/hooks/hook-google_compute_engine.logger.py", "file_name": "hook-google_compute_engine.logger.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 5, "span_ids": ["imports"], "tokens": 28}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from PyInstaller.utils.hooks import copy_metadata\n\ndatas = copy_metadata(\"google-compute-engine\")\nhiddenimports = [\"google_cloud_engine\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/innosetup/config_gen.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/innosetup/config_gen.py__", "embedding": null, "metadata": {"file_path": "scripts/innosetup/config_gen.py", "file_name": "config_gen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 11, "span_ids": ["docstring"], "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": "# 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/tests/__main__.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/__main__.py_os_", "embedding": null, "metadata": {"file_path": "tests/__main__.py", "file_name": "__main__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 21, "span_ids": ["imports"], "tokens": 141}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import 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)\n\nparams = \" \".join(sys.argv[1:])\n\ncmd = (\n \"py.test -v -n=4 --timeout=600 --timeout_method=thread --log-level=debug\"\n \" --cov=dvc {params} --durations=0\".format(params=params)\n)\ncheck_call(cmd, shell=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/utils/httpd.py_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/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": 657, "end_line": 686, "span_ids": ["Stage._compute_md5"], "tokens": 260}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Stage(object):\n\n def _compute_md5(self):\n from dvc.output.base import OutputBase\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 DVC-file w/o\n # wdir has the same md5 as a file with the default value specified.\n # It's important for backward compatibility with pipelines that\n # didn't have WDIR in their DVC-files.\n if d.get(self.PARAM_WDIR) == \".\":\n del d[self.PARAM_WDIR]\n\n # NOTE: excluding parameters that don't affect the state of the\n # pipeline. Not excluding `OutputLOCAL.PARAM_CACHE`, because if\n # it has changed, we might not have that output in our cache.\n m = dict_md5(\n d,\n exclude=[\n self.PARAM_LOCKED,\n OutputBase.PARAM_METRIC,\n OutputBase.PARAM_TAGS,\n OutputBase.PARAM_PERSIST,\n ],\n )\n logger.debug(\"Computed stage '{}' md5: '{}'\".format(self.relpath, m))\n return m", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/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": 33, "span_ids": ["dos2unix", "docstring"], "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": "\"\"\"Helpers for other modules.\"\"\"\n\nfrom __future__ import unicode_literals\n\nfrom dvc.utils.compat import str, builtin_str, open, cast_bytes_py2, StringIO\nfrom dvc.utils.compat import fspath\n\nimport os\nimport sys\nimport stat\nimport math\nimport json\nimport errno\nimport shutil\nimport hashlib\nimport nanotime\nimport time\nimport colorama\nimport re\nimport logging\n\nfrom ruamel.yaml import YAML\n\n\nlogger = logging.getLogger(__name__)\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": 43, "end_line": 82, "span_ids": ["file_md5"], "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 file_md5(fname):\n \"\"\" get the (md5 hexdigest, md5 digest) of a file \"\"\"\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(relpath(fname)))\n name = 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": 46, "span_ids": ["get_mtime_and_size", "imports", "get_inode"], "tokens": 273}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import unicode_literals\n\nimport os\nimport errno\nimport nanotime\nimport logging\n\nfrom dvc.exceptions import DvcException\nfrom dvc.system import System\nfrom dvc.utils import dvc_walk\nfrom dvc.utils.compat import str\n\n\nlogger = logging.getLogger(__name__)\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 stat = os.stat(path)\n size = stat.st_size\n mtime = stat.st_mtime\n\n if os.path.isdir(path):\n for root, dirs, files in dvc_walk(path):\n for name in dirs + files:\n entry = os.path.join(root, name)\n try:\n stat = os.stat(entry)\n except OSError as exc:\n # NOTE: broken symlink case.\n if exc.errno != errno.ENOENT:\n raise\n continue\n size += stat.st_size\n 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": 48, "end_line": 86, "span_ids": ["get_parent_dirs_up_to", "BasePathNotInCheckedPathException.__init__", "BasePathNotInCheckedPathException", "contains_symlink_up_to"], "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 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)\n\n\ndef get_parent_dirs_up_to(wdir, root_dir):\n\n assert os.path.isabs(wdir)\n assert os.path.isabs(root_dir)\n\n wdir = os.path.normpath(wdir)\n root_dir = os.path.normpath(root_dir)\n if root_dir not in wdir:\n return []\n\n dirs = []\n dirs.append(wdir)\n while wdir != root_dir:\n wdir = os.path.dirname(wdir)\n dirs.append(wdir)\n\n return dirs", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": 30, "span_ids": ["imports", "CmdAdd", "CmdAdd.run"], "tokens": 152}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import unicode_literals\n\nimport argparse\nimport logging\n\nfrom dvc.exceptions import DvcException\nfrom dvc.command.base import CmdBase, append_doc_link\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdAdd(CmdBase):\n def run(self):\n try:\n if len(self.args.targets) > 1 and self.args.file:\n raise 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.exception(\"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": 33, "end_line": 63, "span_ids": ["add_parser"], "tokens": 211}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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\", \"--file\", help=\"Specify name of the DVC-file it generates.\"\n )\n add_parser.add_argument(\n \"targets\", nargs=\"+\", help=\"Input files/directories to add.\"\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/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": 136, "end_line": 150, "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/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": 35, "span_ids": ["imports", "fix_subparsers", "append_doc_link"], "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": "from __future__ import unicode_literals\n\nimport colorama\nimport logging\n\n\nlogger = logging.getLogger(__name__)\n\n\ndef fix_subparsers(subparsers):\n \"\"\"Workaround for bug in Python 3. See more info at:\n https://bugs.python.org/issue16308\n https://github.com/iterative/dvc/issues/769\n\n Args:\n subparsers: subparsers to fix.\n \"\"\"\n 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": 122, "end_line": 244, "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 \"-f\",\n \"--force\",\n action=\"store_true\",\n default=False,\n help=\"Do not prompt when removing working directory files.\",\n )\n pull_parser.add_argument(\n \"-d\",\n \"--with-deps\",\n action=\"store_true\",\n default=False,\n help=\"Fetch cache for all dependencies of the specified target.\",\n )\n pull_parser.add_argument(\n \"-R\",\n \"--recursive\",\n action=\"store_true\",\n default=False,\n help=\"Pull cache for subdirectories of the specified directory.\",\n )\n pull_parser.set_defaults(func=CmdDataPull)\n\n # Push\n PUSH_HELP = \"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_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": 36, "span_ids": ["imports", "CmdLockBase._run", "CmdUnlock.run", "CmdUnlock", "CmdLockBase", "CmdLock", "CmdLock.run"], "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": "from __future__ import unicode_literals\n\nimport argparse\nimport logging\n\nfrom dvc.exceptions import DvcException\nfrom dvc.command.base import CmdBase, append_doc_link\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdLockBase(CmdBase):\n def _run(self, unlock):\n for target in self.args.targets:\n try:\n self.repo.lock_stage(target, unlock=unlock)\n except DvcException:\n logger.exception(\n \"failed to {}lock '{}'\".format(\n \"un\" if unlock else \"\", target\n )\n )\n\n return 1\n return 0\n\n\nclass CmdLock(CmdLockBase):\n def run(self):\n return self._run(False)\n\n\nclass CmdUnlock(CmdLockBase):\n def run(self):\n return self._run(True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/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": 33, "span_ids": ["imports", "show_metrics"], "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": "from __future__ import unicode_literals\n\nimport argparse\nimport logging\n\nfrom dvc.exceptions import DvcException\nfrom dvc.command.base import CmdBase, fix_subparsers, append_doc_link\n\n\nlogger = logging.getLogger(__name__)\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": 36, "end_line": 55, "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.exception(\"failed to show metrics\")\n return 1\n\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/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": 39, "end_line": 82, "span_ids": ["CmdPipelineShow.__build_graph"], "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 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 = 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": 118, "end_line": 178, "span_ids": ["CmdPipelineShow.__write_dot", "CmdPipelineList", "CmdPipelineShow.run", "CmdPipelineList.run"], "tokens": 386}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CmdPipelineShow(CmdBase):\n\n def __write_dot(self, target, commands, outs):\n from dvc.utils.compat import StringIO\n import networkx\n from networkx.drawing.nx_pydot import write_dot\n\n _, edges, _ = self.__build_graph(target, commands, outs)\n edges = [edge[::-1] for edge in edges]\n\n simple_g = networkx.DiGraph()\n simple_g.add_edges_from(edges)\n\n dot_file = StringIO()\n write_dot(simple_g, dot_file)\n logger.info(dot_file.getvalue())\n\n def run(self):\n if not self.args.targets:\n self.args.targets = self.default_targets\n\n for target in self.args.targets:\n try:\n if self.args.ascii:\n self._show_ascii(\n target, self.args.commands, self.args.outs\n )\n elif self.args.dot:\n self.__write_dot(\n target, self.args.commands, self.args.outs\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(\n target,\n self.args.commands,\n self.args.outs,\n self.args.locked,\n )\n except DvcException:\n msg = \"failed to show pipeline for '{}'\".format(target)\n logger.exception(msg)\n return 1\n return 0\n\n\nclass CmdPipelineList(CmdBase):\n def run(self):\n 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/tag.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/tag.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/tag.py", "file_name": "tag.py", "file_type": "text/x-python", "category": "implementation", "start_line": 60, "end_line": 155, "span_ids": ["add_parser"], "tokens": 665}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n TAG_HELP = \"A set of commands to manage DVC tags.\"\n tag_parser = subparsers.add_parser(\n \"tag\",\n parents=[parent_parser],\n description=append_doc_link(TAG_HELP, \"tag\"),\n add_help=False,\n )\n\n tag_subparsers = tag_parser.add_subparsers(\n dest=\"cmd\",\n help=\"Use DVC tag CMD --help to display command-specific help.\",\n )\n\n fix_subparsers(tag_subparsers)\n\n TAG_ADD_HELP = \"Add DVC tag.\"\n tag_add_parser = tag_subparsers.add_parser(\n \"add\",\n parents=[parent_parser],\n description=append_doc_link(TAG_ADD_HELP, \"tag-add\"),\n help=TAG_ADD_HELP,\n )\n tag_add_parser.add_argument(\"tag\", help=\"Dvc tag.\")\n tag_add_parser.add_argument(\n \"targets\", nargs=\"*\", default=[None], help=\"DVC-files.\"\n )\n tag_add_parser.add_argument(\n \"-d\",\n \"--with-deps\",\n action=\"store_true\",\n default=False,\n help=\"Add tag for all dependencies of the specified DVC-file.\",\n )\n tag_add_parser.add_argument(\n \"-R\",\n \"--recursive\",\n action=\"store_true\",\n default=False,\n help=\"Add tag for subdirectories of the specified directory.\",\n )\n tag_add_parser.set_defaults(func=CmdTagAdd)\n\n TAG_REMOVE_HELP = \"Remove DVC tag.\"\n tag_remove_parser = tag_subparsers.add_parser(\n \"remove\",\n parents=[parent_parser],\n description=append_doc_link(TAG_REMOVE_HELP, \"tag-remove\"),\n help=TAG_REMOVE_HELP,\n )\n tag_remove_parser.add_argument(\"tag\", help=\"Dvc tag.\")\n tag_remove_parser.add_argument(\n \"targets\", nargs=\"*\", default=[None], help=\"DVC-files.\"\n )\n tag_remove_parser.add_argument(\n \"-d\",\n \"--with-deps\",\n action=\"store_true\",\n default=False,\n help=\"Remove tag for all dependencies of the specified DVC-file.\",\n )\n tag_remove_parser.add_argument(\n \"-R\",\n \"--recursive\",\n action=\"store_true\",\n default=False,\n help=\"Remove tag for subdirectories of the specified directory.\",\n )\n tag_remove_parser.set_defaults(func=CmdTagRemove)\n\n TAG_LIST_HELP = \"List DVC tags.\"\n tag_list_parser = tag_subparsers.add_parser(\n \"list\",\n parents=[parent_parser],\n description=append_doc_link(TAG_LIST_HELP, \"tag-list\"),\n help=TAG_LIST_HELP,\n )\n tag_list_parser.add_argument(\n \"targets\", nargs=\"*\", default=[None], help=\"DVC-files.\"\n )\n tag_list_parser.add_argument(\n \"-d\",\n \"--with-deps\",\n action=\"store_true\",\n default=False,\n help=\"List tags for all dependencies of the specified DVC-file.\",\n )\n tag_list_parser.add_argument(\n \"-R\",\n \"--recursive\",\n action=\"store_true\",\n default=False,\n help=\"List tags for subdirectories of the specified directory.\",\n )\n tag_list_parser.set_defaults(func=CmdTagList)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/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": 143, "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": 599}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 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, cause=None):\n path = relpath(path)\n super(StageFileCorruptedError, self).__init__(\n \"unable to read DVC-file: {} \"\n \"YAML file structure is corrupted\".format(path),\n cause=cause,\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/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": 436}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import unicode_literals\n\nimport schema\n\nfrom dvc.scheme import Schemes\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 Schemes.HDFS: OutputHDFS,\n Schemes.S3: OutputS3,\n Schemes.GS: OutputGS,\n Schemes.SSH: OutputSSH,\n Schemes.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": 97, "span_ids": ["_get"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _get(stage, p, info, cache, metric, persist=False, tags=None):\n parsed = urlparse(p)\n\n if parsed.scheme == \"remote\":\n remote = Remote(stage.repo, name=parsed.netloc)\n return OUTS_MAP[remote.scheme](\n stage,\n p,\n info,\n cache=cache,\n remote=remote,\n metric=metric,\n persist=persist,\n tags=tags,\n )\n\n for o in OUTS:\n if o.supported(p):\n return o(\n stage,\n p,\n info,\n cache=cache,\n remote=None,\n metric=metric,\n persist=persist,\n tags=tags,\n )\n return OutputLOCAL(\n stage,\n p,\n info,\n cache=cache,\n remote=None,\n metric=metric,\n persist=persist,\n tags=tags,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/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": 30, "span_ids": ["imports", "get_progress_callback", "_cleanup_unused_links", "get_all_files_numbers"], "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 logging\n\nfrom dvc.exceptions import CheckoutErrorSuggestGit\nfrom dvc.progress import ProgressCallback\n\n\nlogger = logging.getLogger(__name__)\n\n\ndef _cleanup_unused_links(self, all_stages):\n used = [\n out.fspath\n for stage in all_stages\n for out in stage.outs\n if out.scheme == \"local\"\n ]\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": 33, "end_line": 59, "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": 137, "end_line": 152, "span_ids": ["_read_metric"], "tokens": 125}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _read_metric(fd, typ=None, xpath=None, fname=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.exception(\n \"unable to read metric in '{}' in branch '{}'\".format(\n fname, branch\n )\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_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": 259, "end_line": 282, "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 repo,\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 repo.brancher(all_branches=all_branches, all_tags=all_tags):\n entries = _collect_metrics(repo, path, recursive, typ, xpath, branch)\n metrics = _read_metrics(repo, 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/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": 72}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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:\n repo.scm.cleanup_ignores()\n raise\n\n return run", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tag/__init__.py_Tag_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tag/__init__.py_Tag_", "embedding": null, "metadata": {"file_path": "dvc/repo/tag/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 19, "span_ids": ["Tag.__init__", "Tag.remove", "Tag.list", "Tag.add", "Tag"], "tokens": 118}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Tag(object):\n def __init__(self, repo):\n self.repo = repo\n\n def add(self, *args, **kwargs):\n from dvc.repo.tag.add import add\n\n return add(self.repo, *args, **kwargs)\n\n def list(self, *args, **kwargs):\n from dvc.repo.tag.list import list\n\n return list(self.repo, *args, **kwargs)\n\n def remove(self, *args, **kwargs):\n from dvc.repo.tag.remove import remove\n\n return remove(self.repo, *args, **kwargs)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/tag/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": 19, "span_ids": ["add", "imports"], "tokens": 112}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\nfrom copy import copy\n\nlogger = logging.getLogger(__name__)\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] = copy(out.info)\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": 19, "span_ids": ["imports", "remove"], "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": "import logging\n\n\nlogger = logging.getLogger(__name__)\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": 28, "span_ids": ["FileNotInCommitError", "FileNotInRepoError", "docstring", "FileNotInTargetSubdirError", "SCMError"], "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": "\"\"\"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 FileNotInCommitError(DvcException):\n \"\"\"Thrown when trying to find a file/directory that is not\n in the specified commit in the 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_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": 79, "end_line": 105, "span_ids": ["Git._get_gitignore"], "tokens": 215}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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 = 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/tree.py_os_BaseTree.walk._Directory_tree_generat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/tree.py_os_BaseTree.walk._Directory_tree_generat", "embedding": null, "metadata": {"file_path": "dvc/scm/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 32, "span_ids": ["BaseTree.open", "imports", "BaseTree.tree_root", "BaseTree.exists", "BaseTree.isdir", "BaseTree", "BaseTree.isfile", "BaseTree.walk"], "tokens": 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 os\n\nfrom dvc.utils import dvc_walk\nfrom dvc.utils.compat import open\n\n\nclass BaseTree(object):\n \"\"\"Abstract class to represent access to files\"\"\"\n\n @property\n def tree_root(self):\n pass\n\n def open(self, path, binary=False):\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, ignore_file_handler=None):\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": 35, "end_line": 61, "span_ids": ["WorkingTree.__init__", "WorkingTree.tree_root", "WorkingTree.isdir", "WorkingTree", "WorkingTree.exists", "WorkingTree.isfile", "WorkingTree.open"], "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 WorkingTree(BaseTree):\n \"\"\"Proxies the repo file access methods to working tree files\"\"\"\n\n def __init__(self, repo_root=os.getcwd()):\n self.repo_root = repo_root\n\n @property\n def tree_root(self):\n return self.repo_root\n\n def open(self, path, binary=False):\n \"\"\"Open file and return a stream.\"\"\"\n if binary:\n return open(path, \"rb\")\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": 63, "end_line": 81, "span_ids": ["WorkingTree.walk"], "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 WorkingTree(BaseTree):\n\n def walk(self, top, topdown=True, ignore_file_handler=None):\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 dvc_walk(\n os.path.abspath(top),\n topdown=topdown,\n onerror=onerror,\n ignore_file_handler=ignore_file_handler,\n ):\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": 558, "end_line": 584, "span_ids": ["Stage._get_path_tag", "Stage._check_isfile", "Stage._check_file_exists", "Stage._check_dvc_filename"], "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 Stage(object):\n\n @staticmethod\n def _check_dvc_filename(fname):\n if not Stage.is_valid_filename(fname):\n raise StageFileBadNameError(\n \"bad DVC-file name '{}'. DVC-files should be named\"\n \" 'Dvcfile' or have a '.dvc' suffix (e.g. '{}.dvc').\".format(\n relpath(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": 620, "end_line": 648, "span_ids": ["Stage.dump", "Stage.dumpd"], "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 Stage(object):\n\n def dumpd(self):\n rel_wdir = relpath(self.wdir, os.path.dirname(self.path))\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: pathlib.PurePath(rel_wdir).as_posix(),\n Stage.PARAM_LOCKED: self.locked,\n Stage.PARAM_DEPS: [d.dumpd() for d in self.deps],\n Stage.PARAM_OUTS: [o.dumpd() for o in self.outs],\n Stage.PARAM_META: self._state.get(\"meta\"),\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(file=relpath(fname))\n )\n d = self.dumpd()\n apply_diff(d, self._state)\n dump_stage_file(fname, self._state)\n\n self.repo.scm.track_file(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/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": 28, "span_ids": ["no_code", "encode", "docstring"], "tokens": 141}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Handle import compatibility between Python 2 and Python 3\"\"\"\nfrom __future__ import absolute_import\n\nimport sys\nimport os\nimport errno\nfrom contextlib import contextmanager\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/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": 47, "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": 202}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestGetFilesNumber(TestDvc):\n def _get_output(self):\n stage = Stage(self.dvc)\n return OutputLOCAL(stage, \"path\")\n\n def test_return_0_on_no_cache(self):\n o = self._get_output()\n o.use_cache = False\n self.assertEqual(0, o.get_files_number())\n\n @patch.object(OutputLOCAL, \"checksum\", \"12345678.dir\")\n @patch.object(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, \"checksum\", \"12345678\")\n @patch.object(OutputLOCAL, \"is_dir_checksum\", False)\n def test_return_1_on_single_file_cache(self):\n o = self._get_output()\n\n self.assertEqual(1, o.get_files_number())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_s3.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/output/test_s3.py__", "embedding": null, "metadata": {"file_path": "tests/unit/output/test_s3.py", "file_name": "test_s3.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 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/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": 34, "span_ids": ["imports", "TestRemoteAZURE", "TestRemoteAZURE.test_init", "TestRemoteAZURE.test_init_compat"], "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": "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.path_info, \"azure://\" + 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.path_info, url)\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_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": 37, "end_line": 69, "span_ids": ["TestCacheExists", "TestCacheExists.test"], "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 TestCacheExists(TestCase):\n def test(self):\n config = {\n \"url\": \"base://example/prefix\",\n \"connection_string\": \"1234567\",\n }\n remote = RemoteBASE(None, config)\n\n remote.PARAM_CHECKSUM = \"checksum\"\n remote.path_info = remote.path_cls(config[\"url\"])\n remote.url = \"\"\n remote.prefix = \"\"\n path_info = remote.path_info / \"example\"\n checksum_info = {remote.PARAM_CHECKSUM: \"1234567890\"}\n\n with mock.patch.object(remote, \"_checkout\") as mock_checkout:\n with mock.patch.object(remote, \"_save\") as mock_save:\n with mock.patch.object(\n remote, \"changed_cache\", return_value=True\n ):\n remote.save(path_info, checksum_info)\n mock_save.assert_called_once()\n mock_checkout.assert_not_called()\n\n with mock.patch.object(remote, \"_checkout\") as mock_checkout:\n with mock.patch.object(remote, \"_save\") as mock_save:\n with mock.patch.object(\n remote, \"changed_cache\", return_value=False\n ):\n remote.save(path_info, checksum_info)\n mock_save.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/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": 39, "span_ids": ["TestRemoteGS.test_gs", "TestRemoteGS.test_init", "TestRemoteGS.test_gs_no_credspath", "imports", "TestRemoteGS"], "tokens": 263}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import 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.path_info, self.URL)\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": 159}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nfrom tests.basic_env import TestDvcGit\n\n\nclass TestGit(TestDvcGit):\n def test_belongs_to_scm_true_on_gitignore(self):\n path = os.path.join(\"path\", \"to\", \".gitignore\")\n self.assertTrue(self.dvc.scm.belongs_to_scm(path))\n\n def test_belongs_to_scm_true_on_git_internal(self):\n path = os.path.join(\"path\", \"to\", \".git\", \"internal\", \"file\")\n self.assertTrue(self.dvc.scm.belongs_to_scm(path))\n\n def test_belongs_to_scm_false(self):\n path = os.path.join(\"some\", \"non-.git\", \"file\")\n self.assertFalse(self.dvc.scm.belongs_to_scm(path))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/scm/test_scm.py_from_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": 40, "span_ids": ["imports", "TestDaemon.test", "test_no_recursive_spawn", "TestDaemon"], "tokens": 280}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import 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)\n self.assertEqual(env[daemon.DVC_DAEMON], \"1\")\n\n\ndef test_no_recursive_spawn():\n with mock.patch.dict(os.environ, {daemon.DVC_DAEMON: \"1\"}):\n with mock.patch(\"dvc.daemon._spawn\") as mock_spawn:\n daemon.daemon([\"updater\"])\n mock_spawn.assert_not_called()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_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_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_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": 26, "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\n\nfrom dvc import __version__\nfrom dvc.updater import Updater\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/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": 39, "span_ids": ["imports", "TestMtimeAndSize.test", "TestMtimeAndSize"], "tokens": 263}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nfrom unittest import TestCase\n\nimport dvc\nimport pytest\nfrom dvc.system import System\nfrom dvc.path_info import PathInfo\nfrom dvc.utils import relpath\nfrom dvc.utils.compat import str\nfrom dvc.utils.fs import (\n get_mtime_and_size,\n contains_symlink_up_to,\n BasePathNotInCheckedPathException,\n get_parent_dirs_up_to,\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/dvc/__init__.py___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/__init__.py___", "embedding": null, "metadata": {"file_path": "dvc/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 22, "span_ids": ["docstring"], "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": "\"\"\"\nDVC\n----\nMake your data science projects reproducible and shareable.\n\"\"\"\n\nfrom __future__ import unicode_literals\n\nfrom dvc.version import __version__ # noqa: F401\nimport warnings\nimport dvc.logger\n\n\ndvc.logger.setup()\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\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cache.py_Cache._get_remote_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cache.py_Cache._get_remote_", "embedding": null, "metadata": {"file_path": "dvc/cache.py", "file_name": "cache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 66, "end_line": 105, "span_ids": ["Cache._get_remote"], "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 Cache(object):\n\n def _get_remote(self, config, name):\n \"\"\"\n The config file is stored in a way that allows you to have a\n cache for each remote.\n\n This is needed when specifying external outputs\n (as they require you to have an external cache location).\n\n Imagine a config file like the following:\n\n ['remote \"dvc-storage\"']\n url = ssh://localhost/tmp\n ask_password = true\n\n [cache]\n ssh = dvc-storage\n\n This method resolves the name under the cache section into the\n correct Remote instance.\n\n Args:\n config (dict): The cache section on the config file\n name (str): Name of the section we are interested in to retrieve\n\n Returns:\n remote (dvc.Remote): Remote instance that the section is referring.\n None when there's no remote with that name.\n\n Example:\n >>> _get_remote(config={'ssh': 'dvc-storage'}, name='ssh')\n \"\"\"\n from dvc.remote import Remote\n\n remote = config.get(name)\n\n if not remote:\n return None\n\n return Remote(self.repo, name=remote)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/diff.py_from___future___import_un_CmdDiff._get_md5_string.return.sample_msg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/diff.py_from___future___import_un_CmdDiff._get_md5_string.return.sample_msg", "embedding": null, "metadata": {"file_path": "dvc/command/diff.py", "file_name": "diff.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 36, "span_ids": ["imports", "CmdDiff._get_md5_string", "CmdDiff", "CmdDiff._print_size"], "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 argparse\n\nimport humanize\nimport inflect\nimport logging\nfrom funcy import compact\n\nfrom dvc.exceptions import DvcException\nfrom dvc.command.base import CmdBase, append_doc_link\nimport dvc.repo.diff as diff\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdDiff(CmdBase):\n @staticmethod\n def _print_size(size):\n if size < 0:\n change = \"decreased by {}\"\n elif size > 0:\n change = \"increased by {}\"\n else:\n change = \"not changed\"\n natur_size = humanize.naturalsize(abs(size))\n return change.format(natur_size)\n\n @staticmethod\n def _get_md5_string(sign, file_name, checksum):\n sample_msg = \"\"\n if file_name:\n sample_msg = \"{}{} with md5 {}\\n\"\n sample_msg = sample_msg.format(sign, file_name, checksum)\n return sample_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/diff.py_CmdDiff._get_dir_changes_CmdDiff._get_dir_changes.return.changes_msg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/diff.py_CmdDiff._get_dir_changes_CmdDiff._get_dir_changes.return.changes_msg", "embedding": null, "metadata": {"file_path": "dvc/command/diff.py", "file_name": "diff.py", "file_type": "text/x-python", "category": "implementation", "start_line": 38, "end_line": 56, "span_ids": ["CmdDiff._get_dir_changes"], "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 CmdDiff(CmdBase):\n\n @classmethod\n def _get_dir_changes(cls, dct):\n engine = inflect.engine()\n changes_msg = (\n \"{} {} not changed, {} {} modified, {} {} added, \"\n \"{} {} deleted, size was {}\"\n )\n changes_msg = changes_msg.format(\n dct[diff.DIFF_IDENT],\n engine.plural(\"file\", dct[diff.DIFF_IDENT]),\n dct[diff.DIFF_CHANGE],\n engine.plural(\"file\", dct[diff.DIFF_CHANGE]),\n dct[diff.DIFF_NEW],\n engine.plural(\"file\", dct[diff.DIFF_NEW]),\n dct[diff.DIFF_DEL],\n engine.plural(\"file\", dct[diff.DIFF_DEL]),\n cls._print_size(dct[diff.DIFF_SIZE]),\n )\n return changes_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/diff.py_CmdDiff._get_file_changes_CmdDiff._get_royal_changes.return._size_is_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/diff.py_CmdDiff._get_file_changes_CmdDiff._get_royal_changes.return._size_is_", "embedding": null, "metadata": {"file_path": "dvc/command/diff.py", "file_name": "diff.py", "file_type": "text/x-python", "category": "implementation", "start_line": 58, "end_line": 87, "span_ids": ["CmdDiff._get_royal_changes", "CmdDiff._get_file_changes"], "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 CmdDiff(CmdBase):\n\n @classmethod\n def _get_file_changes(cls, dct):\n if (\n dct.get(diff.DIFF_OLD_FILE)\n and dct.get(diff.DIFF_NEW_FILE)\n and dct[diff.DIFF_SIZE] == 0\n ):\n msg = \"file size was not changed\"\n elif dct.get(diff.DIFF_NEW_FILE):\n msg = \"added file with size {}\".format(\n humanize.naturalsize(dct[diff.DIFF_SIZE])\n )\n elif dct.get(diff.DIFF_OLD_FILE):\n msg = \"deleted file with size {}\".format(\n humanize.naturalsize(abs(dct[diff.DIFF_SIZE]))\n )\n else:\n msg = \"file was modified, file size {}\".format(\n cls._print_size(dct[diff.DIFF_SIZE])\n )\n return msg\n\n @classmethod\n def _get_royal_changes(cls, dct):\n if dct[diff.DIFF_SIZE] != diff.DIFF_SIZE_UNKNOWN:\n if dct.get(\"is_dir\"):\n return cls._get_dir_changes(dct)\n else:\n return cls._get_file_changes(dct)\n return \"size is ?\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/diff.py_CmdDiff._show_CmdDiff.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/diff.py_CmdDiff._show_CmdDiff.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/diff.py", "file_name": "diff.py", "file_type": "text/x-python", "category": "implementation", "start_line": 89, "end_line": 128, "span_ids": ["CmdDiff._show", "CmdDiff.run"], "tokens": 312}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CmdDiff(CmdBase):\n\n @classmethod\n def _show(cls, diff_dct):\n msg = \"dvc diff from {} to {}\".format(\n diff_dct[diff.DIFF_A_REF], diff_dct[diff.DIFF_B_REF]\n )\n if diff_dct.get(diff.DIFF_EQUAL):\n logger.info(msg)\n return\n for dct in diff_dct[diff.DIFF_LIST]:\n msg += \"\\n\\ndiff for '{}'\\n\".format(dct[diff.DIFF_TARGET])\n msg += cls._get_md5_string(\n \"-\",\n dct.get(diff.DIFF_OLD_FILE),\n dct.get(diff.DIFF_OLD_CHECKSUM),\n )\n msg += cls._get_md5_string(\n \"+\",\n dct.get(diff.DIFF_NEW_FILE),\n dct.get(diff.DIFF_NEW_CHECKSUM),\n )\n msg += \"\\n\"\n msg += cls._get_royal_changes(dct)\n logger.info(msg)\n return msg\n\n def run(self):\n try:\n msg = self.repo.diff(\n self.args.a_ref, target=self.args.target, b_ref=self.args.b_ref\n )\n self._show(msg)\n except DvcException:\n msg = \"failed to get 'diff {}'\"\n args = \" \".join(\n compact([self.args.target, self.args.a_ref, self.args.b_ref])\n )\n msg = msg.format(args)\n logger.exception(msg)\n return 1\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/diff.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/diff.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/diff.py", "file_name": "diff.py", "file_type": "text/x-python", "category": "implementation", "start_line": 131, "end_line": 165, "span_ids": ["add_parser"], "tokens": 262}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n DIFF_DESCRIPTION = (\n \"Show diff of a data file or a directory that is under DVC control.\\n\"\n \"Some basic statistics summary, how many files were deleted/changed.\"\n )\n DIFF_HELP = \"Show a diff of a DVC controlled data file or a directory.\"\n diff_parser = subparsers.add_parser(\n \"diff\",\n parents=[parent_parser],\n description=append_doc_link(DIFF_DESCRIPTION, \"diff\"),\n help=DIFF_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n diff_parser.add_argument(\n \"-t\",\n \"--target\",\n help=(\n \"Source path to a data file or directory. Default None. \"\n \"If not specified, compares all files and directories \"\n \"that are under DVC control in the current working space.\"\n ),\n )\n diff_parser.add_argument(\n \"a_ref\", help=\"Git reference from which diff calculates\"\n )\n diff_parser.add_argument(\n \"b_ref\",\n help=(\n \"Git reference until which diff calculates, if omitted \"\n \"diff shows the difference between current HEAD and a_ref\"\n ),\n nargs=\"?\",\n )\n diff_parser.set_defaults(func=CmdDiff)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_add_parser_add_parser.None_14": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_add_parser_add_parser.None_14", "embedding": null, "metadata": {"file_path": "dvc/command/metrics.py", "file_name": "metrics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 97, "end_line": 195, "span_ids": ["add_parser"], "tokens": 770}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n 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\",\n \"--type\",\n help=(\n \"Type of metrics (json/tsv/htsv/csv/hcsv). \"\n \"It can be detected by the file extension automatically. \"\n \"Unsupported types will be treated as raw.\"\n ),\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 # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_add_parser.metrics_modify_parser_set_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/metrics.py_add_parser.metrics_modify_parser_set_", "embedding": null, "metadata": {"file_path": "dvc/command/metrics.py", "file_name": "metrics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 196, "end_line": 208, "span_ids": ["add_parser"], "tokens": 127}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n # ... other code\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/pipeline.py_from___future___import_un_CmdPipelineShow._show.for_n_in_nodes_.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_nodes_.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": 39, "span_ids": ["CmdPipelineShow", "imports", "CmdPipelineShow._show"], "tokens": 234}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import unicode_literals\n\nfrom dvc.utils import relpath\nfrom dvc.utils.compat import str\n\nimport argparse\nimport logging\n\nfrom dvc.exceptions import DvcException\nfrom dvc.command.base import CmdBase, fix_subparsers, append_doc_link\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdPipelineShow(CmdBase):\n def _show(self, target, commands, outs, locked):\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 = relpath(stage.path, self.repo.root_dir)\n nodes = networkx.dfs_postorder_nodes(G, node)\n\n if locked:\n nodes = [n for n in nodes if stages[n].locked]\n\n for n in nodes:\n if commands:\n if stages[n].cmd is None:\n continue\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/tag.py_logging_CmdTagList.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/tag.py_logging_CmdTagList.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/tag.py", "file_name": "tag.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 57, "span_ids": ["CmdTagList", "CmdTagAdd", "imports", "CmdTagAdd.run", "CmdTagList.run", "CmdTagRemove.run", "CmdTagRemove"], "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 logging\n\nfrom dvc.utils import to_yaml_string\nfrom dvc.exceptions import DvcException\nfrom dvc.command.base import CmdBase, fix_subparsers, append_doc_link\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdTagAdd(CmdBase):\n def run(self):\n for target in self.args.targets:\n try:\n self.repo.tag.add(\n self.args.tag,\n target=target,\n with_deps=self.args.with_deps,\n recursive=self.args.recursive,\n )\n except DvcException:\n logger.exception(\"failed to add tag\")\n return 1\n return 0\n\n\nclass CmdTagRemove(CmdBase):\n def run(self):\n for target in self.args.targets:\n try:\n self.repo.tag.remove(\n self.args.tag,\n target=target,\n with_deps=self.args.with_deps,\n recursive=self.args.recursive,\n )\n except DvcException:\n logger.exception(\"failed to remove tag\")\n return 1\n return 0\n\n\nclass CmdTagList(CmdBase):\n def run(self):\n for target in self.args.targets:\n try:\n tags = self.repo.tag.list(\n target,\n with_deps=self.args.with_deps,\n recursive=self.args.recursive,\n )\n if tags:\n logger.info(to_yaml_string(tags))\n except DvcException:\n logger.exception(\"failed list tags\")\n return 1\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/daemon.py__spawn_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/daemon.py__spawn_", "embedding": null, "metadata": {"file_path": "dvc/daemon.py", "file_name": "daemon.py", "file_type": "text/x-python", "category": "implementation", "start_line": 72, "end_line": 108, "span_ids": ["_spawn", "daemon"], "tokens": 250}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _spawn(cmd, env):\n logger.debug(\"Trying to spawn '{}'\".format(cmd))\n\n if os.name == \"nt\":\n _spawn_windows(cmd, env)\n elif os.name == \"posix\":\n _spawn_posix(cmd, env)\n else:\n raise NotImplementedError\n\n logger.debug(\"Spawned '{}'\".format(cmd))\n\n\ndef daemon(args):\n \"\"\"Launch a `dvc daemon` command in a detached process.\n\n Args:\n args (list): list of arguments to append to `dvc daemon` command.\n \"\"\"\n if os.environ.get(DVC_DAEMON):\n logger.debug(\"skipping launching a new daemon.\")\n return\n\n cmd = [sys.executable]\n if not is_binary():\n cmd += [\"-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 env[cast_bytes_py2(DVC_DAEMON)] = cast_bytes_py2(\"1\")\n\n _spawn(cmd, env)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py__Manages_dvc_remotes_th_logger.logging_getLogger___name_": {"__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_logger.logging_getLogger___name_", "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": 19, "span_ids": ["docstring"], "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": "\"\"\"Manages dvc remotes that user can use with push/pull/status comamnds.\"\"\"\n\nfrom __future__ import unicode_literals\n\nimport logging\n\nfrom dvc.config import Config, ConfigError\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.oss import RemoteOSS\nfrom dvc.remote.ssh import RemoteSSH\nfrom dvc.remote.hdfs import RemoteHDFS\nfrom dvc.remote.local import RemoteLOCAL\nfrom dvc.remote.http import RemoteHTTP\n\n\nlogger = logging.getLogger(__name__)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/env.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/env.py__", "embedding": null, "metadata": {"file_path": "dvc/env.py", "file_name": "env.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 2, "span_ids": ["impl"], "tokens": 11}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "DVC_DAEMON = \"DVC_DAEMON\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_OverlappingOutputPathsError.__init__.super_OverlappingOutputPa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_OverlappingOutputPathsError_OverlappingOutputPathsError.__init__.super_OverlappingOutputPa", "embedding": null, "metadata": {"file_path": "dvc/exceptions.py", "file_name": "exceptions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 233, "end_line": 244, "span_ids": ["OverlappingOutputPathsError", "OverlappingOutputPathsError.__init__"], "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 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 )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_TargetNotDirectoryError_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/exceptions.py_TargetNotDirectoryError_", "embedding": null, "metadata": {"file_path": "dvc/exceptions.py", "file_name": "exceptions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 246, "end_line": 273, "span_ids": ["TargetNotDirectoryError", "ETagMismatchError", "CheckoutErrorSuggestGit", "ETagMismatchError.__init__", "OutputFileMissingError.__init__", "OutputFileMissingError", "CheckoutErrorSuggestGit.__init__", "TargetNotDirectoryError.__init__"], "tokens": 214}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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 )\n\n\nclass ETagMismatchError(DvcException):\n def __init__(self, etag, cached_etag):\n super(ETagMismatchError, self).__init__(\n \"ETag mismatch detected when copying file to cache! \"\n \"(expected: '{}', actual: '{}')\".format(etag, cached_etag)\n )\n\n\nclass OutputFileMissingError(DvcException):\n def __init__(self, path):\n super(OutputFileMissingError, self).__init__(\n \"Can't find {} neither locally nor on remote\".format(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/ignore.py_DvcIgnoreFromFile_DvcIgnoreFromFile.__hash__.return.hash_self_ignore_file_pat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_DvcIgnoreFromFile_DvcIgnoreFromFile.__hash__.return.hash_self_ignore_file_pat", "embedding": null, "metadata": {"file_path": "dvc/ignore.py", "file_name": "ignore.py", "file_type": "text/x-python", "category": "implementation", "start_line": 30, "end_line": 52, "span_ids": ["DvcIgnoreFromFile.matches", "DvcIgnoreFromFile.__init__", "DvcIgnoreFromFile.__hash__", "DvcIgnoreFromFile.__call__", "DvcIgnoreFromFile"], "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 DvcIgnoreFromFile(DvcIgnore):\n def __init__(self, ignore_file_path, ignore_handler):\n self.ignore_file_path = ignore_file_path\n self.dirname = os.path.normpath(os.path.dirname(ignore_file_path))\n\n self.ignore_spec = ignore_handler.read_patterns(ignore_file_path)\n\n def __call__(self, root, dirs, files):\n files = [f for f in files if not self.matches(root, f)]\n dirs = [d for d in dirs if not self.matches(root, d)]\n\n return dirs, files\n\n def matches(self, dirname, basename):\n abs_path = os.path.join(dirname, basename)\n relative_path = relpath(abs_path, self.dirname)\n if os.name == \"nt\":\n relative_path = relative_path.replace(\"\\\\\", \"/\")\n\n return self.ignore_spec.match_file(relative_path)\n\n def __hash__(self):\n return hash(self.ignore_file_path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_DvcIgnoreConstant_DvcIgnoreFile.__call__.return.dirs_files": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_DvcIgnoreConstant_DvcIgnoreFile.__call__.return.dirs_files", "embedding": null, "metadata": {"file_path": "dvc/ignore.py", "file_name": "ignore.py", "file_type": "text/x-python", "category": "implementation", "start_line": 80, "end_line": 96, "span_ids": ["DvcIgnoreFile", "DvcIgnoreConstant", "DvcIgnoreDir", "DvcIgnoreConstant.__init__", "DvcIgnoreFile.__call__", "DvcIgnoreDir.__call__"], "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 DvcIgnoreConstant(DvcIgnore):\n def __init__(self, basename):\n self.basename = basename\n\n\nclass DvcIgnoreDir(DvcIgnoreConstant):\n def __call__(self, root, dirs, files):\n dirs = [d for d in dirs if not d == self.basename]\n\n return dirs, files\n\n\nclass DvcIgnoreFile(DvcIgnoreConstant):\n def __call__(self, root, dirs, files):\n files = [f for f in files if not f == self.basename]\n\n return dirs, files", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_DvcIgnoreFilter_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_DvcIgnoreFilter_", "embedding": null, "metadata": {"file_path": "dvc/ignore.py", "file_name": "ignore.py", "file_type": "text/x-python", "category": "implementation", "start_line": 99, "end_line": 135, "span_ids": ["DvcIgnoreFilter", "DvcIgnoreFilter.__init__", "DvcIgnoreFilter.__call__", "DvcIgnoreFilter._process_ignores_in_parent_dirs", "DvcIgnoreFilter.update"], "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 DvcIgnoreFilter(object):\n def __init__(self, wdir, ignore_file_handler=None):\n self.ignores = [\n DvcIgnoreDir(\".git\"),\n DvcIgnoreDir(\".hg\"),\n DvcIgnoreDir(\".dvc\"),\n DvcIgnoreFile(\".dvcignore\"),\n ]\n\n self.ignore_file_handler = ignore_file_handler\n self._process_ignores_in_parent_dirs(wdir)\n\n def _process_ignores_in_parent_dirs(self, wdir):\n if self.ignore_file_handler:\n wdir = os.path.normpath(os.path.abspath(wdir))\n ignore_search_end_dir = self.ignore_file_handler.get_repo_root()\n parent_dirs = get_parent_dirs_up_to(wdir, ignore_search_end_dir)\n for d in parent_dirs:\n self.update(d)\n\n def update(self, wdir):\n ignore_file_path = os.path.join(wdir, DvcIgnore.DVCIGNORE_FILE)\n if os.path.exists(ignore_file_path):\n file_ignore = DvcIgnoreFromFile(\n ignore_file_path, ignore_handler=self.ignore_file_handler\n )\n self.ignores.append(file_ignore)\n\n def __call__(self, root, dirs, files):\n if self.ignore_file_handler:\n self.update(root)\n\n for ignore in self.ignores:\n dirs, files = ignore(root, dirs, files)\n\n return dirs, files", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py__Manages_logging_config_ColorFormatter.footer._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py__Manages_logging_config_ColorFormatter.footer._", "embedding": null, "metadata": {"file_path": "dvc/logger.py", "file_name": "logger.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 53, "span_ids": ["ColorFormatter", "ExcludeErrorsFilter", "docstring", "LoggingException.__init__", "ExcludeErrorsFilter.filter", "LoggingException"], "tokens": 320}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Manages logging configuration for dvc repo.\"\"\"\n\nfrom __future__ import unicode_literals\n\nfrom dvc.utils.compat import str, StringIO\n\nimport logging\nimport logging.handlers\nimport logging.config\nimport colorama\n\n\nclass LoggingException(Exception):\n def __init__(self, record):\n msg = \"failed to log {}\".format(str(record))\n super(LoggingException, self).__init__(msg)\n\n\nclass ExcludeErrorsFilter(logging.Filter):\n def filter(self, record):\n return record.levelno < logging.ERROR\n\n\nclass ColorFormatter(logging.Formatter):\n \"\"\"Enable color support when logging to a terminal that supports it.\n\n Color support on Windows versions that do not support ANSI color codes is\n enabled by use of the colorama__ library.\n See the colorama documentation for details.\n\n __ https://pypi.python.org/pypi/colorama\n\n For records containing `exc_info`, it will use a custom `_walk_exc` to\n retrieve the whole tracebak.\n \"\"\"\n\n color_code = {\n \"DEBUG\": colorama.Fore.BLUE,\n \"INFO\": \"\",\n \"WARNING\": colorama.Fore.YELLOW,\n \"ERROR\": colorama.Fore.RED,\n \"CRITICAL\": colorama.Fore.RED,\n }\n\n footer = (\n \"{yellow}Having any troubles?{nc}.\"\n \" Hit us up at {blue}https://dvc.org/support{nc},\"\n \" we are always happy to help!\"\n ).format(\n blue=colorama.Fore.BLUE,\n nc=colorama.Fore.RESET,\n yellow=colorama.Fore.YELLOW,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py_ColorFormatter.format_ColorFormatter.format.return._color_levelname_nc_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py_ColorFormatter.format_ColorFormatter.format.return._color_levelname_nc_", "embedding": null, "metadata": {"file_path": "dvc/logger.py", "file_name": "logger.py", "file_type": "text/x-python", "category": "implementation", "start_line": 49, "end_line": 79, "span_ids": ["ColorFormatter.format"], "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 ColorFormatter(logging.Formatter):\n\n def format(self, record):\n if self._is_visible(record):\n self._progress_aware()\n\n if record.levelname == \"INFO\":\n return record.msg\n\n if record.levelname == \"ERROR\" or record.levelname == \"CRITICAL\":\n exception, stack_trace = self._parse_exc(record.exc_info)\n\n return (\n \"{color}{levelname}{nc}: {description}\"\n \"{stack_trace}\\n\"\n \"\\n\"\n \"{footer}\"\n ).format(\n color=self.color_code.get(record.levelname, \"\"),\n nc=colorama.Fore.RESET,\n levelname=record.levelname,\n description=self._description(record.msg, exception),\n msg=record.msg,\n stack_trace=stack_trace,\n footer=self.footer,\n )\n\n return \"{color}{levelname}{nc}: {msg}\".format(\n color=self.color_code.get(record.levelname, \"\"),\n nc=colorama.Fore.RESET,\n levelname=record.levelname,\n msg=record.msg,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py_setup_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py_setup_", "embedding": null, "metadata": {"file_path": "dvc/logger.py", "file_name": "logger.py", "file_type": "text/x-python", "category": "implementation", "start_line": 164, "end_line": 199, "span_ids": ["setup"], "tokens": 219}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def setup(level=logging.INFO):\n colorama.init()\n\n logging.config.dictConfig(\n {\n \"version\": 1,\n \"filters\": {\"exclude_errors\": {\"()\": ExcludeErrorsFilter}},\n \"formatters\": {\"color\": {\"()\": ColorFormatter}},\n \"handlers\": {\n \"console\": {\n \"class\": \"dvc.logger.LoggerHandler\",\n \"level\": \"DEBUG\",\n \"formatter\": \"color\",\n \"stream\": \"ext://sys.stdout\",\n \"filters\": [\"exclude_errors\"],\n },\n \"console_errors\": {\n \"class\": \"dvc.logger.LoggerHandler\",\n \"level\": \"ERROR\",\n \"formatter\": \"color\",\n \"stream\": \"ext://sys.stderr\",\n },\n },\n \"loggers\": {\n \"dvc\": {\n \"level\": level,\n \"handlers\": [\"console\", \"console_errors\"],\n },\n \"paramiko\": {\n \"level\": logging.CRITICAL,\n \"handlers\": [\"console\", \"console_errors\"],\n },\n },\n }\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.commit_OutputBase.dumpd.return.ret": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.commit_OutputBase.dumpd.return.ret", "embedding": null, "metadata": {"file_path": "dvc/output/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 241, "end_line": 267, "span_ids": ["OutputBase.commit", "OutputBase.dumpd"], "tokens": 160}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class OutputBase(object):\n\n def commit(self):\n if self.use_cache:\n self.cache.save(self.path_info, self.info)\n\n def dumpd(self):\n ret = copy(self.info)\n ret[self.PARAM_PATH] = self.def_path\n\n if self.IS_DEPENDENCY:\n return ret\n\n ret[self.PARAM_CACHE] = self.use_cache\n\n if isinstance(self.metric, dict):\n if (\n self.PARAM_METRIC_XPATH in self.metric\n and not self.metric[self.PARAM_METRIC_XPATH]\n ):\n del self.metric[self.PARAM_METRIC_XPATH]\n\n ret[self.PARAM_METRIC] = self.metric\n ret[self.PARAM_PERSIST] = self.persist\n\n if self.tags:\n ret[self.PARAM_TAGS] = self.tags\n\n return ret", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3_RemoteS3.get_head_object.return.obj": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3_RemoteS3.get_head_object.return.obj", "embedding": null, "metadata": {"file_path": "dvc/remote/s3.py", "file_name": "s3.py", "file_type": "text/x-python", "category": "implementation", "start_line": 37, "end_line": 108, "span_ids": ["RemoteS3", "RemoteS3.s3", "RemoteS3.compat_config", "RemoteS3.__init__", "RemoteS3.get_file_checksum", "RemoteS3.get_head_object", "RemoteS3.get_etag"], "tokens": 538}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 = Schemes.S3\n path_cls = CloudURLInfo\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 url = config.get(Config.SECTION_REMOTE_URL, storagepath)\n self.path_info = self.path_cls(url)\n\n self.region = config.get(Config.SECTION_AWS_REGION)\n\n self.profile = config.get(Config.SECTION_AWS_PROFILE)\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 self.extra_args = {}\n\n self.sse = config.get(Config.SECTION_AWS_SSE, \"\")\n if self.sse:\n self.extra_args[\"ServerSideEncryption\"] = self.sse\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 @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 @classmethod\n def get_etag(cls, s3, bucket, path):\n obj = cls.get_head_object(s3, bucket, path)\n\n return obj[\"ETag\"].strip('\"')\n\n def get_file_checksum(self, path_info):\n return self.get_etag(self.s3, path_info.bucket, path_info.path)\n\n @staticmethod\n def get_head_object(s3, bucket, path, *args, **kwargs):\n\n try:\n obj = s3.head_object(Bucket=bucket, Key=path, *args, **kwargs)\n except Exception as exc:\n raise DvcException(\n \"s3://{}/{} does not exist\".format(bucket, path), exc\n )\n return obj", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3._copy_multipart_RemoteS3._copy_multipart.s3_complete_multipart_upl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3._copy_multipart_RemoteS3._copy_multipart.s3_complete_multipart_upl", "embedding": null, "metadata": {"file_path": "dvc/remote/s3.py", "file_name": "s3.py", "file_type": "text/x-python", "category": "implementation", "start_line": 116, "end_line": 158, "span_ids": ["RemoteS3._copy_multipart"], "tokens": 332}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteS3(RemoteBASE):\n\n @classmethod\n def _copy_multipart(\n cls, s3, from_info, to_info, size, n_parts, extra_args\n ):\n mpu = s3.create_multipart_upload(\n Bucket=to_info.bucket, Key=to_info.path, **extra_args\n )\n mpu_id = mpu[\"UploadId\"]\n\n parts = []\n byte_position = 0\n for i in range(1, n_parts + 1):\n obj = cls.get_head_object(\n s3, from_info.bucket, from_info.path, PartNumber=i\n )\n part_size = obj[\"ContentLength\"]\n lastbyte = byte_position + part_size - 1\n if lastbyte > size:\n lastbyte = size - 1\n\n srange = \"bytes={}-{}\".format(byte_position, lastbyte)\n\n part = s3.upload_part_copy(\n Bucket=to_info.bucket,\n Key=to_info.path,\n PartNumber=i,\n UploadId=mpu_id,\n CopySourceRange=srange,\n CopySource={\"Bucket\": from_info.bucket, \"Key\": from_info.path},\n )\n parts.append(\n {\"PartNumber\": i, \"ETag\": part[\"CopyPartResult\"][\"ETag\"]}\n )\n byte_position += part_size\n\n assert n_parts == len(parts)\n\n s3.complete_multipart_upload(\n Bucket=to_info.bucket,\n Key=to_info.path,\n UploadId=mpu_id,\n MultipartUpload={\"Parts\": parts},\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3._copy_RemoteS3._copy.if_etag_cached_etag_.raise_ETagMismatchError_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3._copy_RemoteS3._copy.if_etag_cached_etag_.raise_ETagMismatchError_e", "embedding": null, "metadata": {"file_path": "dvc/remote/s3.py", "file_name": "s3.py", "file_type": "text/x-python", "category": "implementation", "start_line": 160, "end_line": 198, "span_ids": ["RemoteS3._copy"], "tokens": 511}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteS3(RemoteBASE):\n\n @classmethod\n def _copy(cls, s3, from_info, to_info, extra_args):\n # NOTE: object's etag depends on the way it was uploaded to s3 or the\n # way it was copied within the s3. More specifically, it depends on\n # the chunk size that was used to transfer it, which would affect\n # whether an object would be uploaded as a single part or as a\n # multipart.\n #\n # If an object's etag looks like '8978c98bb5a48c2fb5f2c4c905768afa',\n # then it was transfered as a single part, which means that the chunk\n # size used to transfer it was greater or equal to the ContentLength\n # of that object. So to preserve that tag over the next transfer, we\n # could use any value >= ContentLength.\n #\n # If an object's etag looks like '50d67013a5e1a4070bef1fc8eea4d5f9-13',\n # then it was transfered as a multipart, which means that the chunk\n # size used to transfer it was less than ContentLength of that object.\n # Unfortunately, in general, it doesn't mean that the chunk size was\n # the same throughout the transfer, so it means that in order to\n # preserve etag, we need to transfer each part separately, so the\n # object is transfered in the same chunks as it was originally.\n\n obj = cls.get_head_object(s3, from_info.bucket, from_info.path)\n etag = obj[\"ETag\"].strip('\"')\n size = obj[\"ContentLength\"]\n\n _, _, parts_suffix = etag.partition(\"-\")\n if parts_suffix:\n n_parts = int(parts_suffix)\n cls._copy_multipart(\n s3, from_info, to_info, size, n_parts, extra_args=extra_args\n )\n else:\n source = {\"Bucket\": from_info.bucket, \"Key\": from_info.path}\n s3.copy(source, to_info.bucket, to_info.path, ExtraArgs=extra_args)\n\n cached_etag = cls.get_etag(s3, to_info.bucket, to_info.path)\n if etag != cached_etag:\n raise ETagMismatchError(etag, cached_etag)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.walk_SSHConnection.walk.if_not_topdown_.yield_directory_dirs_no": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.walk_SSHConnection.walk.if_not_topdown_.yield_directory_dirs_no", "embedding": null, "metadata": {"file_path": "dvc/remote/ssh/connection.py", "file_name": "connection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 125, "end_line": 161, "span_ids": ["SSHConnection.walk"], "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 SSHConnection:\n\n def walk(self, directory, topdown=True):\n # NOTE: original os.walk() implementation [1] with default options was\n # used as a template.\n #\n # [1] https://github.com/python/cpython/blob/master/Lib/os.py\n\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 dirs = []\n nondirs = []\n for entry in dir_entries:\n name = entry.filename\n if stat.S_ISDIR(entry.st_mode):\n dirs.append(name)\n else:\n nondirs.append(name)\n\n if topdown:\n yield directory, dirs, nondirs\n\n for dname in dirs:\n newpath = posixpath.join(directory, dname)\n for entry in self.walk(newpath, topdown=topdown):\n yield entry\n\n if not topdown:\n yield directory, dirs, nondirs", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/diff.py_from___future___import_un__file_not_exists.if_error_errno_ENOENT_.else_.raise_error": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/diff.py_from___future___import_un__file_not_exists.if_error_errno_ENOENT_.else_.raise_error", "embedding": null, "metadata": {"file_path": "dvc/repo/diff.py", "file_name": "diff.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 42, "span_ids": ["imports", "_file_not_exists"], "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": "from __future__ import unicode_literals\n\nimport os\nfrom errno import ENOENT\n\n\nimport dvc.logger as logger\nfrom dvc.scm.base import FileNotInCommitError\nfrom dvc.scm.git import (\n DIFF_A_TREE,\n DIFF_B_TREE,\n DIFF_A_REF,\n DIFF_B_REF,\n DIFF_EQUAL,\n)\n\n\nDIFF_TARGET = \"target\"\nDIFF_IS_DIR = \"is_dir\"\nDIFF_OLD_FILE = \"old_file\"\nDIFF_OLD_CHECKSUM = \"old_checksum\"\nDIFF_NEW_FILE = \"new_file\"\nDIFF_NEW_CHECKSUM = \"new_checksum\"\nDIFF_SIZE = \"size_diff\"\nDIFF_DEL = \"del\"\nDIFF_IDENT = \"ident\"\nDIFF_CHANGE = \"changes\"\nDIFF_NEW = \"new\"\nDIFF_MOVE = \"moves\"\nDIFF_LIST = \"diffs\"\nDIFF_SIZE_UNKNOWN = \"?\"\nDIFF_A_OUTPUT = \"a_output\"\nDIFF_B_OUTPUT = \"b_output\"\nDIFF_DELETED = \"deleted_file\"\nDIFF_IS_NEW = \"created_file\"\n\n\ndef _file_not_exists(error, result):\n if error.errno == ENOENT:\n result.update({DIFF_SIZE: DIFF_SIZE_UNKNOWN})\n else:\n raise error", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/diff.py__extract_dir__extract_dir.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/diff.py__extract_dir__extract_dir.return._", "embedding": null, "metadata": {"file_path": "dvc/repo/diff.py", "file_name": "diff.py", "file_type": "text/x-python", "category": "implementation", "start_line": 45, "end_line": 58, "span_ids": ["_extract_dir"], "tokens": 122}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _extract_dir(self, dir_not_exists, output):\n \"\"\"Extract the content of dvc tree file\n Args:\n self(object) - Repo class instance\n dir_not_exists(bool) - flag for directory existence\n output(object) - OutputLOCAL class instance\n Returns:\n dict - dictionary with keys - paths to file in .dvc/cache\n values -checksums for that files\n \"\"\"\n if not dir_not_exists:\n lst = output.dir_cache\n return {i[\"relpath\"]: i[\"md5\"] for i in lst}\n return {}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/diff.py__get_dir_info__new_files.return.new_count_diff_size": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/diff.py__get_dir_info__new_files.return.new_count_diff_size", "embedding": null, "metadata": {"file_path": "dvc/repo/diff.py", "file_name": "diff.py", "file_type": "text/x-python", "category": "implementation", "start_line": 61, "end_line": 104, "span_ids": ["_get_dir_info", "_ident_files", "_modified_files", "_new_files", "_deleted_files"], "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": "def _get_dir_info(dir_not_exists, a_output):\n if not dir_not_exists:\n return str(a_output), a_output.checksum\n return \"\", \"\"\n\n\ndef _ident_files(a_entries, b_entries):\n keys = [\n key for key in a_entries.keys() if b_entries.get(key) == a_entries[key]\n ]\n return len(keys)\n\n\ndef _modified_files(self, a_entries, b_entries):\n keys = [key for key in a_entries.keys() if key in b_entries]\n diff_size = 0\n modified_count = 0\n for key in keys:\n if a_entries[key] != b_entries[key]:\n modified_count\n diff_size += os.path.getsize(\n self.cache.local.get(b_entries[key])\n ) - os.path.getsize(self.cache.local.get(a_entries[key]))\n return modified_count, diff_size\n\n\ndef _deleted_files(self, a_entries, b_entries):\n diff_size = 0\n deleted_count = 0\n for key, value in a_entries.items():\n if key not in b_entries:\n deleted_count += 1\n diff_size -= os.path.getsize(self.cache.local.get(a_entries[key]))\n return deleted_count, diff_size\n\n\ndef _new_files(self, a_entries, b_entries):\n diff_size = 0\n new_count = 0\n for key, value in b_entries.items():\n if key not in a_entries:\n new_count += 1\n diff_size += os.path.getsize(self.cache.local.get(b_entries[key]))\n return new_count, diff_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/repo/diff.py__get_tree_changes__is_dir.if_a_outs_get_path_.else_.return.b_outs_path_is_dir_check": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/diff.py__get_tree_changes__is_dir.if_a_outs_get_path_.else_.return.b_outs_path_is_dir_check", "embedding": null, "metadata": {"file_path": "dvc/repo/diff.py", "file_name": "diff.py", "file_type": "text/x-python", "category": "implementation", "start_line": 107, "end_line": 138, "span_ids": ["_is_dir", "_check_local_cache", "_get_tree_changes"], "tokens": 256}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _get_tree_changes(self, a_entries, b_entries):\n result = {\n DIFF_DEL: 0,\n DIFF_IDENT: 0,\n DIFF_CHANGE: 0,\n DIFF_NEW: 0,\n DIFF_MOVE: 0,\n }\n result[DIFF_IDENT] = _ident_files(a_entries, b_entries)\n result[DIFF_CHANGE], diff_size = _modified_files(\n self, a_entries, b_entries\n )\n result[DIFF_SIZE] = diff_size\n result[DIFF_DEL], diff_size = _deleted_files(self, a_entries, b_entries)\n result[DIFF_SIZE] += diff_size\n result[DIFF_NEW], diff_size = _new_files(self, a_entries, b_entries)\n result[DIFF_SIZE] += diff_size\n return result\n\n\ndef _check_local_cache(a_out, is_checked):\n if a_out is not None and a_out.scheme != \"local\":\n is_checked.append(str(a_out))\n return True\n return False\n\n\ndef _is_dir(path, a_outs, b_outs):\n if a_outs.get(path):\n return a_outs[path].is_dir_checksum\n else:\n return b_outs[path].is_dir_checksum", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/diff.py__get_diff_outs__get_diff_outs.return.results": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/diff.py__get_diff_outs__get_diff_outs.return.results", "embedding": null, "metadata": {"file_path": "dvc/repo/diff.py", "file_name": "diff.py", "file_type": "text/x-python", "category": "implementation", "start_line": 141, "end_line": 169, "span_ids": ["_get_diff_outs"], "tokens": 309}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _get_diff_outs(self, diff_dct):\n self.tree = diff_dct[DIFF_A_TREE]\n a_outs = {str(out): out for st in self.stages() for out in st.outs}\n self.tree = diff_dct[DIFF_B_TREE]\n b_outs = {str(out): out for st in self.stages() for out in st.outs}\n outs_paths = set(a_outs.keys())\n outs_paths.update(b_outs.keys())\n results = {}\n non_local_cache = []\n for path in outs_paths:\n check1 = _check_local_cache(a_outs.get(path), non_local_cache)\n check2 = _check_local_cache(b_outs.get(path), non_local_cache)\n # skip files/directories with non-local cache for now\n if check1 or check2:\n continue\n results[path] = {}\n results[path][DIFF_A_OUTPUT] = a_outs.get(path)\n results[path][DIFF_B_OUTPUT] = b_outs.get(path)\n results[path][DIFF_IS_NEW] = path not in a_outs\n results[path][DIFF_DELETED] = path not in b_outs\n results[path][DIFF_IS_DIR] = _is_dir(path, a_outs, b_outs)\n if non_local_cache:\n logger.warning(\n \"Diff is not supported for non-local outputs. Ignoring: {}\".format(\n non_local_cache\n )\n )\n\n return results", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/diff.py__diff_dir__diff_dir.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/diff.py__diff_dir__diff_dir.return.result", "embedding": null, "metadata": {"file_path": "dvc/repo/diff.py", "file_name": "diff.py", "file_type": "text/x-python", "category": "implementation", "start_line": 172, "end_line": 192, "span_ids": ["_diff_dir"], "tokens": 210}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _diff_dir(self, target, diff_dct):\n result = {DIFF_TARGET: target}\n result[DIFF_IS_DIR] = True\n a_entries, b_entries = {}, {}\n try:\n a_entries = _extract_dir(\n self, diff_dct[DIFF_IS_NEW], diff_dct[DIFF_A_OUTPUT]\n )\n b_entries = _extract_dir(\n self, diff_dct[DIFF_DELETED], diff_dct[DIFF_B_OUTPUT]\n )\n result[DIFF_OLD_FILE], result[DIFF_OLD_CHECKSUM] = _get_dir_info(\n diff_dct[DIFF_IS_NEW], diff_dct[DIFF_A_OUTPUT]\n )\n result[DIFF_NEW_FILE], result[DIFF_NEW_CHECKSUM] = _get_dir_info(\n diff_dct[DIFF_DELETED], diff_dct[DIFF_B_OUTPUT]\n )\n result.update(_get_tree_changes(self, a_entries, b_entries))\n except IOError as e:\n _file_not_exists(e, result)\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/diff.py__diff_file__diff_royal.return._diff_file_self_target_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/diff.py__diff_file__diff_royal.return._diff_file_self_target_", "embedding": null, "metadata": {"file_path": "dvc/repo/diff.py", "file_name": "diff.py", "file_type": "text/x-python", "category": "implementation", "start_line": 195, "end_line": 220, "span_ids": ["_diff_file", "_diff_royal"], "tokens": 237}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _diff_file(self, target, diff_dct):\n result = {DIFF_TARGET: target}\n size = 0\n try:\n if not diff_dct[DIFF_IS_NEW]:\n result[DIFF_OLD_FILE] = target\n result[DIFF_OLD_CHECKSUM] = diff_dct[DIFF_A_OUTPUT].checksum\n size -= os.path.getsize(\n self.cache.local.get(diff_dct[DIFF_A_OUTPUT].checksum)\n )\n if not diff_dct[DIFF_DELETED]:\n result[DIFF_NEW_FILE] = target\n result[DIFF_NEW_CHECKSUM] = diff_dct[DIFF_B_OUTPUT].checksum\n size += os.path.getsize(\n self.cache.local.get(diff_dct[DIFF_B_OUTPUT].checksum)\n )\n result[DIFF_SIZE] = size\n except IOError as e:\n _file_not_exists(e, result)\n return result\n\n\ndef _diff_royal(self, target, diff_dct):\n if diff_dct[DIFF_IS_DIR]:\n return _diff_dir(self, target, diff_dct)\n return _diff_file(self, target, diff_dct)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/diff.py_diff_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/diff.py_diff_", "embedding": null, "metadata": {"file_path": "dvc/repo/diff.py", "file_name": "diff.py", "file_type": "text/x-python", "category": "implementation", "start_line": 223, "end_line": 253, "span_ids": ["diff"], "tokens": 278}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def diff(self, a_ref, target=None, b_ref=None):\n \"\"\"Gerenates diff message string output\n\n Args:\n target(str) - file/directory to check diff of\n a_ref(str) - first tag\n (optional) b_ref(str) - second git tag\n\n Returns:\n string: string of output message with diff info\n \"\"\"\n result = {}\n diff_dct = self.scm.get_diff_trees(a_ref, b_ref=b_ref)\n result[DIFF_A_REF] = diff_dct[DIFF_A_REF]\n result[DIFF_B_REF] = diff_dct[DIFF_B_REF]\n if diff_dct[DIFF_EQUAL]:\n result[DIFF_EQUAL] = True\n return result\n result[DIFF_LIST] = []\n diff_outs = _get_diff_outs(self, diff_dct)\n if target is None:\n result[DIFF_LIST] = [\n _diff_royal(self, path, diff_outs[path]) for path in diff_outs\n ]\n elif target in diff_outs:\n result[DIFF_LIST] = [_diff_royal(self, target, diff_outs[target])]\n else:\n msg = \"Have not found file/directory '{}' in the commits\"\n raise FileNotInCommitError(msg.format(target))\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/scm/git/__init__.py__Manages_Git__DIFF_EQUAL._equal_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py__Manages_Git__DIFF_EQUAL._equal_", "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": 26, "span_ids": ["docstring"], "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": "\"\"\"Manages Git.\"\"\"\n\nfrom __future__ import unicode_literals\n\nimport os\nimport logging\n\nfrom dvc.utils.compat import str, open\nfrom dvc.utils import fix_env, relpath\nfrom dvc.scm.base import (\n Base,\n SCMError,\n FileNotInRepoError,\n FileNotInTargetSubdirError,\n)\nfrom dvc.scm.git.tree import GitTree\n\n\nlogger = logging.getLogger(__name__)\n\n\nDIFF_A_TREE = \"a_tree\"\nDIFF_B_TREE = \"b_tree\"\nDIFF_A_REF = \"a_ref\"\nDIFF_B_REF = \"b_ref\"\nDIFF_EQUAL = \"equal\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git_Git.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_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": 29, "end_line": 77, "span_ids": ["Git.__init__", "Git.is_submodule", "Git.dir", "Git._get_git_dir", "Git", "Git.ignore_file", "Git.is_repo"], "tokens": 327}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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 \"\"\"Git class constructor.\n Requires `Repo` class from `git` module (from gitpython package).\n \"\"\"\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(self.root_dir)\n except InvalidGitRepositoryError:\n msg = \"{} is not a git repository\"\n raise SCMError(msg.format(self.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_diff_trees_Git._get_diff_trees.return.trees_commits": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git._get_diff_trees_Git._get_diff_trees.return.trees_commits", "embedding": null, "metadata": {"file_path": "dvc/scm/git/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 261, "end_line": 289, "span_ids": ["Git._get_diff_trees"], "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 Git(Base):\n\n def _get_diff_trees(self, a_ref, b_ref):\n \"\"\"Private method for getting the trees and commit hashes of 2 git\n references. Requires `gitdb` module (from gitpython package).\n\n Args:\n a_ref (str): git reference\n b_ref (str): second git reference. If None, uses HEAD\n\n Returns:\n tuple: tuple with elements: (trees, commits)\n \"\"\"\n from gitdb.exc import BadObject, BadName\n\n trees = {DIFF_A_TREE: None, DIFF_B_TREE: None}\n commits = []\n if b_ref is None:\n b_ref = self.git.head.commit\n try:\n a_commit = self.git.git.rev_parse(a_ref, short=True)\n b_commit = self.git.git.rev_parse(b_ref, short=True)\n # See https://gitpython.readthedocs.io\n # /en/2.1.11/reference.html#git.objects.base.Object.__str__\n commits.append(a_commit)\n commits.append(b_commit)\n trees[DIFF_A_TREE] = self.get_tree(commits[0])\n trees[DIFF_B_TREE] = self.get_tree(commits[1])\n except (BadName, BadObject) as e:\n raise SCMError(\"git problem\", cause=e)\n return trees, commits", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.get_diff_trees_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.get_diff_trees_", "embedding": null, "metadata": {"file_path": "dvc/scm/git/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 300, "end_line": 325, "span_ids": ["Git.get_diff_trees", "Git.get_rev"], "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 Git(Base):\n\n def get_diff_trees(self, a_ref, b_ref=None):\n \"\"\"Method for getting two repo trees between two git tag commits.\n Returns the dvc hash names of changed file/directory\n\n Args:\n a_ref (str): git reference\n b_ref (str): optional second git reference, default None\n\n Returns:\n dict: dictionary with keys: {a_ref, b_ref, equal}\n or {a_ref, b_ref, a_tree, b_tree}\n \"\"\"\n diff_dct = {DIFF_EQUAL: False}\n trees, commits = self._get_diff_trees(a_ref, b_ref)\n diff_dct[DIFF_A_REF] = commits[0]\n diff_dct[DIFF_B_REF] = commits[1]\n if commits[0] == commits[1]:\n diff_dct[DIFF_EQUAL] = True\n return diff_dct\n diff_dct[DIFF_A_TREE] = trees[DIFF_A_TREE]\n diff_dct[DIFF_B_TREE] = trees[DIFF_B_TREE]\n return diff_dct\n\n def get_rev(self):\n return self.git.git.rev_parse(\"HEAD\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_data_decode_utf": {"__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_data_decode_utf", "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": 52, "span_ids": ["imports", "GitTree.open", "GitTree", "GitTree.__init__", "GitTree.tree_root"], "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": "import errno\nimport os\n\nfrom dvc.ignore import DvcIgnoreFilter\nfrom dvc.utils import relpath\nfrom dvc.utils.compat import StringIO, BytesIO\nfrom dvc.exceptions import DvcException\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 @property\n def tree_root(self):\n return self.git.working_dir\n\n def open(self, path, binary=False):\n\n relative_path = relpath(path, self.git.working_dir)\n\n obj = self.git_object_by_path(path)\n if obj is None:\n msg = \"No such file in branch '{}'\".format(self.rev)\n raise IOError(errno.ENOENT, msg, relative_path)\n if obj.mode == GIT_MODE_DIR:\n raise IOError(errno.EISDIR, \"Is a directory\", relative_path)\n\n # GitPython's obj.data_stream is a fragile thing, it is better to\n # read it immediately, also it needs to be to decoded if we follow\n # the `open()` behavior (since data_stream.read() returns bytes,\n # and `open` with default \"r\" mode returns str)\n data = obj.data_stream.read()\n if binary:\n return BytesIO(data)\n return StringIO(data.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._walk_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_GitTree._walk_", "embedding": null, "metadata": {"file_path": "dvc/scm/git/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 92, "end_line": 140, "span_ids": ["GitTree.walk", "GitTree._walk"], "tokens": 317}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GitTree(BaseTree):\n\n def _walk(\n self,\n tree,\n topdown=True,\n ignore_file_handler=None,\n dvc_ignore_filter=None,\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 if not dvc_ignore_filter:\n dvc_ignore_filter = DvcIgnoreFilter(\n tree.abspath, ignore_file_handler=ignore_file_handler\n )\n dirs, nondirs = dvc_ignore_filter(tree.path, dirs, nondirs)\n yield os.path.normpath(tree.abspath), dirs, nondirs\n\n for i in dirs:\n for x in self._walk(\n tree[i],\n topdown=True,\n ignore_file_handler=ignore_file_handler,\n dvc_ignore_filter=dvc_ignore_filter,\n ):\n yield x\n\n if not topdown:\n yield os.path.normpath(tree.abspath), dirs, nondirs\n\n def walk(self, top, topdown=True, ignore_file_handler=None):\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/stage.py_Stage.is_cached_Stage.is_cached.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage.is_cached_Stage.is_cached.return.True", "embedding": null, "metadata": {"file_path": "dvc/stage.py", "file_name": "stage.py", "file_type": "text/x-python", "category": "implementation", "start_line": 368, "end_line": 411, "span_ids": ["Stage.is_cached"], "tokens": 337}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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 if old_d != new_d:\n return False\n\n # NOTE: committing to prevent potential data duplication. For example\n #\n # $ dvc config cache.type hardlink\n # $ echo foo > foo\n # $ dvc add foo\n # $ rm -f foo\n # $ echo foo > foo\n # $ dvc add foo # should replace foo with a link to cache\n #\n old.commit()\n\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py__Manages_state_database_StateBase.save_link.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py__Manages_state_database_StateBase.save_link.pass", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 42, "span_ids": ["StateBase.save_link", "docstring", "StateBase.save", "StateVersionTooNewError.__init__", "StateBase.get", "StateBase", "StateVersionTooNewError"], "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": "\"\"\"Manages state database used for checksum caching.\"\"\"\n\nfrom __future__ import unicode_literals\n\nimport os\nimport sqlite3\nimport logging\n\nfrom dvc.config import Config\nfrom dvc.utils import remove, current_timestamp, relpath, to_chunks\nfrom dvc.exceptions import DvcException\nfrom dvc.utils.fs import get_mtime_and_size, get_inode\nfrom dvc.utils.compat import fspath_py35\n\nSQLITE_MAX_VARIABLES_NUMBER = 999\n\nlogger = logging.getLogger(__name__)\n\n\nclass StateVersionTooNewError(DvcException):\n \"\"\"Thrown when dvc version is older than the state database version.\"\"\"\n\n def __init__(self, dvc_version, expected, actual):\n super(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\nclass StateBase(object):\n def save(self, path_info, checksum):\n pass\n\n def get(self, path_info):\n return None\n\n def save_link(self, path_info):\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State._file_metadata_changed_State._update_state_for_path_changed.self__execute_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State._file_metadata_changed_State._update_state_for_path_changed.self__execute_", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 279, "end_line": 309, "span_ids": ["State._update_state_record_timestamp_for_inode", "State._file_metadata_changed", "State._update_state_for_path_changed"], "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 State(StateBase):\n\n @staticmethod\n def _file_metadata_changed(actual_mtime, mtime, actual_size, size):\n return actual_mtime != mtime or actual_size != size\n\n def _update_state_record_timestamp_for_inode(self, actual_inode):\n cmd = \"UPDATE {} SET timestamp = ? WHERE inode = ?\".format(\n self.STATE_TABLE\n )\n self._execute(\n cmd, (current_timestamp(), self._to_sqlite(actual_inode))\n )\n\n def _update_state_for_path_changed(\n self, actual_inode, actual_mtime, actual_size, checksum\n ):\n cmd = (\n \"UPDATE {} SET \"\n \"mtime = ?, size = ?, \"\n \"md5 = ?, timestamp = ? \"\n \"WHERE inode = ?\"\n ).format(self.STATE_TABLE)\n self._execute(\n cmd,\n (\n actual_mtime,\n actual_size,\n checksum,\n current_timestamp(),\n self._to_sqlite(actual_inode),\n ),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State._insert_new_state_record_State.get_state_record_for_inode.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State._insert_new_state_record_State.get_state_record_for_inode.return.None", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 311, "end_line": 343, "span_ids": ["State.get_state_record_for_inode", "State._insert_new_state_record"], "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(StateBase):\n\n def _insert_new_state_record(\n self, actual_inode, actual_mtime, actual_size, checksum\n ):\n assert checksum is not None\n\n cmd = (\n \"INSERT INTO {}(inode, mtime, size, md5, timestamp) \"\n \"VALUES (?, ?, ?, ?, ?)\"\n ).format(self.STATE_TABLE)\n self._execute(\n cmd,\n (\n self._to_sqlite(actual_inode),\n actual_mtime,\n actual_size,\n checksum,\n current_timestamp(),\n ),\n )\n self.inserts += 1\n\n def get_state_record_for_inode(self, inode):\n cmd = (\n \"SELECT mtime, size, md5, timestamp from {} WHERE \"\n \"inode=?\".format(self.STATE_TABLE)\n )\n self._execute(cmd, (self._to_sqlite(inode),))\n results = self._fetchall()\n if results:\n # uniquness constrain on inode\n assert len(results) == 1\n return results[0]\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.save_State.save.self__update_state_for_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.save_State.save.self__update_state_for_pa", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 346, "end_line": 371, "span_ids": ["State.save"], "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 State(StateBase):\n\n def save(self, path_info, checksum):\n \"\"\"Save checksum for the specified path info.\n\n Args:\n path_info (dict): path_info to save checksum for.\n checksum (str): checksum to save.\n \"\"\"\n assert path_info.scheme == \"local\"\n assert checksum is not None\n\n path = fspath_py35(path_info)\n assert os.path.exists(path)\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 if not existing_record:\n self._insert_new_state_record(\n actual_inode, actual_mtime, actual_size, checksum\n )\n return\n\n self._update_state_for_path_changed(\n actual_inode, actual_mtime, actual_size, checksum\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.get_State.get.return.checksum": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.get_State.get.return.checksum", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 373, "end_line": 402, "span_ids": ["State.get"], "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 State(StateBase):\n\n def get(self, path_info):\n \"\"\"Gets the checksum for the specified path info. Checksum will be\n retrieved from the state database if available.\n\n Args:\n path_info (dict): path info to get the checksum for.\n\n Returns:\n str or None: checksum for the specified path info or None if it\n doesn't exist in the state database.\n \"\"\"\n assert path_info.scheme == \"local\"\n path = fspath_py35(path_info)\n\n if not os.path.exists(path):\n return None\n\n actual_mtime, actual_size = get_mtime_and_size(path)\n actual_inode = get_inode(path)\n\n existing_record = self.get_state_record_for_inode(actual_inode)\n if not existing_record:\n return None\n\n mtime, size, checksum, _ = existing_record\n if self._file_metadata_changed(actual_mtime, mtime, actual_size, size):\n return None\n\n self._update_state_record_timestamp_for_inode(actual_inode)\n return checksum", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater.fetch_Updater._is_outdated.return.parse_version_self_curren": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater.fetch_Updater._is_outdated.return.parse_version_self_curren", "embedding": null, "metadata": {"file_path": "dvc/updater.py", "file_name": "updater.py", "file_type": "text/x-python", "category": "implementation", "start_line": 72, "end_line": 96, "span_ids": ["Updater.fetch", "Updater._get_latest_version", "Updater._is_outdated"], "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 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 return parse_version(self.current) < parse_version(self.latest)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater._notify_Updater._notify.logger_info_boxify_messag": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/updater.py_Updater._notify_Updater._notify.logger_info_boxify_messag", "embedding": null, "metadata": {"file_path": "dvc/updater.py", "file_name": "updater.py", "file_type": "text/x-python", "category": "implementation", "start_line": 98, "end_line": 116, "span_ids": ["Updater._notify"], "tokens": 121}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Updater(object):\n\n def _notify(self):\n if not sys.stdout.isatty():\n return\n\n message = (\n \"Update available {red}{current}{reset} -> {green}{latest}{reset}\"\n + \"\\n\"\n + self._get_update_instructions()\n ).format(\n red=colorama.Fore.RED,\n reset=colorama.Fore.RESET,\n green=colorama.Fore.GREEN,\n yellow=colorama.Fore.YELLOW,\n blue=colorama.Fore.BLUE,\n current=self.current,\n latest=self.latest,\n )\n\n logger.info(boxify(message, border_color=\"yellow\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_move_to_yaml_string.return.stream_getvalue_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_move_to_yaml_string.return.stream_getvalue_", "embedding": null, "metadata": {"file_path": "dvc/utils/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 145, "end_line": 272, "span_ids": ["to_chunks", "is_binary", "fix_env", "from_yaml_string", "_split", "current_timestamp", "tmp_fname", "_to_chunks_by_chunks_number", "move", "remove", "_chmod", "convert_to_unicode", "to_yaml_string"], "tokens": 767}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 _chmod(func, p, excinfo):\n perm = os.lstat(p).st_mode\n perm |= stat.S_IWRITE\n\n try:\n os.chmod(p, perm)\n except OSError as exc:\n # broken symlink\n if exc.errno != errno.ENOENT:\n raise\n\n func(p)\n\n\ndef remove(path):\n logger.debug(\"Removing '{}'\".format(relpath(path)))\n\n try:\n if os.path.isdir(path):\n shutil.rmtree(path, onerror=_chmod)\n else:\n _chmod(os.unlink, path, None)\n except OSError as exc:\n if exc.errno != errno.ENOENT:\n raise\n\n\ndef _split(list_to_split, chunk_size):\n return [\n list_to_split[i : i + chunk_size]\n for i in range(0, len(list_to_split), chunk_size)\n ]\n\n\ndef _to_chunks_by_chunks_number(list_to_split, num_chunks):\n chunk_size = int(math.ceil(float(len(list_to_split)) / num_chunks))\n\n if len(list_to_split) == 1:\n return [list_to_split]\n\n if chunk_size == 0:\n chunk_size = 1\n\n return _split(list_to_split, chunk_size)\n\n\ndef to_chunks(list_to_split, num_chunks=None, chunk_size=None):\n if (num_chunks and chunk_size) or (not num_chunks and not chunk_size):\n raise ValueError(\n \"One and only one of 'num_chunks', 'chunk_size' must be defined\"\n )\n if chunk_size:\n return _split(list_to_split, chunk_size)\n return _to_chunks_by_chunks_number(list_to_split, num_chunks)\n\n\n# NOTE: Check if we are in a bundle\n# https://pythonhosted.org/PyInstaller/runtime-information.html\ndef is_binary():\n return getattr(sys, \"frozen\", False)\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 shortuuid import uuid\n\n return fspath(fname) + \".\" + str(uuid()) + \".tmp\"\n\n\ndef current_timestamp():\n return int(nanotime.timestamp(time.time()))\n\n\ndef from_yaml_string(s):\n return YAML().load(StringIO(s))\n\n\ndef to_yaml_string(data):\n stream = StringIO()\n yaml = YAML()\n yaml.default_flow_style = False\n yaml.dump(data, stream)\n return 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/dvc/utils/__init__.py_dvc_walk_dvc_walk.for_root_dirs_files_in_.yield_root_dirs_files": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_dvc_walk_dvc_walk.for_root_dirs_files_in_.yield_root_dirs_files", "embedding": null, "metadata": {"file_path": "dvc/utils/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 257, "end_line": 283, "span_ids": ["dvc_walk"], "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 dvc_walk(\n top,\n topdown=True,\n onerror=None,\n followlinks=False,\n ignore_file_handler=None,\n):\n \"\"\"\n Proxy for `os.walk` directory tree generator.\n Utilizes DvcIgnoreFilter functionality.\n \"\"\"\n ignore_filter = None\n if topdown:\n from dvc.ignore import DvcIgnoreFilter\n\n ignore_filter = DvcIgnoreFilter(\n top, ignore_file_handler=ignore_file_handler\n )\n\n for root, dirs, files in os.walk(\n top, topdown=topdown, onerror=onerror, followlinks=followlinks\n ):\n\n if ignore_filter:\n dirs[:], files[:] = ignore_filter(root, dirs, files)\n\n yield 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/utils/__init__.py_walk_files_colorize.return._color_message_nc_fo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_walk_files_colorize.return._color_message_nc_fo", "embedding": null, "metadata": {"file_path": "dvc/utils/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 293, "end_line": 315, "span_ids": ["walk_files", "colorize"], "tokens": 148}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def walk_files(directory, ignore_file_handler=None):\n for root, _, files in dvc_walk(\n directory, ignore_file_handler=ignore_file_handler\n ):\n for f in files:\n yield os.path.join(root, f)\n\n\ndef colorize(message, color=None):\n \"\"\"Returns a message in a specified color.\"\"\"\n if not color:\n return message\n\n colors = {\n \"green\": colorama.Fore.GREEN,\n \"yellow\": colorama.Fore.YELLOW,\n \"blue\": colorama.Fore.BLUE,\n \"red\": colorama.Fore.RED,\n }\n\n return \"{color}{message}{nc}\".format(\n color=colors.get(color, \"\"), message=message, nc=colorama.Fore.RESET\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_boxify_boxify.return.box_str": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py_boxify_boxify.return.box_str", "embedding": null, "metadata": {"file_path": "dvc/utils/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 311, "end_line": 355, "span_ids": ["boxify"], "tokens": 324}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def boxify(message, border_color=None):\n \"\"\"Put a message inside a box.\n\n Args:\n message (unicode): message to decorate.\n border_color (unicode): name of the color to outline the box with.\n \"\"\"\n lines = message.split(\"\\n\")\n max_width = max(_visual_width(line) for line in lines)\n\n padding_horizontal = 5\n padding_vertical = 1\n\n box_size_horizontal = max_width + (padding_horizontal * 2)\n\n chars = {\"corner\": \"+\", \"horizontal\": \"-\", \"vertical\": \"|\", \"empty\": \" \"}\n\n margin = \"{corner}{line}{corner}\\n\".format(\n corner=chars[\"corner\"], line=chars[\"horizontal\"] * box_size_horizontal\n )\n\n padding_lines = [\n \"{border}{space}{border}\\n\".format(\n border=colorize(chars[\"vertical\"], color=border_color),\n space=chars[\"empty\"] * box_size_horizontal,\n )\n * padding_vertical\n ]\n\n content_lines = [\n \"{border}{space}{content}{space}{border}\\n\".format(\n border=colorize(chars[\"vertical\"], color=border_color),\n space=chars[\"empty\"] * padding_horizontal,\n content=_visual_center(line, max_width),\n )\n for line in lines\n ]\n\n box_str = \"{margin}{padding}{content}{padding}{margin}\".format(\n margin=colorize(margin, color=border_color),\n padding=\"\".join(padding_lines),\n content=\"\".join(content_lines),\n )\n\n return box_str", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py__visual_width_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/__init__.py__visual_width_", "embedding": null, "metadata": {"file_path": "dvc/utils/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 376, "end_line": 402, "span_ids": ["_visual_center", "_visual_width", "relpath"], "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 _visual_width(line):\n \"\"\"Get the the number of columns required to display a string\"\"\"\n\n return len(re.sub(colorama.ansitowin32.AnsiToWin32.ANSI_CSI_RE, \"\", line))\n\n\ndef _visual_center(line, width):\n \"\"\"Center align string according to it's visual width\"\"\"\n\n spaces = max(width - _visual_width(line), 0)\n left_padding = int(spaces / 2)\n right_padding = spaces - left_padding\n\n return (left_padding * \" \") + line + (right_padding * \" \")\n\n\ndef relpath(path, start=os.curdir):\n path = fspath(path)\n start = os.path.abspath(fspath(start))\n\n # Windows path on different drive than curdir doesn't have relpath\n if os.name == \"nt\" and not os.path.commonprefix(\n [start, os.path.abspath(path)]\n ):\n return path\n return os.path.relpath(path, start)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/collections.py_from___future___import_ab_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/collections.py_from___future___import_ab_", "embedding": null, "metadata": {"file_path": "dvc/utils/collections.py", "file_name": "collections.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 50, "span_ids": ["imports", "apply_diff"], "tokens": 349}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import absolute_import, unicode_literals\nfrom dvc.utils.compat import Mapping\n\n\ndef apply_diff(src, dest):\n \"\"\"Recursively apply changes from src to dest.\n\n Preserves dest type and hidden info in dest structure,\n like ruamel.yaml leaves when parses files. This includes comments,\n ordering and line foldings.\n\n Used in Stage load/dump cycle to preserve comments and custom formatting.\n \"\"\"\n Seq = (list, tuple)\n Container = (Mapping, list, tuple)\n\n def is_same_type(a, b):\n return any(\n isinstance(a, t) and isinstance(b, t)\n for t in [str, Mapping, Seq, bool]\n )\n\n if isinstance(src, Mapping) and isinstance(dest, Mapping):\n for key, value in src.items():\n if isinstance(value, Container) and is_same_type(\n value, dest.get(key)\n ):\n apply_diff(value, dest[key])\n elif key not in dest or value != dest[key]:\n dest[key] = value\n for key in set(dest) - set(src):\n del dest[key]\n elif isinstance(src, Seq) and isinstance(dest, Seq):\n if len(src) != len(dest):\n dest[:] = src\n else:\n for i, value in enumerate(src):\n if isinstance(value, Container) and is_same_type(\n value, dest[i]\n ):\n apply_diff(value, dest[i])\n elif value != dest[i]:\n dest[i] = value\n else:\n raise AssertionError(\n \"Can't apply diff from {} to {}\".format(\n src.__class__.__name__, dest.__class__.__name__\n )\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/stage.py_from_dvc_utils_compat_imp_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/stage.py_from_dvc_utils_compat_imp_", "embedding": null, "metadata": {"file_path": "dvc/utils/stage.py", "file_name": "stage.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 27, "span_ids": ["load_stage_file", "imports", "dump_stage_file", "load_stage_fd"], "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": "from dvc.utils.compat import open\n\nfrom ruamel.yaml.error import YAMLError\nfrom ruamel.yaml import YAML\n\nfrom dvc.exceptions import StageFileCorruptedError\n\n\ndef load_stage_file(path):\n with open(path, \"r\", encoding=\"utf-8\") as fd:\n return load_stage_fd(fd, path)\n\n\ndef load_stage_fd(fd, path):\n try:\n yaml = YAML()\n return yaml.load(fd) or {}\n except YAMLError as exc:\n raise StageFileCorruptedError(path, cause=exc)\n\n\ndef dump_stage_file(path, data):\n with open(path, \"w\", encoding=\"utf-8\") as fd:\n yaml = YAML()\n yaml.default_flow_style = False\n yaml.dump(data, fd)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/version.py__Used_in_setup_py_so_do__generate_version.return._base_version_short_sh": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/version.py__Used_in_setup_py_so_do__generate_version.return._base_version_short_sh", "embedding": null, "metadata": {"file_path": "dvc/version.py", "file_name": "version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 27, "span_ids": ["_generate_version", "docstring"], "tokens": 207}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Used in setup.py, so don't pull any additional dependencies\n#\n# Based on:\n# - https://github.com/python/mypy/blob/master/mypy/version.py\n# - https://github.com/python/mypy/blob/master/mypy/git.py\nimport os\nimport subprocess\n\n\n_BASE_VERSION = \"0.51.2\"\n\n\ndef _generate_version(base_version):\n \"\"\"Generate a version with information about the git repository\"\"\"\n pkg_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))\n\n if not _is_git_repo(pkg_dir) or not _have_git():\n return base_version\n\n if _is_release(pkg_dir, base_version) and not _is_dirty(pkg_dir):\n return base_version\n\n return \"{base_version}+{short_sha}{dirty}\".format(\n base_version=base_version,\n short_sha=_git_revision(pkg_dir).decode(\"utf-8\")[0:6],\n dirty=\".mod\" if _is_dirty(pkg_dir) else \"\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/version.py__is_git_repo_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/version.py__is_git_repo_", "embedding": null, "metadata": {"file_path": "dvc/version.py", "file_name": "version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 30, "end_line": 76, "span_ids": ["_have_git", "_is_dirty", "_is_release", "impl:3", "_git_revision", "_is_git_repo"], "tokens": 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": "def _is_git_repo(dir_path):\n \"\"\"Is the given directory version-controlled with git?\"\"\"\n return os.path.exists(os.path.join(dir_path, \".git\"))\n\n\ndef _have_git():\n \"\"\"Can we run the git executable?\"\"\"\n try:\n subprocess.check_output([\"git\", \"--help\"])\n return True\n except subprocess.CalledProcessError:\n return False\n except OSError:\n return False\n\n\ndef _is_release(dir_path, base_version):\n try:\n output = subprocess.check_output(\n [\"git\", \"describe\", \"--tags\", \"--exact-match\"],\n cwd=dir_path,\n stderr=subprocess.STDOUT,\n ).decode(\"utf-8\")\n tag = output.strip()\n return tag == base_version\n except subprocess.CalledProcessError:\n return False\n\n\ndef _git_revision(dir_path):\n \"\"\"Get the SHA-1 of the HEAD of a git repository.\"\"\"\n return subprocess.check_output(\n [\"git\", \"rev-parse\", \"HEAD\"], cwd=dir_path\n ).strip()\n\n\ndef _is_dirty(dir_path):\n \"\"\"Check whether a git repository has uncommitted changes.\"\"\"\n try:\n subprocess.check_call([\"git\", \"diff\", \"--quiet\"], cwd=dir_path)\n return False\n except subprocess.CalledProcessError:\n return True\n\n\n__version__ = _generate_version(_BASE_VERSION)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_from___future___import_un_from_tests_utils_import_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_from___future___import_un_from_tests_utils_import_s", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 28, "span_ids": ["imports"], "tokens": 161}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import unicode_literals\n\nimport os\n\nimport pytest\n\nimport dvc\nimport time\nimport shutil\nimport filecmp\nimport posixpath\nimport logging\nimport colorama\n\nfrom dvc.system import System\nfrom mock import patch\n\nfrom dvc.main import main\nfrom dvc.utils import file_md5, LARGE_DIR_SIZE, relpath\nfrom dvc.utils.stage import load_stage_file\nfrom dvc.utils.compat import range\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, TestDvcGit\nfrom tests.utils import spy, get_gitignore_content", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_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/func/test_add.py_TestAdd_TestAdd.test_unicode.self_assertTrue_os_path_i", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 26, "end_line": 51, "span_ids": ["TestAdd.test_unicode", "TestAdd", "TestAdd.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 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 self.assertEqual(stage.md5, \"ee343f2482f53efffc109be83cc976ac\")\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/func/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/func/test_add.py_TestAddDirWithExistingCache_TestAddDirWithExistingCache.test.None_5", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 114, "end_line": 126, "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/func/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/func/test_add.py_TestAddModifiedDir_TestAddFileInDir.test.self_assertEqual_stage_re", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 129, "end_line": 151, "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/func/test_add.py_TestAddExternalLocalFile_TestAddExternalLocalFile.test.self_assertTrue_filecmp_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddExternalLocalFile_TestAddExternalLocalFile.test.self_assertTrue_filecmp_c", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 154, "end_line": 169, "span_ids": ["TestAddExternalLocalFile.test", "TestAddExternalLocalFile"], "tokens": 151}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestAddExternalLocalFile(TestDvc):\n def test(self):\n dname = TestDvc.mkdtemp()\n fname = os.path.join(dname, \"foo\")\n shutil.copyfile(self.FOO, fname)\n\n stages = self.dvc.add(fname)\n self.assertEqual(len(stages), 1)\n stage = stages[0]\n self.assertNotEqual(stage, None)\n self.assertEqual(len(stage.deps), 0)\n self.assertEqual(len(stage.outs), 1)\n self.assertEqual(stage.relpath, \"foo.dvc\")\n self.assertEqual(len(os.listdir(dname)), 1)\n self.assertTrue(os.path.isfile(fname))\n self.assertTrue(filecmp.cmp(fname, \"foo\", shallow=False))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddLocalRemoteFile_TestAddLocalRemoteFile.test.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddLocalRemoteFile_TestAddLocalRemoteFile.test.None_4", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 172, "end_line": 197, "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/func/test_add.py_TestCmdAdd_TestDoubleAddUnchanged.test_dir.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestCmdAdd_TestDoubleAddUnchanged.test_dir.None_1", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 200, "end_line": 222, "span_ids": ["TestCmdAdd.test", "TestDoubleAddUnchanged.test_file", "TestDoubleAddUnchanged", "TestDoubleAddUnchanged.test_dir", "TestCmdAdd"], "tokens": 151}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCmdAdd(TestDvc):\n def test(self):\n ret = main([\"add\", self.FOO])\n self.assertEqual(ret, 0)\n\n ret = main([\"add\", \"non-existing-file\"])\n self.assertNotEqual(ret, 0)\n\n\nclass TestDoubleAddUnchanged(TestDvc):\n def test_file(self):\n ret = main([\"add\", self.FOO])\n self.assertEqual(ret, 0)\n\n ret = main([\"add\", self.FOO])\n self.assertEqual(ret, 0)\n\n def test_dir(self):\n ret = main([\"add\", self.DATA_DIR])\n self.assertEqual(ret, 0)\n\n ret = main([\"add\", self.DATA_DIR])\n self.assertEqual(ret, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddCommit_TestAddCommit.test.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddCommit_TestAddCommit.test.None_5", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 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/func/test_add.py_TestShouldCollectDirCacheOnlyOnce_TestShouldCollectDirCacheOnlyOnce.test.self_assertEqual_1_get_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestShouldCollectDirCacheOnlyOnce_TestShouldCollectDirCacheOnlyOnce.test.self_assertEqual_1_get_d", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 304, "end_line": 320, "span_ids": ["TestShouldCollectDirCacheOnlyOnce", "TestShouldCollectDirCacheOnlyOnce.test"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShouldCollectDirCacheOnlyOnce(TestDvc):\n def test(self):\n from dvc.remote.local import RemoteLOCAL\n\n get_dir_checksum_counter = spy(RemoteLOCAL.get_dir_checksum)\n with patch.object(\n RemoteLOCAL, \"get_dir_checksum\", get_dir_checksum_counter\n ):\n ret = main([\"add\", self.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, get_dir_checksum_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/func/test_add.py_SymlinkAddTestBase_SymlinkAddTestBase._test.self_assertEqual_relative": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_SymlinkAddTestBase_SymlinkAddTestBase._test.self_assertEqual_relative", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 323, "end_line": 351, "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/func/test_add.py_TestShouldAddDataFromExternalSymlink_TestShouldPlaceStageInDataDirIfRepositoryBelowSymlink.test.with_patch_object_.self_assertTrue_os_path_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestShouldAddDataFromExternalSymlink_TestShouldPlaceStageInDataDirIfRepositoryBelowSymlink.test.with_patch_object_.self_assertTrue_os_path_e", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 354, "end_line": 392, "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/func/test_add.py_TestShouldThrowProperExceptionOnCorruptedStageFile_TestShouldThrowProperExceptionOnCorruptedStageFile.test.assert_expected_error_in_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestShouldThrowProperExceptionOnCorruptedStageFile_TestShouldThrowProperExceptionOnCorruptedStageFile.test.assert_expected_error_in_", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 420, "end_line": 441, "span_ids": ["TestShouldThrowProperExceptionOnCorruptedStageFile", "TestShouldThrowProperExceptionOnCorruptedStageFile.test"], "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 TestShouldThrowProperExceptionOnCorruptedStageFile(TestDvc):\n def test(self):\n ret = main([\"add\", self.FOO])\n assert 0 == ret\n\n foo_stage = 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 self._caplog.clear()\n\n ret = main([\"add\", self.BAR])\n assert 1 == ret\n\n expected_error = (\n \"unable to read DVC-file: {} \"\n \"YAML file structure is corrupted\".format(foo_stage)\n )\n\n assert expected_error in self._caplog.text", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddFilename_TestAddFilename.test.None_10": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddFilename_TestAddFilename.test.None_10", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 419, "end_line": 444, "span_ids": ["TestAddFilename", "TestAddFilename.test"], "tokens": 251}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestAddFilename(TestDvc):\n def test(self):\n ret = main([\"add\", self.FOO, self.BAR, \"-f\", \"error.dvc\"])\n self.assertNotEqual(0, ret)\n\n ret = main([\"add\", \"-R\", self.DATA_DIR, \"-f\", \"error.dvc\"])\n self.assertNotEqual(0, ret)\n\n with self.assertRaises(RecursiveAddingWhileUsingFilename):\n self.dvc.add(self.DATA_DIR, recursive=True, fname=\"error.dvc\")\n\n ret = main([\"add\", self.DATA_DIR, \"-f\", \"data_directory.dvc\"])\n self.assertEqual(0, ret)\n self.assertTrue(os.path.exists(\"data_directory.dvc\"))\n\n ret = main([\"add\", self.FOO, \"-f\", \"bar.dvc\"])\n self.assertEqual(0, ret)\n self.assertTrue(os.path.exists(\"bar.dvc\"))\n self.assertFalse(os.path.exists(\"foo.dvc\"))\n\n os.remove(\"bar.dvc\")\n\n ret = main([\"add\", self.FOO, \"--file\", \"bar.dvc\"])\n self.assertEqual(0, ret)\n self.assertTrue(os.path.exists(\"bar.dvc\"))\n self.assertFalse(os.path.exists(\"foo.dvc\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_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/func/test_add.py_TestShouldCleanUpAfterFailedAdd_TestShouldCleanUpAfterFailedAdd.test.self_assertNotIn_se", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 472, "end_line": 490, "span_ids": ["TestShouldCleanUpAfterFailedAdd.test", "TestShouldCleanUpAfterFailedAdd"], "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 TestShouldCleanUpAfterFailedAdd(TestDvcGit):\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\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/func/test_add.py_TestShouldNotTrackGitInternalFiles_TestShouldNotTrackGitInternalFiles.test.for_fname_in_created_stag.self_assertNotIn_git_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestShouldNotTrackGitInternalFiles_TestShouldNotTrackGitInternalFiles.test.for_fname_in_created_stag.self_assertNotIn_git_", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 467, "end_line": 477, "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/func/test_add.py_TestAddUnprotected_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddUnprotected_", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 527, "end_line": 557, "span_ids": ["TestAddUnprotected.test", "test_windows_should_add_when_cache_on_different_drive", "TestAddUnprotected"], "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 TestAddUnprotected(TestDvc):\n def test(self):\n ret = main([\"config\", \"cache.type\", \"hardlink\"])\n self.assertEqual(ret, 0)\n\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 ret = main([\"unprotect\", self.FOO])\n self.assertEqual(ret, 0)\n\n ret = main([\"add\", self.FOO])\n self.assertEqual(ret, 0)\n\n self.assertFalse(os.access(self.FOO, os.W_OK))\n self.assertTrue(System.is_hardlink(self.FOO))\n\n\n@pytest.mark.skipif(os.name != \"nt\", reason=\"Windows specific\")\ndef test_windows_should_add_when_cache_on_different_drive(\n dvc_repo, repo_dir, temporary_windows_drive\n):\n ret = main([\"config\", \"cache.dir\", temporary_windows_drive])\n assert ret == 0\n\n ret = main([\"add\", repo_dir.DATA])\n assert ret == 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_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/func/test_analytics.py_os_TestAnalytics.test_send.self_assertTrue_mockpost_", "embedding": null, "metadata": {"file_path": "tests/func/test_analytics.py", "file_name": "test_analytics.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 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/func/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/func/test_analytics.py_TestAnalytics.test_send_failed_TestAnalytics.test_send_failed.self_assertTrue_mockpost_", "embedding": null, "metadata": {"file_path": "tests/func/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/func/test_analytics.py_TestAnalyticsGit_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_analytics.py_TestAnalyticsGit_", "embedding": null, "metadata": {"file_path": "tests/func/test_analytics.py", "file_name": "test_analytics.py", "file_type": "text/x-python", "category": "test", "start_line": 54, "end_line": 69, "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/func/test_cache.py_os_TestCache.test_get.self_assertEqual_cache_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cache.py_os_TestCache.test_get.self_assertEqual_cache_s", "embedding": null, "metadata": {"file_path": "tests/func/test_cache.py", "file_name": "test_cache.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 38, "span_ids": ["TestCache.test_get", "imports", "TestCache.setUp", "TestCache", "TestCache.test_all"], "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": "import os\nimport shutil\nimport configobj\n\nfrom dvc.cache import Cache\nfrom dvc.main import main\nfrom dvc.utils import relpath\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/func/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/func/test_cache.py_TestCacheLoadBadDirCache_TestCacheLoadBadDirCache.test.None_3", "embedding": null, "metadata": {"file_path": "tests/func/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/func/test_cache.py_TestExternalCacheDir_TestExternalCacheDir.test_remote_references.assert_self_dvc_cache_ssh": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cache.py_TestExternalCacheDir_TestExternalCacheDir.test_remote_references.assert_self_dvc_cache_ssh", "embedding": null, "metadata": {"file_path": "tests/func/test_cache.py", "file_name": "test_cache.py", "file_type": "text/x-python", "category": "test", "start_line": 55, "end_line": 81, "span_ids": ["TestExternalCacheDir.test_remote_references", "TestExternalCacheDir.test", "TestExternalCacheDir"], "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 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)\n\n def test_remote_references(self):\n ssh_url = \"ssh://user@localhost:23\"\n assert main([\"remote\", \"add\", \"storage\", ssh_url]) == 0\n assert main([\"remote\", \"add\", \"cache\", \"remote://storage/tmp\"]) == 0\n assert main([\"config\", \"cache.ssh\", \"cache\"]) == 0\n\n self.dvc.__init__()\n\n assert self.dvc.cache.ssh.path_info == ssh_url + \"/tmp\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cache.py_TestSharedCacheDir_TestSharedCacheDir.test.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cache.py_TestSharedCacheDir_TestSharedCacheDir.test.None_5", "embedding": null, "metadata": {"file_path": "tests/func/test_cache.py", "file_name": "test_cache.py", "file_type": "text/x-python", "category": "test", "start_line": 83, "end_line": 127, "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/func/test_cache.py_TestCacheLinkType_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cache.py_TestCacheLinkType_", "embedding": null, "metadata": {"file_path": "tests/func/test_cache.py", "file_name": "test_cache.py", "file_type": "text/x-python", "category": "test", "start_line": 132, "end_line": 178, "span_ids": ["TestShouldCacheBeReflinkOrCopyByDefault.test", "TestCmdCacheDir", "TestCacheLinkType", "TestCacheLinkType.test", "TestCmdCacheDir.test_relative_path", "TestCmdCacheDir.test_abs_path", "TestShouldCacheBeReflinkOrCopyByDefault", "TestCmdCacheDir.test"], "tokens": 380}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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 = 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)\n\n\nclass TestShouldCacheBeReflinkOrCopyByDefault(TestDvc):\n def test(self):\n self.assertEqual(self.dvc.cache.local.cache_types, [\"reflink\", \"copy\"])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_os_logger.logging_getLogger_dvc_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_os_logger.logging_getLogger_dvc_", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 31, "span_ids": ["imports"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport sys\nimport re\n\nimport shutil\nimport filecmp\nimport collections\nimport logging\n\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, relpath\nfrom dvc.utils.stage import load_stage_file, dump_stage_file\nfrom dvc.utils.compat import is_py2\nfrom tests.basic_env import TestDvc, TestDvcGit\nfrom tests.func.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\n\n\nlogger = logging.getLogger(\"dvc\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckout_TestCheckout._test_checkout.self_assertTrue_filecmp_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckout_TestCheckout._test_checkout.self_assertTrue_filecmp_c", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 33, "end_line": 56, "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/func/test_checkout.py_TestCheckoutSingleStage_TestCheckoutCorruptedCacheFile.test.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutSingleStage_TestCheckoutCorruptedCacheFile.test.None_2", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 59, "end_line": 80, "span_ids": ["TestCheckoutCorruptedCacheFile", "TestCheckoutCorruptedCacheFile.test", "TestCheckoutSingleStage", "TestCheckoutSingleStage.test"], "tokens": 140}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCheckoutSingleStage(TestCheckout):\n def test(self):\n ret = main([\"checkout\", \"--force\", self.foo_stage.path])\n self.assertEqual(ret, 0)\n\n ret = main([\"checkout\", \"--force\", self.data_dir_stage.path])\n self.assertEqual(ret, 0)\n\n self._test_checkout()\n\n\nclass TestCheckoutCorruptedCacheFile(TestRepro):\n def test(self):\n cache = self.foo_stage.outs[0].cache_path\n\n 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/func/test_checkout.py_TestCheckoutCorruptedCacheDir_TestCheckoutCorruptedCacheDir.test.self_assertFalse_os_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutCorruptedCacheDir_TestCheckoutCorruptedCacheDir.test.self_assertFalse_os_path_", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 83, "end_line": 106, "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/func/test_checkout.py_TestCmdCheckout_CheckoutBase.outs_info.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCmdCheckout_CheckoutBase.outs_info.return._", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 110, "end_line": 144, "span_ids": ["TestCmdCheckout", "CheckoutBase", "CheckoutBase.outs_info", "CheckoutBase.commit_data_file", "TestCmdCheckout.test", "CheckoutBase.read_ignored"], "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": "class TestCmdCheckout(TestCheckout):\n def test(self):\n ret = main([\"checkout\", \"--force\"])\n self.assertEqual(ret, 0)\n self._test_checkout()\n\n\nclass CheckoutBase(TestDvcGit):\n GIT_IGNORE = \".gitignore\"\n\n def commit_data_file(self, fname, content=\"random text\"):\n with open(fname, \"w\") as fd:\n fd.write(content)\n stages = self.dvc.add(fname)\n self.assertEqual(len(stages), 1)\n self.assertTrue(stages[0] is not None)\n self.dvc.scm.add([fname + \".dvc\", \".gitignore\"])\n self.dvc.scm.commit(\"adding \" + fname)\n\n def read_ignored(self):\n with open(self.GIT_IGNORE) as f:\n return [s.strip(\"\\n\") for s in f.readlines()]\n\n def outs_info(self, stage):\n FileInfo = collections.namedtuple(\"FileInfo\", \"path inode\")\n\n paths = [\n path\n for output in stage[\"outs\"]\n for path in walk_files(output[\"path\"])\n ]\n\n return [\n FileInfo(path=path, inode=System.inode(path)) for path in paths\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestRemoveFilesWhenCheckout_TestRemoveFilesWhenCheckout.test.self_assertFalse_os_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestRemoveFilesWhenCheckout_TestRemoveFilesWhenCheckout.test.self_assertFalse_os_path_", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 147, "end_line": 170, "span_ids": ["TestRemoveFilesWhenCheckout.test", "TestRemoveFilesWhenCheckout"], "tokens": 190}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRemoveFilesWhenCheckout(CheckoutBase):\n def test(self):\n fname = \"file_in_a_branch\"\n branch_master = \"master\"\n branch_1 = \"b1\"\n\n self.dvc.scm.add(self.dvc.scm.untracked_files())\n self.dvc.scm.commit(\"add all files\")\n\n # add the file into a separate branch\n self.dvc.scm.checkout(branch_1, True)\n ret = main([\"checkout\", \"--force\"])\n self.assertEqual(ret, 0)\n self.commit_data_file(fname)\n\n # Checkout back in master\n self.dvc.scm.checkout(branch_master)\n self.assertTrue(os.path.exists(fname))\n\n # Make sure `dvc checkout` removes the file\n # self.dvc.checkout()\n ret = main([\"checkout\", \"--force\"])\n self.assertEqual(ret, 0)\n self.assertFalse(os.path.exists(fname))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutCleanWorkingDir_TestCheckoutCleanWorkingDir.test.self_assertFalse_os_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutCleanWorkingDir_TestCheckoutCleanWorkingDir.test.self_assertFalse_os_path_", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 173, "end_line": 187, "span_ids": ["TestCheckoutCleanWorkingDir.test", "TestCheckoutCleanWorkingDir"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCheckoutCleanWorkingDir(CheckoutBase):\n @patch(\"dvc.prompt.confirm\", return_value=True)\n def test(self, mock_prompt):\n mock_prompt.return_value = True\n\n stages = self.dvc.add(self.DATA_DIR)\n stage = stages[0]\n\n working_dir_change = os.path.join(self.DATA_DIR, \"not_cached.txt\")\n with open(working_dir_change, \"w\") as f:\n f.write(\"not_cached\")\n\n ret = main([\"checkout\", stage.relpath])\n self.assertEqual(ret, 0)\n self.assertFalse(os.path.exists(working_dir_change))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutCleanWorkingDir.test_force_TestCheckoutCleanWorkingDir.test_force.self_assertRaises_DvcExce": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutCleanWorkingDir.test_force_TestCheckoutCleanWorkingDir.test_force.self_assertRaises_DvcExce", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 189, "end_line": 206, "span_ids": ["TestCheckoutCleanWorkingDir.test_force"], "tokens": 149}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCheckoutCleanWorkingDir(CheckoutBase):\n\n @patch(\"dvc.prompt.confirm\", return_value=False)\n def test_force(self, mock_prompt):\n mock_prompt.return_value = False\n\n stages = self.dvc.add(self.DATA_DIR)\n self.assertEqual(len(stages), 1)\n stage = stages[0]\n\n working_dir_change = os.path.join(self.DATA_DIR, \"not_cached.txt\")\n with open(working_dir_change, \"w\") as f:\n f.write(\"not_cached\")\n\n ret = main([\"checkout\", stage.relpath])\n self.assertNotEqual(ret, 0)\n\n mock_prompt.assert_called()\n self.assertNotEqual(ret, 0)\n self.assertRaises(DvcException)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutSelectiveRemove_TestCheckoutSelectiveRemove.test.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutSelectiveRemove_TestCheckoutSelectiveRemove.test.None_7", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 209, "end_line": 235, "span_ids": ["TestCheckoutSelectiveRemove.test", "TestCheckoutSelectiveRemove"], "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 TestCheckoutSelectiveRemove(CheckoutBase):\n def test(self):\n # Use copy to test for changes in the inodes\n ret = main([\"config\", \"cache.type\", \"copy\"])\n self.assertEqual(ret, 0)\n\n ret = main([\"add\", self.DATA_DIR])\n self.assertEqual(0, ret)\n\n stage_path = self.DATA_DIR + Stage.STAGE_FILE_SUFFIX\n stage = load_stage_file(stage_path)\n staged_files = self.outs_info(stage)\n\n # move instead of remove, to lock inode assigned to stage_files[0].path\n # if we were to use remove, we might end up with same inode assigned to\n # newly checked out file\n shutil.move(staged_files[0].path, \"random_name\")\n\n ret = main([\"checkout\", \"--force\", stage_path])\n self.assertEqual(ret, 0)\n\n checkedout_files = self.outs_info(stage)\n\n self.assertEqual(len(staged_files), len(checkedout_files))\n self.assertEqual(staged_files[0].path, checkedout_files[0].path)\n self.assertNotEqual(staged_files[0].inode, checkedout_files[0].inode)\n self.assertEqual(staged_files[1].inode, checkedout_files[1].inode)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestGitIgnoreBasic_TestGitIgnoreBasic.test.None_9": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestGitIgnoreBasic_TestGitIgnoreBasic.test.None_9", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 238, "end_line": 264, "span_ids": ["TestGitIgnoreBasic.test", "TestGitIgnoreBasic"], "tokens": 191}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestGitIgnoreBasic(CheckoutBase):\n def test(self):\n fname1 = \"file_1\"\n fname2 = \"file_2\"\n fname3 = \"file_3\"\n\n self.dvc.scm.add(self.dvc.scm.untracked_files())\n self.dvc.scm.commit(\"add all files\")\n\n self.assertFalse(os.path.exists(self.GIT_IGNORE))\n\n self.commit_data_file(fname1)\n self.commit_data_file(fname2)\n self.dvc.run(\n cmd=\"python {} {} {}\".format(self.CODE, self.FOO, fname3),\n deps=[self.CODE, self.FOO],\n outs_no_cache=[fname3],\n )\n\n self.assertTrue(os.path.exists(self.GIT_IGNORE))\n\n ignored = self.read_ignored()\n\n self.assertEqual(len(ignored), 2)\n\n self.assertIn(\"/\" + fname1, ignored)\n self.assertIn(\"/\" + fname2, ignored)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestGitIgnoreWhenCheckout_TestGitIgnoreWhenCheckout.test.None_12": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestGitIgnoreWhenCheckout_TestGitIgnoreWhenCheckout.test.None_12", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 267, "end_line": 296, "span_ids": ["TestGitIgnoreWhenCheckout.test", "TestGitIgnoreWhenCheckout"], "tokens": 234}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestGitIgnoreWhenCheckout(CheckoutBase):\n def test(self):\n fname_master = \"file_in_a_master\"\n branch_master = \"master\"\n fname_branch = \"file_in_a_branch\"\n branch_1 = \"b1\"\n\n self.dvc.scm.add(self.dvc.scm.untracked_files())\n self.dvc.scm.commit(\"add all files\")\n self.commit_data_file(fname_master)\n\n self.dvc.scm.checkout(branch_1, True)\n ret = main([\"checkout\", \"--force\"])\n self.assertEqual(ret, 0)\n self.commit_data_file(fname_branch)\n\n self.dvc.scm.checkout(branch_master)\n ret = main([\"checkout\", \"--force\"])\n self.assertEqual(ret, 0)\n\n ignored = self.read_ignored()\n\n self.assertEqual(len(ignored), 1)\n self.assertIn(\"/\" + fname_master, ignored)\n\n self.dvc.scm.checkout(branch_1)\n ret = main([\"checkout\", \"--force\"])\n self.assertEqual(ret, 0)\n ignored = self.read_ignored()\n self.assertIn(\"/\" + fname_branch, ignored)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutMissingMd5InStageFile_TestCheckoutEmptyDir.test.self_assertEqual_len_os_l": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutMissingMd5InStageFile_TestCheckoutEmptyDir.test.self_assertEqual_len_os_l", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 299, "end_line": 326, "span_ids": ["TestCheckoutMissingMd5InStageFile.test", "TestCheckoutEmptyDir.test", "TestCheckoutEmptyDir", "TestCheckoutMissingMd5InStageFile"], "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 TestCheckoutMissingMd5InStageFile(TestRepro):\n def test(self):\n d = load_stage_file(self.file1_stage)\n del d[Stage.PARAM_OUTS][0][RemoteLOCAL.PARAM_CHECKSUM]\n del d[Stage.PARAM_DEPS][0][RemoteLOCAL.PARAM_CHECKSUM]\n dump_stage_file(self.file1_stage, d)\n\n 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/func/test_checkout.py_TestCheckoutNotCachedFile_TestCheckoutDirectory.test.self_assertTrue_os_path_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutNotCachedFile_TestCheckoutDirectory.test.self_assertTrue_os_path_e", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 329, "end_line": 367, "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/func/test_checkout.py_TestCheckoutHook_TestCheckoutHook.test.with_self_assertRaises_Co.self_dvc_checkout_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutHook_TestCheckoutHook.test.with_self_assertRaises_Co.self_dvc_checkout_", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 370, "end_line": 385, "span_ids": ["TestCheckoutHook", "TestCheckoutHook.test"], "tokens": 145}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCheckoutHook(TestDvc):\n @patch(\"sys.stdout.isatty\", return_value=True)\n @patch(\"dvc.prompt.input\", side_effect=EOFError)\n def test(self, mock_input, mock_isatty):\n \"\"\" Test that dvc checkout handles EOFError gracefully, which is what\n it will experience when running in a git hook.\n \"\"\"\n stages = self.dvc.add(self.DATA_DIR)\n self.assertEqual(len(stages), 1)\n stage = stages[0]\n self.assertNotEqual(stage, None)\n\n self.create(os.path.join(self.DATA_DIR, \"test\"), \"test\")\n\n with self.assertRaises(ConfirmRemoveError):\n self.dvc.checkout()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_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/func/test_checkout.py_TestCheckoutSuggestGit_TestCheckoutSuggestGit.test.None_1.except_DvcException_as_ex.self_assertIsNone_exc_cau", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 388, "end_line": 403, "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/func/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/func/test_checkout.py_TestCheckoutShouldHaveSelfClearingProgressBar_TestCheckoutShouldHaveSelfClearingProgressBar.test.self_assertTrue_finish_ba", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 405, "end_line": 448, "span_ids": ["TestCheckoutShouldHaveSelfClearingProgressBar.setUp", "TestCheckoutShouldHaveSelfClearingProgressBar.test", "TestCheckoutShouldHaveSelfClearingProgressBar"], "tokens": 436}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCheckoutShouldHaveSelfClearingProgressBar(TestDvc):\n def setUp(self):\n super(TestCheckoutShouldHaveSelfClearingProgressBar, self).setUp()\n self._prepare_repo()\n\n def test(self):\n with self._caplog.at_level(logging.INFO, logger=\"dvc\"), 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 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 pattern = re.compile(\".*\\\\[.{30}\\\\].*%.*\")\n progress_bars = [\n arg\n for arg in self.write_args\n if pattern.match(arg) and \"unpacked\" not in arg\n ]\n\n update_bars = progress_bars[:-1]\n finish_bar = progress_bars[-1]\n\n self.assertEqual(4, len(update_bars))\n assert re.search(\".*\\\\[#{7} {23}\\\\] 25%.*\", progress_bars[0])\n assert re.search(\".*\\\\[#{15} {15}\\\\] 50%.*\", progress_bars[1])\n assert re.search(\".*\\\\[#{22} {8}\\\\] 75%.*\", progress_bars[2])\n assert re.search(\".*\\\\[#{30}\\\\] 100%.*\", progress_bars[3])\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/func/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/func/test_checkout.py_TestCheckoutShouldHaveSelfClearingProgressBar.filter_out_empty_write_calls_TestCheckoutShouldHaveSelfClearingProgressBar._prepare_repo.os_unlink_self_BAR_", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 447, "end_line": 480, "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/func/test_checkout.py_TestCheckoutShouldHaveSelfClearingProgressBar.assertCaretReturnFollowsEach_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/func/test_checkout.py_TestCheckoutShouldHaveSelfClearingProgressBar.assertCaretReturnFollowsEach_TestCheckoutShouldHaveSelfClearingProgressBar.assertAnyEndsWith.self_assertTrue_any_ub_fo", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 482, "end_line": 501, "span_ids": ["TestCheckoutShouldHaveSelfClearingProgressBar.assertAnyEndsWith", "TestCheckoutShouldHaveSelfClearingProgressBar.assertCaretReturnFollowsEach", "TestCheckoutShouldHaveSelfClearingProgressBar.assertNewLineFollows"], "tokens": 172}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCheckoutShouldHaveSelfClearingProgressBar(TestDvc):\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/func/test_checkout.py_TestCheckoutMovedCacheDirWithSymlinks_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutMovedCacheDirWithSymlinks_", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 531, "end_line": 584, "span_ids": ["TestCheckoutMovedCacheDirWithSymlinks.test", "test_checkout_no_checksum", "TestCheckoutMovedCacheDirWithSymlinks"], "tokens": 394}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCheckoutMovedCacheDirWithSymlinks(TestDvc):\n def test(self):\n ret = main([\"config\", \"cache.type\", \"symlink\"])\n self.assertEqual(ret, 0)\n\n ret = main([\"add\", self.FOO])\n self.assertEqual(ret, 0)\n\n ret = main([\"add\", self.DATA_DIR])\n self.assertEqual(ret, 0)\n\n if os.name == \"nt\" and is_py2:\n from jaraco.windows.filesystem import readlink\n else:\n readlink = os.readlink\n\n self.assertTrue(System.is_symlink(self.FOO))\n old_foo_link = readlink(self.FOO)\n\n self.assertTrue(System.is_symlink(self.DATA))\n old_data_link = readlink(self.DATA)\n\n old_cache_dir = self.dvc.cache.local.cache_dir\n new_cache_dir = old_cache_dir + \"_new\"\n os.rename(old_cache_dir, new_cache_dir)\n\n ret = main([\"cache\", \"dir\", new_cache_dir])\n self.assertEqual(ret, 0)\n\n ret = main([\"checkout\", \"-f\"])\n self.assertEqual(ret, 0)\n\n self.assertTrue(System.is_symlink(self.FOO))\n new_foo_link = readlink(self.FOO)\n\n self.assertTrue(System.is_symlink(self.DATA))\n new_data_link = readlink(self.DATA)\n\n self.assertEqual(\n relpath(old_foo_link, old_cache_dir),\n relpath(new_foo_link, new_cache_dir),\n )\n\n self.assertEqual(\n relpath(old_data_link, old_cache_dir),\n relpath(new_data_link, new_cache_dir),\n )\n\n\ndef test_checkout_no_checksum(repo_dir, dvc_repo):\n stage = dvc_repo.run(outs=[repo_dir.FOO], no_exec=True, cmd=\"somecmd\")\n dvc_repo.checkout(stage.path, force=True)\n assert not os.path.exists(repo_dir.FOO)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cli.py_os_TestArgParse.test.self_assertIsInstance_arg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cli.py_os_TestArgParse.test.self_assertIsInstance_arg", "embedding": null, "metadata": {"file_path": "tests/func/test_cli.py", "file_name": "test_cli.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 23, "span_ids": ["imports", "TestArgParse", "TestArgParse.test"], "tokens": 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/func/test_cli.py_TestRun_TestRun.test.self_assertEqual_args_com": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cli.py_TestRun_TestRun.test.self_assertEqual_args_com", "embedding": null, "metadata": {"file_path": "tests/func/test_cli.py", "file_name": "test_cli.py", "file_type": "text/x-python", "category": "test", "start_line": 26, "end_line": 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/func/test_cli.py_TestPull_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_cli.py_TestPull_", "embedding": null, "metadata": {"file_path": "tests/func/test_cli.py", "file_name": "test_cli.py", "file_type": "text/x-python", "category": "test", "start_line": 79, "end_line": 179, "span_ids": ["TestRemove", "TestAdd", "TestPull.test", "TestConfig", "TestGCMultipleDvcRepos", "TestCheckout", "TestGCMultipleDvcRepos.test", "TestFindRoot.test", "TestPull", "TestGC", "TestFindRoot", "TestPush.test", "TestStatus.test", "TestRemove.test", "TestRepro", "TestConfig.test", "TestPush", "TestStatus", "TestRepro.test", "TestGC.test", "TestCheckout.test", "TestAdd.test"], "tokens": 575}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestPull(TestDvc):\n def test(self):\n args = parse_args([\"pull\"])\n self.assertIsInstance(args.func(args), CmdDataPull)\n\n\nclass TestPush(TestDvc):\n def test(self):\n args = parse_args([\"push\"])\n self.assertIsInstance(args.func(args), CmdDataPush)\n\n\nclass TestStatus(TestDvc):\n def test(self):\n args = parse_args([\"status\"])\n self.assertIsInstance(args.func(args), CmdDataStatus)\n\n\nclass TestRepro(TestDvc):\n def test(self):\n target1 = \"1\"\n target2 = \"2\"\n\n args = parse_args(\n [\"repro\", target1, target2, \"-f\", \"--force\", \"-s\", \"--single-item\"]\n )\n\n self.assertIsInstance(args.func(args), CmdRepro)\n self.assertEqual(args.targets, [target1, target2])\n self.assertEqual(args.force, True)\n self.assertEqual(args.single_item, True)\n\n\nclass TestRemove(TestDvc):\n def test(self):\n target1 = \"1\"\n target2 = \"2\"\n\n args = parse_args([\"remove\", target1, target2])\n\n self.assertIsInstance(args.func(args), CmdRemove)\n self.assertEqual(args.targets, [target1, target2])\n\n\nclass TestAdd(TestDvc):\n def test(self):\n target1 = \"1\"\n target2 = \"2\"\n\n args = parse_args([\"add\", target1, target2])\n\n self.assertIsInstance(args.func(args), CmdAdd)\n self.assertEqual(args.targets, [target1, target2])\n\n\nclass TestGC(TestDvc):\n def test(self):\n args = parse_args([\"gc\"])\n self.assertIsInstance(args.func(args), CmdGC)\n\n\nclass TestGCMultipleDvcRepos(TestDvc):\n def test(self):\n args = parse_args([\"gc\", \"-p\", \"/tmp/asdf\", \"/tmp/xyz\"])\n\n self.assertIsInstance(args.func(args), CmdGC)\n\n self.assertEqual(args.repos, [\"/tmp/asdf\", \"/tmp/xyz\"])\n\n\nclass TestConfig(TestDvc):\n def test(self):\n name = \"param\"\n value = \"1\"\n\n args = parse_args([\"config\", \"-u\", \"--unset\", name, value])\n\n self.assertIsInstance(args.func(args), CmdConfig)\n self.assertEqual(args.unset, True)\n self.assertEqual(args.name, name)\n self.assertEqual(args.value, value)\n\n\nclass TestCheckout(TestDvc):\n def test(self):\n args = parse_args([\"checkout\"])\n self.assertIsInstance(args.func(args), CmdCheckout)\n\n\nclass TestFindRoot(TestDvc):\n def test(self):\n os.chdir(\"..\")\n\n class A(object):\n quiet = False\n verbose = True\n\n args = A()\n with self.assertRaises(DvcException):\n CmdBase(args)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_config.py_configobj_TestConfigCLI.test_root.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_config.py_configobj_TestConfigCLI.test_root.None_1", "embedding": null, "metadata": {"file_path": "tests/func/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 33, "span_ids": ["imports", "TestConfigCLI.test_root", "TestConfigCLI._contains", "TestConfigCLI"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import configobj\n\nfrom dvc.main import main\nfrom tests.basic_env import TestDvc\n\n\nclass TestConfigCLI(TestDvc):\n def _contains(self, section, field, value, local=False):\n 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/func/test_data_cloud.py_TestDataCloud_TestDataCloud.test.for_scheme_cl_in_clist_.self__test_cloud_config_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestDataCloud_TestDataCloud.test.for_scheme_cl_in_clist_.self__test_cloud_config_", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 228, "end_line": 250, "span_ids": ["TestDataCloud._test_cloud", "TestDataCloud.test", "TestDataCloud"], "tokens": 196}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestDataCloud(TestDvc):\n def _test_cloud(self, config, cl):\n self.dvc.config.config = config\n cloud = DataCloud(self.dvc)\n self.assertIsInstance(cloud.get_remote(), cl)\n\n def test(self):\n config = copy.deepcopy(TEST_CONFIG)\n\n clist = [\n (\"s3://mybucket/\", RemoteS3),\n (\"gs://mybucket/\", RemoteGS),\n (\"ssh://user@localhost:/\", RemoteSSH),\n (\"http://localhost:8000/\", RemoteHTTP),\n (\"azure://ContainerName=mybucket;conn_string;\", RemoteAZURE),\n (\"oss://mybucket/\", RemoteOSS),\n (TestDvc.mkdtemp(), RemoteLOCAL),\n ]\n\n for scheme, cl in clist:\n remote_url = scheme + str(uuid.uuid4())\n config[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/func/test_data_cloud.py_TestDataCloudBase_TestDataCloudBase._setup_cloud.self_assertIsInstance_sel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestDataCloudBase_TestDataCloudBase._setup_cloud.self_assertIsInstance_sel", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 253, "end_line": 284, "span_ids": ["TestDataCloudBase._ensure_should_run", "TestDataCloudBase._get_url", "TestDataCloudBase._should_test", "TestDataCloudBase", "TestDataCloudBase._setup_cloud", "TestDataCloudBase._get_cloud_class", "TestDataCloudBase._get_keyfile"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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 _get_keyfile(self):\n return None\n\n def _ensure_should_run(self):\n if not self._should_test():\n raise SkipTest(\n \"Test {} is disabled\".format(self.__class__.__name__)\n )\n\n def _setup_cloud(self):\n self._ensure_should_run()\n\n repo = self._get_url()\n keyfile = self._get_keyfile()\n\n config = copy.deepcopy(TEST_CONFIG)\n config[TEST_SECTION][Config.SECTION_REMOTE_URL] = repo\n config[TEST_SECTION][Config.SECTION_REMOTE_KEY_FILE] = keyfile\n self.dvc.config.config = config\n self.cloud = DataCloud(self.dvc)\n\n self.assertIsInstance(self.cloud.get_remote(), self._get_cloud_class())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestDataCloudBase._test_cloud_TestDataCloudBase.test.self__test_cloud_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestDataCloudBase._test_cloud_TestDataCloudBase.test.self__test_cloud_", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 286, "end_line": 366, "span_ids": ["TestDataCloudBase.test", "TestDataCloudBase._test_cloud"], "tokens": 703}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestDataCloudBase(TestDvc):\n\n def _test_cloud(self):\n self._setup_cloud()\n\n stages = self.dvc.add(self.FOO)\n self.assertEqual(len(stages), 1)\n stage = stages[0]\n self.assertTrue(stage is not None)\n out = stage.outs[0]\n cache = out.cache_path\n name = str(out)\n md5 = out.checksum\n info = {\"name\": name, out.remote.PARAM_CHECKSUM: 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 out_dir = stage_dir.outs[0]\n cache_dir = out.cache_path\n name_dir = str(out)\n md5_dir = out.checksum\n info_dir = {\"name\": name_dir, out_dir.remote.PARAM_CHECKSUM: md5_dir}\n\n with self.cloud.repo.state:\n # Check status\n status = self.cloud.status([info], show_checksums=True)\n expected = {md5: {\"name\": md5, \"status\": STATUS_NEW}}\n self.assertEqual(status, expected)\n\n status_dir = self.cloud.status([info_dir], show_checksums=True)\n expected = {md5_dir: {\"name\": md5_dir, \"status\": STATUS_NEW}}\n self.assertEqual(status_dir, expected)\n\n # Push and check status\n self.cloud.push([info])\n self.assertTrue(os.path.exists(cache))\n self.assertTrue(os.path.isfile(cache))\n\n self.cloud.push([info_dir])\n self.assertTrue(os.path.isfile(cache_dir))\n\n status = self.cloud.status([info], show_checksums=True)\n expected = {md5: {\"name\": md5, \"status\": STATUS_OK}}\n self.assertEqual(status, expected)\n\n status_dir = self.cloud.status([info_dir], show_checksums=True)\n expected = {md5_dir: {\"name\": md5_dir, \"status\": STATUS_OK}}\n self.assertEqual(status_dir, expected)\n\n # Remove and check status\n 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/func/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/func/test_data_cloud.py_TestRemoteS3_TestRemoteGS._get_cloud_class.return.RemoteGS", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 366, "end_line": 400, "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": 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 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 ] = TEST_GCP_CREDS_FILE\n self.dvc.config.config = config\n self.cloud = DataCloud(self.dvc)\n\n self.assertIsInstance(self.cloud.get_remote(), self._get_cloud_class())\n\n def _get_url(self):\n 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/func/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/func/test_data_cloud.py_TestCompatRemoteLOCALCLI_TestDataCloudErrorCLI.test_error.self_main_fail_fetch_", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 579, "end_line": 712, "span_ids": ["TestCompatRemoteLOCALCLI", "TestRemoteAZURECLI._test", "TestDataCloudErrorCLI", "TestRemoteGSCLI", "TestRemoteHDFSCLI", "TestCompatRemoteLOCALCLI._test", "TestRemoteSSHCLI._should_test", "TestRemoteGSCLI._should_test", "TestRemoteHDFSCLI._should_test", "TestCompatRemoteS3CLI._should_test", "TestCompatRemoteS3CLI", "TestRemoteS3CLI._test", "TestRemoteAZURECLI", "TestCompatRemoteGSCLI", "TestRemoteS3CLI", "TestRemoteLOCALCLI._test", "TestCompatRemoteGSCLI._should_test", "TestCompatRemoteGSCLI._test", "TestRemoteOSSCLI._test", "TestRemoteOSSCLI", "TestRemoteLOCALCLI", "TestRemoteSSHCLI._test", "TestRemoteHDFSCLI._test", "TestCompatRemoteS3CLI._test", "TestRemoteGSCLI._test", "TestRemoteOSSCLI._should_test", "TestRemoteS3CLI._should_test", "TestRemoteSSHCLI", "TestRemoteAZURECLI._should_test", "TestDataCloudErrorCLI.test_error", "TestDataCloudErrorCLI.main_fail"], "tokens": 765}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 TEST_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 TestRemoteOSSCLI(TestDataCloudCLIBase):\n def _should_test(self):\n return _should_test_oss()\n\n def _test(self):\n url = get_oss_url()\n\n self.main([\"remote\", \"add\", TEST_REMOTE, url])\n\n self._test_cloud(TEST_REMOTE)\n\n\nclass TestDataCloudErrorCLI(TestDvc):\n def main_fail(self, args):\n ret = main(args)\n self.assertNotEqual(ret, 0)\n\n def test_error(self):\n f = \"non-existing-file\"\n self.main_fail([\"status\", \"-c\", f])\n self.main_fail([\"push\", f])\n self.main_fail([\"pull\", f])\n self.main_fail([\"fetch\", f])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestWarnOnOutdatedStage_TestWarnOnOutdatedStage.test.self__test_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestWarnOnOutdatedStage_TestWarnOnOutdatedStage.test.self__test_", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 616, "end_line": 645, "span_ids": ["TestWarnOnOutdatedStage.test", "TestWarnOnOutdatedStage._test", "TestWarnOnOutdatedStage.main", "TestWarnOnOutdatedStage"], "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 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 dump_stage_file(stage_file_path, content)\n\n with self._caplog.at_level(logging.WARNING, logger=\"dvc\"):\n self._caplog.clear()\n self.main([\"status\", \"-c\"])\n expected_warning = (\n \"Output 'bar'(Stage: 'bar.dvc') is missing version info.\"\n \" Cache for it will not be collected.\"\n \" Use dvc repro to get your pipeline up to date.\"\n )\n\n assert expected_warning in self._caplog.text\n\n def test(self):\n self._test()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRecursiveSyncOperations_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/func/test_data_cloud.py_TestRecursiveSyncOperations_TestRecursiveSyncOperations._clear_local_cache.shutil_rmtree_self_dvc_ca", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 747, "end_line": 786, "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": 243}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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 remote = self.cloud.get_remote()\n self.main([\"remote\", \"add\", \"-d\", TEST_REMOTE, remote.cache_dir])\n\n self.dvc.add(self.DATA)\n self.dvc.add(self.DATA_SUB)\n\n def _remove_local_data_files(self):\n os.remove(self.DATA)\n os.remove(self.DATA_SUB)\n\n def _test_recursive_pull(self):\n self._remove_local_data_files()\n self._clear_local_cache()\n\n self.assertFalse(os.path.exists(self.DATA))\n self.assertFalse(os.path.exists(self.DATA_SUB))\n\n self.main([\"pull\", \"-R\", self.DATA_DIR])\n\n self.assertTrue(os.path.exists(self.DATA))\n self.assertTrue(os.path.exists(self.DATA_SUB))\n\n def _clear_local_cache(self):\n 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/func/test_data_cloud.py_TestRecursiveSyncOperations._test_recursive_fetch_TestRecursiveSyncOperations._test_recursive_fetch.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRecursiveSyncOperations._test_recursive_fetch_TestRecursiveSyncOperations._test_recursive_fetch.None_5", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 690, "end_line": 702, "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/func/test_data_cloud.py_TestRecursiveSyncOperations._test_recursive_push_TestRecursiveSyncOperations.test.self__test_recursive_pull": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRecursiveSyncOperations._test_recursive_push_TestRecursiveSyncOperations.test.self__test_recursive_pull", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 802, "end_line": 826, "span_ids": ["TestRecursiveSyncOperations._test_recursive_push", "TestRecursiveSyncOperations.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 TestRecursiveSyncOperations(TestDataCloudBase):\n\n def _test_recursive_push(self, data_md5, data_sub_md5):\n remote = self.cloud.get_remote()\n cloud_data_path = remote.get(data_md5)\n cloud_data_sub_path = remote.get(data_sub_md5)\n\n self.assertFalse(os.path.exists(cloud_data_path))\n self.assertFalse(os.path.exists(cloud_data_sub_path))\n\n self.main([\"push\", \"-R\", self.DATA_DIR])\n\n self.assertTrue(os.path.exists(cloud_data_path))\n self.assertTrue(os.path.exists(cloud_data_sub_path))\n\n def test(self):\n self._setup_cloud()\n self._prepare_repo()\n\n data_md5 = file_md5(self.DATA)[0]\n data_sub_md5 = file_md5(self.DATA_SUB)[0]\n\n self._test_recursive_push(data_md5, data_sub_md5)\n\n self._test_recursive_fetch(data_md5, data_sub_md5)\n\n self._test_recursive_pull()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestCheckSumRecalculation_TestCheckSumRecalculation.test.self_assertEqual_test_get": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestCheckSumRecalculation_TestCheckSumRecalculation.test.self_assertEqual_test_get", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 730, "end_line": 747, "span_ids": ["TestCheckSumRecalculation", "TestCheckSumRecalculation.test"], "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 TestCheckSumRecalculation(TestDvc):\n def test(self):\n test_get_file_checksum = spy(RemoteLOCAL.get_file_checksum)\n with patch.object(\n RemoteLOCAL, \"get_file_checksum\", test_get_file_checksum\n ):\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_get_file_checksum.mock.call_count, 1)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestShouldWarnOnNoChecksumInLocalAndRemoteCache.test_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestShouldWarnOnNoChecksumInLocalAndRemoteCache.test_", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 780, "end_line": 798, "span_ids": ["TestShouldWarnOnNoChecksumInLocalAndRemoteCache.test"], "tokens": 176}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShouldWarnOnNoChecksumInLocalAndRemoteCache(TestDvc):\n\n def test(self):\n self._caplog.clear()\n main([\"push\"])\n assert self.message_header in self._caplog.text\n assert self.message_foo_part in self._caplog.text\n assert self.message_bar_part in self._caplog.text\n\n self._caplog.clear()\n main([\"pull\"])\n assert self.message_header in self._caplog.text\n assert self.message_foo_part in self._caplog.text\n assert self.message_bar_part in self._caplog.text\n\n self._caplog.clear()\n main([\"status\", \"-c\"])\n assert self.message_header in self._caplog.text\n assert self.message_foo_part in self._caplog.text\n assert self.message_bar_part in self._caplog.text", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_destroy.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_destroy.py_os_", "embedding": null, "metadata": {"file_path": "tests/func/test_destroy.py", "file_name": "test_destroy.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 29, "span_ids": ["imports", "test_destroy"], "tokens": 218}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nfrom dvc.system import System\n\n\ndef test_destroy(repo_dir, dvc_repo):\n # NOTE: using symlink to ensure that data was unprotected after `destroy`\n dvc_repo.config.set(\"cache\", \"type\", \"symlink\")\n\n foo_stage, = dvc_repo.add(repo_dir.FOO)\n data_dir_stage, = dvc_repo.add(repo_dir.DATA_DIR)\n\n dvc_repo.destroy()\n\n assert not os.path.exists(dvc_repo.dvc_dir)\n assert not os.path.exists(foo_stage.path)\n assert not os.path.exists(data_dir_stage.path)\n\n assert os.path.isfile(repo_dir.FOO)\n assert os.path.isdir(repo_dir.DATA_DIR)\n assert os.path.isfile(repo_dir.DATA)\n assert os.path.isdir(repo_dir.DATA_SUB_DIR)\n assert os.path.isfile(repo_dir.DATA_SUB)\n\n assert not System.is_symlink(repo_dir.FOO)\n assert not System.is_symlink(repo_dir.DATA_DIR)\n assert not System.is_symlink(repo_dir.DATA)\n assert not System.is_symlink(repo_dir.DATA_SUB)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_TestDiffDirRepo_TestDiffDirRepo.test.self_assertEqual_test_dct": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_TestDiffDirRepo_TestDiffDirRepo.test.self_assertEqual_test_dct", "embedding": null, "metadata": {"file_path": "tests/func/test_diff.py", "file_name": "test_diff.py", "file_type": "text/x-python", "category": "test", "start_line": 126, "end_line": 153, "span_ids": ["TestDiffDirRepo.test", "TestDiffDirRepo"], "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 TestDiffDirRepo(TestDiffDir):\n maxDiff = None\n\n def test(self):\n result = self.dvc.diff(self.a_ref, target=self.DATA_DIR)\n test_dct = {\n diff.DIFF_A_REF: self.git.git.rev_parse(self.a_ref, short=True),\n diff.DIFF_B_REF: self.git.git.rev_parse(\n self.git.head.commit, short=True\n ),\n diff.DIFF_LIST: [\n {\n diff.DIFF_CHANGE: 0,\n diff.DIFF_DEL: 0,\n diff.DIFF_IDENT: 2,\n diff.DIFF_MOVE: 0,\n diff.DIFF_NEW: 1,\n diff.DIFF_IS_DIR: True,\n diff.DIFF_TARGET: self.DATA_DIR,\n diff.DIFF_NEW_FILE: self.DATA_DIR,\n diff.DIFF_NEW_CHECKSUM: self.new_checksum,\n diff.DIFF_OLD_FILE: self.DATA_DIR,\n diff.DIFF_OLD_CHECKSUM: self.old_checksum,\n diff.DIFF_SIZE: 30,\n }\n ],\n }\n self.assertEqual(test_dct, result)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_TestDiffDirRepoDeletedFile_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_TestDiffDirRepoDeletedFile_", "embedding": null, "metadata": {"file_path": "tests/func/test_diff.py", "file_name": "test_diff.py", "file_type": "text/x-python", "category": "test", "start_line": 156, "end_line": 202, "span_ids": ["TestDiffDirRepoDeletedFile", "TestDiffFileNotFound", "TestDiffDirRepoDeletedFile.test", "TestDiffFileNotFound.test", "TestDiffFileNotFound.setUp", "TestDiffDirRepoDeletedFile.setUp"], "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 TestDiffDirRepoDeletedFile(TestDiffDir):\n maxDiff = None\n\n def setUp(self):\n super(TestDiffDirRepoDeletedFile, self).setUp()\n\n self.b_ref = self.a_ref\n self.new_checksum = self.old_checksum\n self.a_ref = str(self.dvc.scm.git.head.commit)\n self.old_checksum = _get_checksum(self.dvc, self.DATA_DIR)\n\n def test(self):\n result = self.dvc.diff(\n self.a_ref, b_ref=self.b_ref, target=self.DATA_DIR\n )\n test_dct = {\n diff.DIFF_A_REF: self.git.git.rev_parse(self.a_ref, short=True),\n diff.DIFF_B_REF: self.git.git.rev_parse(self.b_ref, short=True),\n diff.DIFF_LIST: [\n {\n diff.DIFF_CHANGE: 0,\n diff.DIFF_DEL: 1,\n diff.DIFF_IDENT: 2,\n diff.DIFF_MOVE: 0,\n diff.DIFF_NEW: 0,\n diff.DIFF_IS_DIR: True,\n diff.DIFF_TARGET: self.DATA_DIR,\n diff.DIFF_NEW_FILE: self.DATA_DIR,\n diff.DIFF_NEW_CHECKSUM: self.new_checksum,\n diff.DIFF_OLD_FILE: self.DATA_DIR,\n diff.DIFF_OLD_CHECKSUM: self.old_checksum,\n diff.DIFF_SIZE: -30,\n }\n ],\n }\n self.assertEqual(test_dct, result)\n\n\nclass TestDiffFileNotFound(TestDiffDir):\n def setUp(self):\n super(TestDiffFileNotFound, self).setUp()\n self.unknown_file = \"unknown_file_\" + str(id(self))\n\n def test(self):\n with self.assertRaises(FileNotInCommitError):\n self.dvc.diff(self.a_ref, target=self.unknown_file)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_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/func/test_gc.py_os_TestGC._test_gc.for_c_in_self_good_cache_.self_assertTrue_os_path_e", "embedding": null, "metadata": {"file_path": "tests/func/test_gc.py", "file_name": "test_gc.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 44, "span_ids": ["TestGC.test_cli", "imports", "TestGC", "TestGC.setUp", "TestGC.test_api", "TestGC._test_gc"], "tokens": 275}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\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 TestDvcGit\nfrom tests.basic_env import TestDir\n\n\nclass TestGC(TestDvcGit):\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/func/test_gc.py_TestGCBranchesTags_TestGCBranchesTags.test.self__check_cache_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_TestGCBranchesTags_TestGCBranchesTags.test.self__check_cache_1_", "embedding": null, "metadata": {"file_path": "tests/func/test_gc.py", "file_name": "test_gc.py", "file_type": "text/x-python", "category": "test", "start_line": 47, "end_line": 104, "span_ids": ["TestGCBranchesTags.test", "TestGCBranchesTags", "TestGCBranchesTags._check_cache"], "tokens": 509}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestGCBranchesTags(TestDvcGit):\n def _check_cache(self, num):\n total = 0\n for root, dirs, files in os.walk(os.path.join(\".dvc\", \"cache\")):\n total += len(files)\n self.assertEqual(total, num)\n\n def test(self):\n fname = \"file\"\n\n with open(fname, \"w+\") as fobj:\n fobj.write(\"v1.0\")\n\n stages = self.dvc.add(fname)\n self.assertEqual(len(stages), 1)\n self.dvc.scm.add([\".gitignore\", stages[0].relpath])\n self.dvc.scm.commit(\"v1.0\")\n self.dvc.scm.tag(\"v1.0\")\n\n self.dvc.scm.checkout(\"test\", create_new=True)\n self.dvc.remove(stages[0].relpath, outs_only=True)\n with open(fname, \"w+\") as fobj:\n fobj.write(\"test\")\n stages = self.dvc.add(fname)\n self.assertEqual(len(stages), 1)\n self.dvc.scm.add([\".gitignore\", stages[0].relpath])\n self.dvc.scm.commit(\"test\")\n\n self.dvc.scm.checkout(\"master\")\n self.dvc.remove(stages[0].relpath, outs_only=True)\n with open(fname, \"w+\") as fobj:\n fobj.write(\"trash\")\n stages = self.dvc.add(fname)\n self.assertEqual(len(stages), 1)\n self.dvc.scm.add([\".gitignore\", stages[0].relpath])\n self.dvc.scm.commit(\"trash\")\n\n self.dvc.remove(stages[0].relpath, outs_only=True)\n with open(fname, \"w+\") as fobj:\n fobj.write(\"master\")\n stages = self.dvc.add(fname)\n self.assertEqual(len(stages), 1)\n self.dvc.scm.add([\".gitignore\", stages[0].relpath])\n self.dvc.scm.commit(\"master\")\n\n self._check_cache(4)\n\n self.dvc.gc(all_tags=True, all_branches=True)\n\n self._check_cache(3)\n\n self.dvc.gc(all_tags=False, all_branches=True)\n\n self._check_cache(2)\n\n self.dvc.gc(all_tags=True, all_branches=False)\n\n self._check_cache(1)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_TestGCMultipleDvcRepos_TestGCMultipleDvcRepos.setUp.self.additional_dvc_7.DvcRepo_self_additional_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_TestGCMultipleDvcRepos_TestGCMultipleDvcRepos.setUp.self.additional_dvc_7.DvcRepo_self_additional_p", "embedding": null, "metadata": {"file_path": "tests/func/test_gc.py", "file_name": "test_gc.py", "file_type": "text/x-python", "category": "test", "start_line": 107, "end_line": 129, "span_ids": ["TestGCMultipleDvcRepos", "TestGCMultipleDvcRepos.setUp", "TestGCMultipleDvcRepos._check_cache"], "tokens": 205}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestGCMultipleDvcRepos(TestDvcGit):\n def _check_cache(self, num):\n total = 0\n for root, dirs, files in os.walk(os.path.join(\".dvc\", \"cache\")):\n total += len(files)\n self.assertEqual(total, num)\n\n def setUp(self):\n super(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/func/test_gc.py_TestGCMultipleDvcRepos.test_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_gc.py_TestGCMultipleDvcRepos.test_", "embedding": null, "metadata": {"file_path": "tests/func/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": 334}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestGCMultipleDvcRepos(TestDvcGit):\n\n def test(self):\n\n # ADD FILE ONLY IN MAIN PROJECT\n fname = \"only_in_first\"\n with open(fname, \"w+\") as fobj:\n fobj.write(\"only in main repo\")\n\n stages = self.dvc.add(fname)\n self.assertEqual(len(stages), 1)\n\n # ADD FILE IN MAIN PROJECT THAT IS ALSO IN SECOND PROJECT\n fname = \"in_both\"\n with open(fname, \"w+\") as fobj:\n fobj.write(\"in both repos\")\n\n stages = self.dvc.add(fname)\n self.assertEqual(len(stages), 1)\n\n cwd = os.getcwd()\n os.chdir(self.additional_path)\n # ADD FILE ONLY IN SECOND PROJECT\n fname = os.path.join(self.additional_path, \"only_in_second\")\n with open(fname, \"w+\") as fobj:\n fobj.write(\"only in additional repo\")\n\n stages = self.additional_dvc.add(fname)\n self.assertEqual(len(stages), 1)\n\n # ADD FILE IN SECOND PROJECT THAT IS ALSO IN MAIN PROJECT\n fname = os.path.join(self.additional_path, \"in_both\")\n with open(fname, \"w+\") as fobj:\n fobj.write(\"in both repos\")\n\n stages = self.additional_dvc.add(fname)\n self.assertEqual(len(stages), 1)\n\n os.chdir(cwd)\n\n self._check_cache(3)\n\n self.dvc.gc(repos=[self.additional_path])\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/func/test_ignore.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_ignore.py_os_", "embedding": null, "metadata": {"file_path": "tests/func/test_ignore.py", "file_name": "test_ignore.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 59, "span_ids": ["TestDvcIgnore.test_ignore_in_parent_dir", "imports", "TestDvcIgnore._get_all_paths", "TestDvcIgnore.test_ignore_in_child_dir_unicode", "TestDvcIgnore.setUp", "TestDvcIgnore", "TestDvcIgnore.test_ignore_in_child_dir"], "tokens": 456}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nfrom dvc.ignore import DvcIgnore, DvcIgnoreFileHandler\nfrom dvc.utils.compat import cast_bytes\nfrom tests.basic_env import TestDvc\n\n\nclass TestDvcIgnore(TestDvc):\n def setUp(self):\n super(TestDvcIgnore, self).setUp()\n self.ignore_file_handler = DvcIgnoreFileHandler(self.dvc.tree)\n\n def _get_all_paths(self):\n\n paths = []\n ignore_file_handler = DvcIgnoreFileHandler(self.dvc.tree)\n for root, dirs, files in self.dvc.tree.walk(\n self.dvc.root_dir, ignore_file_handler=ignore_file_handler\n ):\n for dname in dirs:\n paths.append(os.path.join(root, dname))\n\n for fname in files:\n paths.append(os.path.join(root, fname))\n\n return paths\n\n def test_ignore_in_child_dir(self):\n ignore_file = os.path.join(self.dvc.root_dir, DvcIgnore.DVCIGNORE_FILE)\n with open(ignore_file, \"w\") as fobj:\n fobj.write(\"data_dir/data\")\n\n forbidden_path = os.path.join(self.dvc.root_dir, self.DATA)\n all_paths = self._get_all_paths()\n\n self.assertNotIn(forbidden_path, all_paths)\n\n def test_ignore_in_child_dir_unicode(self):\n ignore_file = os.path.join(self.dvc.root_dir, DvcIgnore.DVCIGNORE_FILE)\n with open(ignore_file, \"wb\") as fobj:\n fobj.write(cast_bytes(self.UNICODE, \"utf-8\"))\n\n forbidden_path = os.path.join(self.dvc.root_dir, self.UNICODE)\n all_paths = self._get_all_paths()\n\n self.assertNotIn(forbidden_path, all_paths)\n\n def test_ignore_in_parent_dir(self):\n ignore_file = os.path.join(self.dvc.root_dir, DvcIgnore.DVCIGNORE_FILE)\n with open(ignore_file, \"w\") as fobj:\n fobj.write(\"data_dir/data\")\n\n os.chdir(self.DATA_DIR)\n\n forbidden_path = os.path.join(self.dvc.root_dir, self.DATA)\n all_paths = self._get_all_paths()\n\n self.assertNotIn(forbidden_path, all_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/tests/func/test_init.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_init.py_os_", "embedding": null, "metadata": {"file_path": "tests/func/test_init.py", "file_name": "test_init.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 74, "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", "test_init_quiet_should_not_display_welcome_screen", "TestInit.test_cli", "TestInitNoSCM.test_cli"], "tokens": 392}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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()\n\n\ndef test_init_quiet_should_not_display_welcome_screen(git, caplog):\n ret = main([\"init\", \"--quiet\"])\n\n assert 0 == ret\n assert \"\" == caplog.text", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_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/func/test_lock.py_from_dvc_lock_import_Lock_", "embedding": null, "metadata": {"file_path": "tests/func/test_lock.py", "file_name": "test_lock.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 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/func/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/func/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/func/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 153, "end_line": 215, "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(TestMetricsBase):\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/func/test_metrics.py_TestMetrics.test_formatted_output_TestMetrics.test_formatted_output.expected_tsv._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestMetrics.test_formatted_output_TestMetrics.test_formatted_output.expected_tsv._", "embedding": null, "metadata": {"file_path": "tests/func/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 217, "end_line": 301, "span_ids": ["TestMetrics.test_formatted_output"], "tokens": 727}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestMetrics(TestMetricsBase):\n\n def test_formatted_output(self):\n # Labels are in Spanish to test UTF-8\n self.create(\n \"metrics.csv\",\n (\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\n # Contains quoted newlines to test output correctness\n self.create(\n \"metrics.tsv\",\n (\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\n self.create(\n \"metrics.json\",\n (\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\n self.create(\n \"metrics.txt\", \"ROC_AUC: 0.64\\nKS: 78.9999999996\\nF_SCORE: 77\\n\"\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\n self._caplog.clear()\n\n with self._caplog.at_level(logging.INFO, logger=\"dvc\"):\n ret = main([\"metrics\", \"show\"])\n self.assertEqual(ret, 0)\n\n expected_csv = (\n \"\\tmetrics.csv:\\n\"\n \"\\t\\tvalor_mse desviaci\u00f3n_mse data_set \\n\"\n \"\\t\\t0.421601 0.173461 entrenamiento \\n\"\n \"\\t\\t0.67528 0.289545 pruebas \\n\"\n \"\\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 # ... 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/func/test_metrics.py_TestMetrics.test_formatted_output.expected_txt_TestMetrics.test_formatted_output.assert_expected_json_in_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestMetrics.test_formatted_output.expected_txt_TestMetrics.test_formatted_output.assert_expected_json_in_s", "embedding": null, "metadata": {"file_path": "tests/func/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 303, "end_line": 336, "span_ids": ["TestMetrics.test_formatted_output"], "tokens": 327}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestMetrics(TestMetricsBase):\n\n def test_formatted_output(self):\n # ... other code\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 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 = \"\\n\".join(record.message for record in self._caplog.records)\n\n assert expected_tsv in stdout\n assert expected_csv in stdout\n assert expected_txt in stdout\n assert expected_json in 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/func/test_metrics.py_TestMetrics.test_show_all_should_be_current_dir_agnostic_TestMetrics.assertMetricsHaveRelativePaths.for_branch_in_bar_ba.self_assertEqual_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestMetrics.test_show_all_should_be_current_dir_agnostic_TestMetrics.assertMetricsHaveRelativePaths.for_branch_in_bar_ba.self_assertEqual_", "embedding": null, "metadata": {"file_path": "tests/func/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 339, "end_line": 366, "span_ids": ["TestMetrics.test_show_all_should_be_current_dir_agnostic", "TestMetrics.assertMetricsHaveRelativePaths"], "tokens": 260}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestMetrics(TestMetricsBase):\n\n def test_show_all_should_be_current_dir_agnostic(self):\n os.chdir(self.DATA_DIR)\n\n metrics = self.dvc.metrics.show(all_branches=True)\n self.assertMetricsHaveRelativePaths(metrics)\n\n def assertMetricsHaveRelativePaths(self, metrics):\n root_relpath = relpath(self.dvc.root_dir)\n metric_path = os.path.join(root_relpath, \"metric\")\n metric_json_path = os.path.join(root_relpath, \"metric_json\")\n metric_tsv_path = os.path.join(root_relpath, \"metric_tsv\")\n metric_htsv_path = os.path.join(root_relpath, \"metric_htsv\")\n metric_csv_path = os.path.join(root_relpath, \"metric_csv\")\n metric_hcsv_path = os.path.join(root_relpath, \"metric_hcsv\")\n metric_json_ext_path = os.path.join(root_relpath, \"metric_json_ext\")\n for branch in [\"bar\", \"baz\", \"foo\"]:\n self.assertEqual(\n set(metrics[branch].keys()),\n {\n metric_path,\n metric_json_path,\n metric_tsv_path,\n metric_htsv_path,\n metric_csv_path,\n metric_hcsv_path,\n metric_json_ext_path,\n },\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/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/func/test_metrics.py_TestMetricsRecursive_TestMetricsRecursive.setUp.self_dvc_scm_checkout_ma", "embedding": null, "metadata": {"file_path": "tests/func/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 369, "end_line": 412, "span_ids": ["TestMetricsRecursive", "TestMetricsRecursive.setUp"], "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 TestMetricsRecursive(TestDvcGit):\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/func/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/func/test_metrics.py_TestMetricsRecursive.test_TestMetricsRecursive.test.None_2", "embedding": null, "metadata": {"file_path": "tests/func/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 414, "end_line": 430, "span_ids": ["TestMetricsRecursive.test"], "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 TestMetricsRecursive(TestDvcGit):\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/func/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/func/test_metrics.py_TestMetricsReproCLI_TestMetricsReproCLI.test_binary.with_self_assertRaises_Dv.self_dvc_run_metrics_no_c", "embedding": null, "metadata": {"file_path": "tests/func/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 433, "end_line": 469, "span_ids": ["TestMetricsReproCLI.test_dir", "TestMetricsReproCLI.test", "TestMetricsReproCLI.test_binary", "TestMetricsReproCLI"], "tokens": 293}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestMetricsReproCLI(TestDvcGit):\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/func/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/func/test_metrics.py_TestMetricsCLI_TestMetricsCLI.test.None_5", "embedding": null, "metadata": {"file_path": "tests/func/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 471, "end_line": 525, "span_ids": ["TestMetricsCLI.test", "TestMetricsCLI"], "tokens": 298}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestMetricsCLI(TestMetricsBase):\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/func/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/func/test_metrics.py_TestMetricsCLI.test_dir_TestMetricsCLI.test_non_existing.None_2", "embedding": null, "metadata": {"file_path": "tests/func/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 527, "end_line": 550, "span_ids": ["TestMetricsCLI.test_dir", "TestMetricsCLI.test_non_existing", "TestMetricsCLI.test_binary"], "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 TestMetricsCLI(TestMetricsBase):\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/func/test_metrics.py_TestMetricsCLI.test_wrong_type_add_TestMetricsCLI.test_wrong_type_add.assert_tmetric_unknown_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestMetricsCLI.test_wrong_type_add_TestMetricsCLI.test_wrong_type_add.assert_tmetric_unknown_", "embedding": null, "metadata": {"file_path": "tests/func/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 552, "end_line": 580, "span_ids": ["TestMetricsCLI.test_wrong_type_add"], "tokens": 227}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestMetricsCLI(TestMetricsBase):\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 assert ret == 0\n\n self._caplog.clear()\n ret = main([\"metrics\", \"add\", \"metric.unknown\", \"-t\", \"unknown\"])\n assert ret == 1\n\n assert (\n \"failed to add metric file 'metric.unknown'\"\n ) in self._caplog.text\n\n assert (\n \"'unknown' is not supported, must be one of \"\n \"[raw, json, csv, tsv, hcsv, htsv]\"\n ) in self._caplog.text\n\n ret = main([\"metrics\", \"add\", \"metric.unknown\", \"-t\", \"raw\"])\n assert ret == 0\n\n self._caplog.clear()\n ret = main([\"metrics\", \"show\", \"metric.unknown\"])\n assert ret == 0\n\n assert \"\\tmetric.unknown: unknown\" in self._caplog.text", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestMetricsCLI.test_wrong_type_modify_TestMetricsCLI.test_wrong_type_modify.assert_tmetric_unknown_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestMetricsCLI.test_wrong_type_modify_TestMetricsCLI.test_wrong_type_modify.assert_tmetric_unknown_", "embedding": null, "metadata": {"file_path": "tests/func/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 582, "end_line": 610, "span_ids": ["TestMetricsCLI.test_wrong_type_modify"], "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 TestMetricsCLI(TestMetricsBase):\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 assert ret == 0\n\n self._caplog.clear()\n\n ret = main([\"metrics\", \"modify\", \"metric.unknown\", \"-t\", \"unknown\"])\n assert ret == 1\n\n assert \"failed to modify metric file settings\" in self._caplog.text\n\n assert (\n \"metric type 'unknown' is not supported, must be one of \"\n \"[raw, json, csv, tsv, hcsv, htsv]\"\n ) in self._caplog.text\n\n ret = main([\"metrics\", \"modify\", \"metric.unknown\", \"-t\", \"CSV\"])\n assert ret == 0\n\n self._caplog.clear()\n\n ret = main([\"metrics\", \"show\", \"metric.unknown\"])\n assert ret == 0\n\n assert \"\\tmetric.unknown: unknown\" in self._caplog.text", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestMetricsCLI.test_wrong_type_show_TestNoMetrics.test_cli.self_assertNotEqual_ret_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestMetricsCLI.test_wrong_type_show_TestNoMetrics.test_cli.self_assertNotEqual_ret_", "embedding": null, "metadata": {"file_path": "tests/func/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 613, "end_line": 637, "span_ids": ["TestNoMetrics.test", "TestNoMetrics.test_cli", "TestNoMetrics", "TestMetricsCLI.test_wrong_type_show"], "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 TestMetricsCLI(TestMetricsBase):\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 assert ret == 0\n\n self._caplog.clear()\n\n ret = main(\n [\"metrics\", \"show\", \"metric.unknown\", \"-t\", \"unknown\", \"-x\", \"0,0\"]\n )\n assert ret == 0\n assert \"\\tmetric.unknown: unknown\" in self._caplog.text\n\n\nclass TestNoMetrics(TestDvcGit):\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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestCachedMetrics_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/func/test_metrics.py_TestCachedMetrics_TestCachedMetrics._do_add.self_dvc_scm_commit_branc", "embedding": null, "metadata": {"file_path": "tests/func/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 640, "end_line": 656, "span_ids": ["TestCachedMetrics._do_add", "TestCachedMetrics"], "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 TestCachedMetrics(TestDvcGit):\n def _do_add(self, branch):\n self.dvc.scm.checkout(branch)\n self.dvc.checkout(force=True)\n assert not os.path.exists(\"metrics.json\")\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/func/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/func/test_metrics.py_TestCachedMetrics._do_run_TestCachedMetrics._do_run.self_dvc_scm_commit_branc", "embedding": null, "metadata": {"file_path": "tests/func/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 658, "end_line": 681, "span_ids": ["TestCachedMetrics._do_run"], "tokens": 194}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCachedMetrics(TestDvcGit):\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/func/test_metrics.py_TestCachedMetrics._test_metrics_TestCachedMetrics.test_run.self__test_metrics_self__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestCachedMetrics._test_metrics_TestCachedMetrics.test_run.self__test_metrics_self__", "embedding": null, "metadata": {"file_path": "tests/func/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 683, "end_line": 731, "span_ids": ["TestCachedMetrics.test_run", "TestCachedMetrics._test_metrics", "TestCachedMetrics.test_add"], "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": "class TestCachedMetrics(TestDvcGit):\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 \"working tree\": {\"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 \"working tree\": {\"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/func/test_metrics.py_TestMetricsType_TestMetricsType.setUp.self_dvc_scm_checkout_ma": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestMetricsType_TestMetricsType.setUp.self_dvc_scm_checkout_ma", "embedding": null, "metadata": {"file_path": "tests/func/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 734, "end_line": 773, "span_ids": ["TestMetricsType", "TestMetricsType.setUp"], "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 TestMetricsType(TestDvcGit):\n branches = [\"foo\", \"bar\", \"baz\"]\n files = [\n \"metric\",\n \"metric.txt\",\n \"metric.json\",\n \"metric.tsv\",\n \"metric.htsv\",\n \"metric.csv\",\n \"metric.hcsv\",\n ]\n xpaths = [None, None, \"branch\", \"0,0\", \"0,branch\", \"0,0\", \"0,branch\"]\n\n def setUp(self):\n super(TestMetricsType, self).setUp()\n self.dvc.scm.commit(\"init\")\n\n for branch in self.branches:\n self.dvc.scm.checkout(branch, create_new=True)\n with open(\"metric\", \"w+\") as fd:\n fd.write(branch)\n with open(\"metric.txt\", \"w+\") as fd:\n fd.write(branch)\n with open(\"metric.json\", \"w+\") as fd:\n json.dump({\"branch\": branch}, fd)\n with open(\"metric.csv\", \"w+\") as fd:\n fd.write(branch)\n with open(\"metric.hcsv\", \"w+\") as fd:\n fd.write(\"branch\\n\")\n fd.write(branch)\n with open(\"metric.tsv\", \"w+\") as fd:\n fd.write(branch)\n with open(\"metric.htsv\", \"w+\") as fd:\n fd.write(\"branch\\n\")\n fd.write(branch)\n self.dvc.run(metrics_no_cache=self.files, overwrite=True)\n self.dvc.scm.add(self.files + [\"metric.dvc\"])\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/func/test_move.py_os_TestMoveNotDataSource.test.self_assertNotEqual_ret_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_os_TestMoveNotDataSource.test.self_assertNotEqual_ret_", "embedding": null, "metadata": {"file_path": "tests/func/test_move.py", "file_name": "test_move.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 62, "span_ids": ["TestMove", "TestMoveNotDataSource", "TestMoveNonExistentFile", "imports", "TestCmdMove.test", "TestMoveNotDataSource.test", "TestMove.test", "TestMoveNonExistentFile.test", "TestMoveDirectory.test", "TestMoveDirectory", "TestCmdMove"], "tokens": 431}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nfrom dvc.main import main\nfrom dvc.exceptions import DvcException, MoveNotDataSourceError\nfrom dvc.stage import Stage\nfrom dvc.utils.stage import load_stage_file\n\nfrom tests.basic_env import TestDvc, TestDvcGit\nfrom tests.func.test_repro import TestRepro\nfrom tests.utils import cd\n\n\nclass TestMove(TestDvc):\n def test(self):\n dst = self.FOO + \"1\"\n self.dvc.add(self.FOO)\n self.dvc.move(self.FOO, dst)\n\n self.assertFalse(os.path.isfile(self.FOO))\n self.assertTrue(os.path.isfile(dst))\n\n\nclass TestMoveNonExistentFile(TestDvc):\n def test(self):\n with self.assertRaises(DvcException):\n self.dvc.move(\"non_existent_file\", \"dst\")\n\n\nclass TestMoveDirectory(TestDvc):\n def test(self):\n dst = \"dst\"\n stages = self.dvc.add(self.DATA_DIR)\n self.assertEqual(len(stages), 1)\n self.assertTrue(stages[0] is not None)\n self.dvc.move(self.DATA_DIR, dst)\n self.assertFalse(os.path.exists(self.DATA_DIR))\n self.assertTrue(os.path.exists(dst))\n\n\nclass TestCmdMove(TestDvc):\n def test(self):\n stages = self.dvc.add(self.FOO)\n self.assertEqual(len(stages), 1)\n self.assertTrue(stages[0] is not None)\n\n ret = main([\"move\", self.FOO, self.FOO + \"1\"])\n self.assertEqual(ret, 0)\n\n ret = main([\"move\", \"non-existing-file\", \"dst\"])\n self.assertNotEqual(ret, 0)\n\n\nclass TestMoveNotDataSource(TestRepro):\n def test(self):\n from dvc.repo import Repo as DvcRepo\n\n self.dvc = DvcRepo(self._root_dir)\n with self.assertRaises(MoveNotDataSourceError):\n self.dvc.move(self.file1, \"dst\")\n\n ret = main([\"move\", self.file1, \"dst\"])\n self.assertNotEqual(ret, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveFileWithExtension_TestMoveFileWithExtension.test.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveFileWithExtension_TestMoveFileWithExtension.test.None_7", "embedding": null, "metadata": {"file_path": "tests/func/test_move.py", "file_name": "test_move.py", "file_type": "text/x-python", "category": "test", "start_line": 65, "end_line": 81, "span_ids": ["TestMoveFileWithExtension", "TestMoveFileWithExtension.test"], "tokens": 149}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestMoveFileWithExtension(TestDvc):\n def test(self):\n with open(os.path.join(self.dvc.root_dir, \"file.csv\"), \"w\") as fd:\n fd.write(\"1,2,3\\n\")\n\n self.dvc.add(\"file.csv\")\n\n self.assertTrue(os.path.exists(\"file.csv\"))\n self.assertTrue(os.path.exists(\"file.csv.dvc\"))\n\n ret = main([\"move\", \"file.csv\", \"other_name.csv\"])\n self.assertEqual(ret, 0)\n\n self.assertFalse(os.path.exists(\"file.csv\"))\n self.assertFalse(os.path.exists(\"file.csv.dvc\"))\n self.assertTrue(os.path.exists(\"other_name.csv\"))\n self.assertTrue(os.path.exists(\"other_name.csv.dvc\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveFileToDirectory_TestMoveFileToDirectory.test.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveFileToDirectory_TestMoveFileToDirectory.test.None_6", "embedding": null, "metadata": {"file_path": "tests/func/test_move.py", "file_name": "test_move.py", "file_type": "text/x-python", "category": "test", "start_line": 84, "end_line": 99, "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/func/test_move.py_TestMoveFileToDirectoryWithoutSpecifiedTargetName_TestMoveFileToDirectoryWithoutSpecifiedTargetName.test.self_assertEqual_self_FOO": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveFileToDirectoryWithoutSpecifiedTargetName_TestMoveFileToDirectoryWithoutSpecifiedTargetName.test.self_assertEqual_self_FOO", "embedding": null, "metadata": {"file_path": "tests/func/test_move.py", "file_name": "test_move.py", "file_type": "text/x-python", "category": "test", "start_line": 102, "end_line": 122, "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/func/test_move.py_TestMoveDirectoryShouldNotOverwriteExisting_TestMoveDirectoryShouldNotOverwriteExisting.test.self_assertEqual_set_os_l": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveDirectoryShouldNotOverwriteExisting_TestMoveDirectoryShouldNotOverwriteExisting.test.self_assertEqual_set_os_l", "embedding": null, "metadata": {"file_path": "tests/func/test_move.py", "file_name": "test_move.py", "file_type": "text/x-python", "category": "test", "start_line": 125, "end_line": 149, "span_ids": ["TestMoveDirectoryShouldNotOverwriteExisting", "TestMoveDirectoryShouldNotOverwriteExisting.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 TestMoveDirectoryShouldNotOverwriteExisting(TestDvcGit):\n def test(self):\n dir_name = \"dir\"\n orig_listdir = set(os.listdir(self.DATA_DIR))\n\n self.dvc.add(self.DATA_DIR)\n\n os.mkdir(dir_name)\n new_dir_name = os.path.join(dir_name, self.DATA_DIR)\n\n self.dvc.move(self.DATA_DIR, dir_name)\n\n data_dir_stage = self.DATA_DIR + Stage.STAGE_FILE_SUFFIX\n self.assertFalse(os.path.exists(self.DATA_DIR))\n self.assertFalse(os.path.exists(data_dir_stage))\n\n self.assertTrue(os.path.exists(dir_name))\n self.assertEqual(\n set(os.listdir(dir_name)),\n set([\".gitignore\", data_dir_stage, self.DATA_DIR]),\n )\n\n self.assertTrue(os.path.exists(new_dir_name))\n self.assertTrue(os.path.isfile(new_dir_name + Stage.STAGE_FILE_SUFFIX))\n self.assertEqual(set(os.listdir(new_dir_name)), orig_listdir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveFileBetweenDirectories_TestMoveFileBetweenDirectories.test.self_assertEqual_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveFileBetweenDirectories_TestMoveFileBetweenDirectories.test.self_assertEqual_", "embedding": null, "metadata": {"file_path": "tests/func/test_move.py", "file_name": "test_move.py", "file_type": "text/x-python", "category": "test", "start_line": 154, "end_line": 179, "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/func/test_move.py_TestMoveFileInsideDirectory_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_move.py_TestMoveFileInsideDirectory_", "embedding": null, "metadata": {"file_path": "tests/func/test_move.py", "file_name": "test_move.py", "file_type": "text/x-python", "category": "test", "start_line": 182, "end_line": 197, "span_ids": ["TestMoveFileInsideDirectory", "TestMoveFileInsideDirectory.test"], "tokens": 130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestMoveFileInsideDirectory(TestDvc):\n def test(self):\n ret = main([\"add\", self.DATA])\n self.assertEqual(ret, 0)\n\n with cd(self.DATA_DIR):\n ret = main([\"move\", os.path.basename(self.DATA), \"data.txt\"])\n self.assertEqual(ret, 0)\n\n self.assertFalse(os.path.exists(self.DATA))\n\n data_fullpath = os.path.join(self.DATA_DIR, \"data.txt\")\n dvc_fullpath = os.path.join(self.DATA_DIR, \"data.txt.dvc\")\n self.assertTrue(os.path.exists(data_fullpath))\n self.assertTrue(os.path.exists(dvc_fullpath))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_output.py_pytest_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_output.py_pytest_", "embedding": null, "metadata": {"file_path": "tests/func/test_output.py", "file_name": "test_output.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 30, "span_ids": ["imports", "test_scheme", "_get_out"], "tokens": 215}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\n\nfrom dvc.stage import Stage\nfrom dvc.output import _get, OUTS_MAP\n\n\nTESTS = [\n (\"s3://bucket/path\", \"s3\"),\n (\"gs://bucket/path\", \"gs\"),\n (\"ssh://example.com:/dir/path\", \"ssh\"),\n (\"hdfs://example.com/dir/path\", \"hdfs\"),\n (\"path/to/file\", \"local\"),\n (\"path\\\\to\\\\file\", \"local\"),\n (\"file\", \"local\"),\n (\"./file\", \"local\"),\n (\".\\\\file\", \"local\"),\n (\"../file\", \"local\"),\n (\"..\\\\file\", \"local\"),\n (\"unknown://path\", \"local\"),\n]\n\n\ndef _get_out(dvc, path):\n return _get(Stage(dvc), path, None, None, None, None)\n\n\n@pytest.mark.parametrize(\"url,scheme\", TESTS)\ndef test_scheme(dvc_repo, url, scheme):\n assert type(_get_out(dvc_repo, url)) == OUTS_MAP[scheme]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_logging_TestPipelineShowSingle.test_non_existing.self_assertNotEqual_ret_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_logging_TestPipelineShowSingle.test_non_existing.self_assertNotEqual_ret_", "embedding": null, "metadata": {"file_path": "tests/func/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 54, "span_ids": ["TestPipelineShowSingle.test_commands", "imports", "TestPipelineShowSingle.test_not_dvc_file", "TestPipelineShowSingle.test_outs", "TestPipelineShowSingle.test_non_existing", "TestPipelineShowSingle.test_tree", "TestPipelineShowSingle.test_dot_commands", "TestPipelineShowSingle", "TestPipelineShowSingle.setUp", "TestPipelineShowSingle.test", "TestPipelineShowSingle.test_ascii_outs", "TestPipelineShowSingle.test_dot_outs", "TestPipelineShowSingle.test_dot"], "tokens": 403}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\n\nfrom dvc.main import main\n\nfrom tests.basic_env import TestDvc\nfrom tests.func.test_repro import TestRepro, TestReproChangedDeepData\n\n\nclass TestPipelineShowSingle(TestDvc):\n def setUp(self):\n super(TestPipelineShowSingle, self).setUp()\n self.stage = \"foo.dvc\"\n ret = main([\"add\", self.FOO])\n self.assertEqual(ret, 0)\n\n def test(self):\n ret = main([\"pipeline\", \"show\", self.stage])\n self.assertEqual(ret, 0)\n\n def test_commands(self):\n ret = main([\"pipeline\", \"show\", self.stage, \"--commands\"])\n self.assertEqual(ret, 0)\n\n def test_outs(self):\n ret = main([\"pipeline\", \"show\", self.stage, \"--outs\"])\n self.assertEqual(ret, 0)\n\n def test_dot(self):\n ret = main([\"pipeline\", \"show\", \"--dot\", self.stage])\n self.assertEqual(ret, 0)\n\n def test_tree(self):\n ret = main([\"pipeline\", \"show\", \"--tree\", self.stage])\n self.assertEqual(ret, 0)\n\n def test_ascii_outs(self):\n ret = main([\"pipeline\", \"show\", \"--ascii\", self.stage, \"--outs\"])\n self.assertEqual(ret, 0)\n\n def test_dot_commands(self):\n ret = main([\"pipeline\", \"show\", \"--dot\", self.stage, \"--commands\"])\n self.assertEqual(ret, 0)\n\n def test_dot_outs(self):\n ret = main([\"pipeline\", \"show\", \"--dot\", self.stage, \"--outs\"])\n self.assertEqual(ret, 0)\n\n def test_not_dvc_file(self):\n ret = main([\"pipeline\", \"show\", self.FOO])\n self.assertNotEqual(ret, 0)\n\n def test_non_existing(self):\n ret = main([\"pipeline\", \"show\", \"non-existing\"])\n self.assertNotEqual(ret, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_TestPipelineListEmpty_TestDvcRepoPipeline.one_pipeline.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_TestPipelineListEmpty_TestDvcRepoPipeline.one_pipeline.None_5", "embedding": null, "metadata": {"file_path": "tests/func/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 244, "end_line": 269, "span_ids": ["TestPipelineListEmpty", "TestPipelineListSingle.test", "TestDvcRepoPipeline.one_pipeline", "TestPipelineListSingle", "TestPipelineListEmpty.test", "TestDvcRepoPipeline", "TestDvcRepoPipeline.test_no_stages"], "tokens": 198}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestPipelineListEmpty(TestDvc):\n def test(self):\n ret = main([\"pipeline\", \"list\"])\n self.assertEqual(ret, 0)\n\n\nclass TestPipelineListSingle(TestPipelineShowDeep):\n def test(self):\n ret = main([\"pipeline\", \"list\"])\n self.assertEqual(ret, 0)\n\n\nclass TestDvcRepoPipeline(TestDvc):\n def test_no_stages(self):\n pipelines = self.dvc.pipelines()\n self.assertEqual(len(pipelines), 0)\n\n def one_pipeline(self):\n self.dvc.add(\"foo\")\n self.dvc.run(deps=[\"foo\"], outs=[\"bar\"], cmd=\"\")\n self.dvc.run(deps=[\"bar\"], outs=[\"baz\"], cmd=\"echo baz > baz\")\n pipelines = self.dvc.pipelines()\n\n self.assertEqual(len(pipelines), 1)\n self.assertEqual(pipelines[0].nodes, 3)\n self.assertEqual(pipelines[0].edges, 2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_TestDvcRepoPipeline.two_pipelines_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_TestDvcRepoPipeline.two_pipelines_", "embedding": null, "metadata": {"file_path": "tests/func/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 271, "end_line": 292, "span_ids": ["TestDvcRepoPipeline.two_pipelines", "TestDvcRepoPipeline.locked_stage"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestDvcRepoPipeline(TestDvc):\n\n def two_pipelines(self):\n self.dvc.add(\"foo\")\n self.dvc.run(deps=[\"foo\"], outs=[\"bar\"], cmd=\"\")\n self.dvc.run(deps=[\"bar\"], outs=[\"baz\"], cmd=\"echo baz > baz\")\n\n self.dvc.add(\"code.py\")\n\n pipelines = self.dvc.pipelines()\n\n self.assertEqual(len(pipelines), 2)\n self.assertEqual(pipelines[0].nodes, 3)\n self.assertEqual(pipelines[0].edges, 2)\n self.assertEqual(pipelines[1].nodes, 1)\n self.assertEqual(pipelines[1].edges, 0)\n\n def locked_stage(self):\n self.dvc.add(\"foo\")\n self.dvc.lock_stage(\"foo.dvc\")\n\n pipelines = self.dvc.pipelines()\n self.assertEqual(len(pipelines), 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_os_TestRemote.test.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_os_TestRemote.test.None_5", "embedding": null, "metadata": {"file_path": "tests/func/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 36, "span_ids": ["imports", "TestRemote.test", "TestRemote"], "tokens": 253}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport configobj\nimport shutil\nfrom mock import patch\n\nfrom dvc.main import main\nfrom dvc.config import Config\nfrom dvc.remote.base import RemoteBASE\nfrom dvc.remote import RemoteLOCAL\nfrom dvc.path_info import PathInfo\n\nfrom tests.basic_env import TestDvc\nfrom tests.func.test_data_cloud import get_local_storagepath\nfrom .test_data_cloud import get_local_url\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/func/test_remote.py_TestRemote.test_overwrite_TestRemote.test_referencing_other_remotes.assert_config_remote_ba": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_TestRemote.test_overwrite_TestRemote.test_referencing_other_remotes.assert_config_remote_ba", "embedding": null, "metadata": {"file_path": "tests/func/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 46, "end_line": 61, "span_ids": ["TestRemote.test_overwrite", "TestRemote.test_referencing_other_remotes"], "tokens": 187}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRemote(TestDvc):\n\n def test_overwrite(self):\n remote_name = \"a\"\n remote_url = \"s3://bucket/name\"\n self.assertEqual(main([\"remote\", \"add\", remote_name, remote_url]), 0)\n self.assertEqual(main([\"remote\", \"add\", remote_name, remote_url]), 251)\n self.assertEqual(\n main([\"remote\", \"add\", \"-f\", remote_name, remote_url]), 0\n )\n\n def test_referencing_other_remotes(self):\n assert main([\"remote\", \"add\", \"foo\", \"ssh://localhost/\"]) == 0\n assert main([\"remote\", \"add\", \"bar\", \"remote://foo/dvc-storage\"]) == 0\n\n config = configobj.ConfigObj(self.dvc.config.config_file)\n\n assert config['remote \"bar\"'][\"url\"] == \"remote://foo/dvc-storage\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_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/func/test_remote.py_TestRemoteRemoveDefault_TestRemoteRemoveDefault.test.None_1.self_assertTrue_Config_SE", "embedding": null, "metadata": {"file_path": "tests/func/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 78, "end_line": 119, "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/func/test_remote.py_TestRemoteRemove_TestRemoteDefault.test.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_TestRemoteRemove_TestRemoteDefault.test.None_4", "embedding": null, "metadata": {"file_path": "tests/func/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 122, "end_line": 156, "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/func/test_remove.py_os_TestRemove.test.None_8": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remove.py_os_TestRemove.test.None_8", "embedding": null, "metadata": {"file_path": "tests/func/test_remove.py", "file_name": "test_remove.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 29, "span_ids": ["imports", "TestRemove", "TestRemove.test"], "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 os\nimport shutil\n\nfrom dvc.main import main\nfrom dvc.system import System\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/func/test_remove.py_TestRemoveNonExistentFile_TestRemoveBrokenSymlink.test.self_assertFalse_os_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remove.py_TestRemoveNonExistentFile_TestRemoveBrokenSymlink.test.self_assertFalse_os_path_", "embedding": null, "metadata": {"file_path": "tests/func/test_remove.py", "file_name": "test_remove.py", "file_type": "text/x-python", "category": "test", "start_line": 32, "end_line": 53, "span_ids": ["TestRemoveNonExistentFile", "TestRemoveBrokenSymlink", "TestRemoveBrokenSymlink.test", "TestRemoveNonExistentFile.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 TestRemoveNonExistentFile(TestDvc):\n def test(self):\n with self.assertRaises(StageFileDoesNotExistError):\n self.dvc.remove(\"non_existent_dvc_file\")\n\n\nclass TestRemoveBrokenSymlink(TestDvc):\n def test(self):\n ret = main([\"config\", \"cache.type\", \"symlink\"])\n self.assertEqual(ret, 0)\n\n ret = main([\"add\", self.FOO])\n self.assertEqual(ret, 0)\n\n shutil.rmtree(self.dvc.cache.local.cache_dir)\n\n self.assertTrue(System.is_symlink(self.FOO))\n\n ret = main([\"remove\", self.FOO + \".dvc\"])\n self.assertEqual(ret, 0)\n\n self.assertFalse(os.path.lexists(self.FOO))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remove.py_TestRemoveDirectory_TestCmdRemove.test.self_assertNotEqual_ret_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remove.py_TestRemoveDirectory_TestCmdRemove.test.self_assertNotEqual_ret_", "embedding": null, "metadata": {"file_path": "tests/func/test_remove.py", "file_name": "test_remove.py", "file_type": "text/x-python", "category": "test", "start_line": 56, "end_line": 78, "span_ids": ["TestRemoveDirectory", "TestCmdRemove.test", "TestRemoveDirectory.test", "TestCmdRemove"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRemoveDirectory(TestDvc):\n def test(self):\n stages = self.dvc.add(self.DATA_DIR)\n self.assertEqual(len(stages), 1)\n stage_add = stages[0]\n self.assertTrue(stage_add is not None)\n stage_removed = self.dvc.remove(stage_add.path)\n self.assertEqual(stage_add.path, stage_removed.path)\n self.assertFalse(os.path.exists(self.DATA_DIR))\n self.assertFalse(os.path.exists(stage_removed.path))\n\n\nclass TestCmdRemove(TestDvc):\n def test(self):\n stages = self.dvc.add(self.FOO)\n self.assertEqual(len(stages), 1)\n stage = stages[0]\n self.assertTrue(stage is not None)\n ret = main([\"remove\", stage.path])\n self.assertEqual(ret, 0)\n\n ret = main([\"remove\", \"non-existing-dvc-file\"])\n self.assertNotEqual(ret, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remove.py_TestRemovePurge_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remove.py_TestRemovePurge_", "embedding": null, "metadata": {"file_path": "tests/func/test_remove.py", "file_name": "test_remove.py", "file_type": "text/x-python", "category": "test", "start_line": 81, "end_line": 98, "span_ids": ["TestRemovePurge.test_force", "TestRemovePurge", "TestRemovePurge.test"], "tokens": 152}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRemovePurge(TestDvc):\n def test(self):\n dvcfile = self.dvc.add(self.FOO)[0].path\n ret = main([\"remove\", \"--purge\", \"--force\", dvcfile])\n\n self.assertEqual(ret, 0)\n self.assertFalse(os.path.exists(self.FOO))\n self.assertFalse(os.path.exists(dvcfile))\n\n @patch(\"dvc.prompt.confirm\", return_value=False)\n def test_force(self, mock_prompt):\n dvcfile = self.dvc.add(self.FOO)[0].path\n ret = main([\"remove\", \"--purge\", dvcfile])\n\n mock_prompt.assert_called()\n self.assertEqual(ret, 1)\n self.assertRaises(DvcException)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_from_dvc_main_import_main_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/func/test_repo.py_from_dvc_main_import_main_TestCollect.setUp.self_dvc_scm_checkout_ma", "embedding": null, "metadata": {"file_path": "tests/func/test_repo.py", "file_name": "test_repo.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 28, "span_ids": ["imports", "TestCollect.setUp", "TestCollect"], "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": "from dvc.main import main\nfrom dvc.stage import Stage\nfrom tests.basic_env import TestDvcGit\n\nfrom dvc.scm.git import GitTree\nfrom dvc.scm.tree import WorkingTree\n\n\nclass TestCollect(TestDvcGit):\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/func/test_repo.py_TestIgnore_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_TestIgnore_", "embedding": null, "metadata": {"file_path": "tests/func/test_repo.py", "file_name": "test_repo.py", "file_type": "text/x-python", "category": "test", "start_line": 49, "end_line": 71, "span_ids": ["TestIgnore.test_should_not_gather_stage_files_from_ignored_d", "TestIgnore", "TestIgnore._stage_name"], "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 TestIgnore(TestDvcGit):\n def _stage_name(self, file):\n return file + Stage.STAGE_FILE_SUFFIX\n\n def test_should_not_gather_stage_files_from_ignored_d(self):\n ret = main([\"add\", self.FOO, self.BAR, self.DATA, self.DATA_SUB])\n self.assertEqual(0, ret)\n\n stages = self.dvc.stages()\n self.assertEqual(4, len(stages))\n\n with open(\".dvcignore\", \"w\") as fobj:\n fobj.write(\"data_dir\")\n\n stages = self.dvc.stages()\n self.assertEqual(2, len(stages))\n\n stagenames = [s.relpath for s in stages]\n self.assertIn(self._stage_name(self.FOO), stagenames)\n self.assertIn(self._stage_name(self.BAR), stagenames)\n self.assertNotIn(self._stage_name(self.DATA), stagenames)\n self.assertNotIn(self._stage_name(self.DATA_SUB), stagenames)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_from___future___import_un_from_mock_import_patch": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_from___future___import_un_from_mock_import_patch", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 40, "span_ids": ["imports"], "tokens": 288}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import unicode_literals\nfrom dvc.utils.compat import str, urljoin, pathlib\n\nimport os\nimport re\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\nimport pytest\n\nfrom dvc.main import main\nfrom dvc.repo import Repo as DvcRepo\nfrom dvc.utils import file_md5, relpath\nfrom dvc.utils.stage import load_stage_file, dump_stage_file\nfrom dvc.path_info import URLInfo\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.func.test_data_cloud import _should_test_aws, TEST_AWS_REPO_BUCKET\nfrom tests.func.test_data_cloud import _should_test_gcp, TEST_GCP_REPO_BUCKET\nfrom tests.func.test_data_cloud import _should_test_ssh, _should_test_hdfs\nfrom tests.func.test_data_cloud import get_ssh_url\nfrom tests.utils.httpd import StaticFileServer\nfrom mock import 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/tests/func/test_repro.py_TestRepro_TestReproFail.test.self_assertNotEqual_ret_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestRepro_TestReproFail.test.self_assertNotEqual_ret_", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 41, "end_line": 65, "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/func/test_repro.py_TestReproCyclicGraph_TestReproCyclicGraph.test.with_self_assertRaises_Cy.self_dvc_reproduce_cycle": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproCyclicGraph_TestReproCyclicGraph.test.with_self_assertRaises_Cy.self_dvc_reproduce_cycle", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 68, "end_line": 86, "span_ids": ["TestReproCyclicGraph.test", "TestReproCyclicGraph"], "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 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 stage_dump = {\n \"cmd\": \"echo baz > foo\",\n \"deps\": [{\"path\": \"baz.txt\"}],\n \"outs\": [{\"path\": self.FOO}],\n }\n dump_stage_file(\"cycle.dvc\", stage_dump)\n\n with self.assertRaises(CyclicGraphError):\n self.dvc.reproduce(\"cycle.dvc\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproWorkingDirectoryAsOutput_TestReproWorkingDirectoryAsOutput.test.with_self_assertRaises_St.self_dvc_reproduce_faulty": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproWorkingDirectoryAsOutput_TestReproWorkingDirectoryAsOutput.test.with_self_assertRaises_St.self_dvc_reproduce_faulty", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 89, "end_line": 125, "span_ids": ["TestReproWorkingDirectoryAsOutput.test", "TestReproWorkingDirectoryAsOutput"], "tokens": 315}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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 output = os.path.join(\"..\", \"something\")\n stage_dump = {\n \"cmd\": \"echo something > {}\".format(output),\n \"outs\": [{\"path\": output}],\n }\n dump_stage_file(faulty_stage_path, stage_dump)\n\n with self.assertRaises(StagePathAsOutputError):\n self.dvc.reproduce(faulty_stage_path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproWorkingDirectoryAsOutput.test_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/func/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/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 129, "end_line": 172, "span_ids": ["TestReproWorkingDirectoryAsOutput.test_nested"], "tokens": 373}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproWorkingDirectoryAsOutput(TestDvc):\n\n def test_nested(self):\n # .\n # |-- a\n # | |__ nested\n # | |__ dir\n # | |__ error.dvc (stage.cwd == 'a/nested/dir')\n # |__ b\n # |__ nested.dvc (stage.out == 'a/nested')\n dir1 = \"b\"\n dir2 = \"a\"\n\n os.mkdir(dir1)\n os.mkdir(dir2)\n\n nested_dir = os.path.join(dir2, \"nested\")\n out_dir = relpath(nested_dir, dir1)\n\n nested_stage = self.dvc.run(\n 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 output = os.path.join(\"..\", \"..\", \"something\")\n stage_dump = {\n \"cmd\": \"echo something > {}\".format(output),\n \"outs\": [{\"path\": output}],\n }\n dump_stage_file(error_stage_path, stage_dump)\n\n # NOTE: os.walk() walks in a sorted order and we need dir2 subdirs to\n # be processed before dir1 to load error.dvc first.\n 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/func/test_repro.py_TestReproWorkingDirectoryAsOutput.test_similar_paths_TestReproWorkingDirectoryAsOutput.test_similar_paths.try_.except_StagePathAsOutputE.self_fail_should_not_rai": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproWorkingDirectoryAsOutput.test_similar_paths_TestReproWorkingDirectoryAsOutput.test_similar_paths.try_.except_StagePathAsOutputE.self_fail_should_not_rai", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 175, "end_line": 197, "span_ids": ["TestReproWorkingDirectoryAsOutput.test_similar_paths"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproWorkingDirectoryAsOutput(TestDvc):\n\n def test_similar_paths(self):\n # File structure:\n #\n # .\n # |-- something.dvc (out.path == something)\n # |-- something\n # |__ something-1\n # |-- a\n # |__ a.dvc (stage.cwd == something-1)\n\n self.dvc.run(outs=[\"something\"], cmd=\"mkdir something\")\n\n os.mkdir(\"something-1\")\n\n stage = os.path.join(\"something-1\", \"a.dvc\")\n\n stage_dump = {\"cmd\": \"echo a > a\", \"outs\": [{\"path\": \"a\"}]}\n dump_stage_file(stage, stage_dump)\n\n try:\n self.dvc.reproduce(stage)\n except StagePathAsOutputError:\n self.fail(\"should not raise StagePathAsOutputError\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproDepUnderDir_TestReproDepUnderDir.test.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproDepUnderDir_TestReproDepUnderDir.test.None_7", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 200, "end_line": 223, "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/func/test_repro.py_TestReproDepDirWithOutputsUnderIt_TestReproDepDirWithOutputsUnderIt.test.None_8": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproDepDirWithOutputsUnderIt_TestReproDepDirWithOutputsUnderIt.test.None_8", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 226, "end_line": 253, "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/func/test_repro.py_TestReproNoDeps_TestReproNoDeps.test.self_assertEqual_len_stag": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproNoDeps_TestReproNoDeps.test.self_assertEqual_len_stag", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 256, "end_line": 272, "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/func/test_repro.py_TestReproForce_TestReproChangedCode.swap_code.self_create_self_CODE_ne": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproForce_TestReproChangedCode.swap_code.self_create_self_CODE_ne", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 275, "end_line": 296, "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/func/test_repro.py_TestReproChangedData_TestReproUpToDate.test.self_assertEqual_ret_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproChangedData_TestReproUpToDate.test.self_assertEqual_ret_0_", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 299, "end_line": 330, "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/func/test_repro.py_TestReproDryNoExec_TestReproDryNoExec.test.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproDryNoExec_TestReproDryNoExec.test.None_1", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 333, "end_line": 367, "span_ids": ["TestReproDryNoExec.test", "TestReproDryNoExec"], "tokens": 221}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproDryNoExec(TestDvc):\n def test(self):\n deps = []\n for d in range(3):\n idir = \"idir{}\".format(d)\n odir = \"odir{}\".format(d)\n\n deps.append(\"-d\")\n deps.append(odir)\n\n os.mkdir(idir)\n\n f = os.path.join(idir, \"file\")\n with open(f, \"w+\") as fobj:\n fobj.write(str(d))\n\n ret = main(\n [\n \"run\",\n \"--no-exec\",\n \"-d\",\n idir,\n \"-o\",\n odir,\n \"python -c 'import shutil; \"\n 'shutil.copytree(\"{}\", \"{}\")\\''.format(idir, odir),\n ]\n )\n self.assertEqual(ret, 0)\n\n ret = main([\"run\", \"--no-exec\", \"-f\", \"Dvcfile\"] + deps)\n self.assertEqual(ret, 0)\n\n ret = main([\"repro\", \"--dry\"])\n self.assertEqual(ret, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproChangedDeepData_TestReproChangedDeepData.test.self_assertEqual_len_stag": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproChangedDeepData_TestReproChangedDeepData.test.self_assertEqual_len_stag", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 370, "end_line": 390, "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/func/test_repro.py_TestReproIgnoreBuildCache_TestReproIgnoreBuildCache.test.self_assertEqual_stages_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproIgnoreBuildCache_TestReproIgnoreBuildCache.test.self_assertEqual_stages_1", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 393, "end_line": 436, "span_ids": ["TestReproIgnoreBuildCache.test", "TestReproIgnoreBuildCache"], "tokens": 378}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproIgnoreBuildCache(TestDvc):\n def test(self):\n stages = self.dvc.add(self.FOO)\n self.assertEqual(len(stages), 1)\n foo_stage = stages[0]\n self.assertTrue(foo_stage is not None)\n\n code1 = \"code1.py\"\n shutil.copyfile(self.CODE, code1)\n file1 = \"file1\"\n file1_stage = self.dvc.run(\n outs=[file1],\n deps=[self.FOO, code1],\n cmd=\"python {} {} {}\".format(code1, self.FOO, file1),\n )\n self.assertTrue(file1_stage is not None)\n\n code2 = \"code2.py\"\n shutil.copyfile(self.CODE, code2)\n file2 = \"file2\"\n file2_stage = self.dvc.run(\n outs=[file2],\n deps=[file1, code2],\n cmd=\"python {} {} {}\".format(code2, file1, file2),\n )\n self.assertTrue(file2_stage is not None)\n\n code3 = \"code3.py\"\n shutil.copyfile(self.CODE, code3)\n file3 = \"file3\"\n file3_stage = self.dvc.run(\n outs=[file3],\n deps=[file2, code3],\n cmd=\"python {} {} {}\".format(code3, file2, file3),\n )\n self.assertTrue(file3_stage is not None)\n\n with open(code2, \"a\") as fobj:\n fobj.write(\"\\n\\n\")\n\n stages = self.dvc.reproduce(file3_stage.path, ignore_build_cache=True)\n self.assertEqual(len(stages), 2)\n self.assertEqual(stages[0].path, file2_stage.path)\n self.assertEqual(stages[1].path, file3_stage.path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproPipeline_TestReproPipelines.setUp.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproPipeline_TestReproPipelines.setUp.None_6", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 439, "end_line": 481, "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/func/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/func/test_repro.py_TestReproPipelines.test_TestReproPipelines.test_cli.self_assertEqual_ret_0_", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 483, "end_line": 494, "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/func/test_repro.py_TestReproLocked_TestReproLocked.test_non_existing.self_assertNotEqual_ret_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproLocked_TestReproLocked.test_non_existing.self_assertNotEqual_ret_", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 497, "end_line": 527, "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/func/test_repro.py_TestReproLockedCallback_TestReproLockedUnchanged.test.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproLockedCallback_TestReproLockedUnchanged.test.None_3", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 530, "end_line": 567, "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/func/test_repro.py_TestReproMetricsAddUnchanged_TestReproMetricsAddUnchanged.test.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproMetricsAddUnchanged_TestReproMetricsAddUnchanged.test.None_7", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 570, "end_line": 597, "span_ids": ["TestReproMetricsAddUnchanged.test", "TestReproMetricsAddUnchanged"], "tokens": 221}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproMetricsAddUnchanged(TestDvc):\n def test(self):\n \"\"\"\n Check that adding/removing metrics doesn't affect stage state\n \"\"\"\n stages = self.dvc.add(self.FOO)\n self.assertEqual(len(stages), 1)\n self.assertTrue(stages[0] is not None)\n\n file1 = \"file1\"\n file1_stage = file1 + \".dvc\"\n self.dvc.run(\n fname=file1_stage,\n outs_no_cache=[file1],\n deps=[self.FOO, self.CODE],\n cmd=\"python {} {} {}\".format(self.CODE, self.FOO, file1),\n )\n\n stages = self.dvc.reproduce(file1_stage)\n self.assertEqual(len(stages), 0)\n\n self.dvc.metrics.add(file1)\n stages = self.dvc.reproduce(file1_stage)\n self.assertEqual(len(stages), 0)\n\n self.dvc.metrics.remove(file1)\n stages = self.dvc.reproduce(file1_stage)\n self.assertEqual(len(stages), 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproPhony_TestReproDataSource.test.self_assertEqual_stages_0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproPhony_TestReproDataSource.test.self_assertEqual_stages_0", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 600, "end_line": 626, "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/func/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/func/test_repro.py_TestReproChangedDir_TestReproChangedDir.test.None_5", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 629, "end_line": 659, "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/func/test_repro.py_TestReproChangedDirData_TestReproChangedDirData.test.None_9": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproChangedDirData_TestReproChangedDirData.test.None_9", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 662, "end_line": 700, "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/func/test_repro.py_TestReproMissingMd5InStageFile_TestCmdRepro.test.self_assertNotEqual_ret_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproMissingMd5InStageFile_TestCmdRepro.test.self_assertNotEqual_ret_", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 703, "end_line": 725, "span_ids": ["TestReproMissingMd5InStageFile.test", "TestCmdRepro.test", "TestReproMissingMd5InStageFile", "TestCmdRepro"], "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 TestReproMissingMd5InStageFile(TestRepro):\n def test(self):\n d = load_stage_file(self.file1_stage)\n del d[Stage.PARAM_OUTS][0][RemoteLOCAL.PARAM_CHECKSUM]\n del d[Stage.PARAM_DEPS][0][RemoteLOCAL.PARAM_CHECKSUM]\n dump_stage_file(self.file1_stage, d)\n\n stages = self.dvc.reproduce(self.file1_stage)\n self.assertEqual(len(stages), 1)\n\n\nclass TestCmdRepro(TestReproChangedData):\n def test(self):\n self.swap_foo_with_bar()\n\n ret = main([\"status\"])\n self.assertEqual(ret, 0)\n\n ret = main([\"repro\", self.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/func/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/func/test_repro.py_TestCmdReproChdirCwdBackwardCompatible_TestCmdReproChdirCwdBackwardCompatible.test.None_11", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 728, "end_line": 763, "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/func/test_repro.py_TestCmdReproChdir_TestCmdReproChdir.test.None_11": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestCmdReproChdir_TestCmdReproChdir.test.None_11", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 766, "end_line": 801, "span_ids": ["TestCmdReproChdir.test", "TestCmdReproChdir"], "tokens": 258}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCmdReproChdir(TestDvc):\n def test(self):\n dname = \"dir\"\n os.mkdir(dname)\n foo = os.path.join(dname, self.FOO)\n bar = os.path.join(dname, self.BAR)\n code = os.path.join(dname, self.CODE)\n shutil.copyfile(self.FOO, foo)\n shutil.copyfile(self.CODE, code)\n\n ret = main(\n [\n \"run\",\n \"-f\",\n \"{}/Dvcfile\".format(dname),\n \"-w\",\n \"{}\".format(dname),\n \"-d\",\n self.FOO,\n \"-o\",\n self.BAR,\n \"python {} {} {}\".format(self.CODE, self.FOO, self.BAR),\n ]\n )\n self.assertEqual(ret, 0)\n self.assertTrue(os.path.isfile(foo))\n self.assertTrue(os.path.isfile(bar))\n self.assertTrue(filecmp.cmp(foo, bar, shallow=False))\n\n os.unlink(bar)\n\n ret = main([\"repro\", \"-c\", dname])\n self.assertEqual(ret, 0)\n self.assertTrue(os.path.isfile(foo))\n self.assertTrue(os.path.isfile(bar))\n self.assertTrue(filecmp.cmp(foo, bar, shallow=False))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_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/func/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/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 804, "end_line": 845, "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/func/test_repro.py_TestReproExternalBase.test_TestReproExternalBase.test.None_30": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalBase.test_TestReproExternalBase.test.None_30", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 847, "end_line": 944, "span_ids": ["TestReproExternalBase.test"], "tokens": 788}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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_url(out_foo_path, \"import\")\n\n self.assertTrue(os.path.exists(\"import\"))\n self.assertTrue(filecmp.cmp(\"import\", self.FOO, shallow=False))\n self.assertEqual(self.dvc.status(import_stage.path), {})\n self.check_already_cached(import_stage)\n\n import_remote_stage = self.dvc.imp_url(\n out_foo_path, out_foo_path + \"_imported\"\n )\n self.assertEqual(self.dvc.status(import_remote_stage.path), {})\n\n cmd_stage = self.dvc.run(\n outs=[out_bar_path],\n deps=[out_foo_path],\n cmd=self.cmd(foo_path, bar_path),\n )\n\n self.assertEqual(self.dvc.status(cmd_stage.path), {})\n self.assertEqual(self.dvc.status(), {})\n self.check_already_cached(cmd_stage)\n\n self.write(self.bucket, foo_key, self.BAR_CONTENTS)\n\n self.assertNotEqual(self.dvc.status(), {})\n\n 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), {})", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalS3_TestReproExternalGS.write.bucket_blob_key_upload_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalS3_TestReproExternalGS.write.bucket_blob_key_upload_f", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 946, "end_line": 985, "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": 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": "@pytest.mark.skipif(os.name == \"nt\", reason=\"temporarily disabled on windows\")\nclass 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/func/test_repro.py_TestReproExternalHDFS_TestReproExternalHDFS.write.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalHDFS_TestReproExternalHDFS.write.None_2", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 988, "end_line": 1044, "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/func/test_repro.py_TestReproExternalSSH_TestReproExternalSSH.cmd.return._scp_format_i_o_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalSSH_TestReproExternalSSH.cmd.return._scp_format_i_o_", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1047, "end_line": 1069, "span_ids": ["TestReproExternalSSH.scheme", "TestReproExternalSSH", "TestReproExternalSSH.cmd", "TestReproExternalSSH.bucket", "TestReproExternalSSH.should_test"], "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": "@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 prefix = \"ssh://\"\n assert i.startswith(prefix) and o.startswith(prefix)\n i = i[len(prefix) :]\n o = o[len(prefix) :]\n return \"scp {} {}\".format(i, o)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalSSH.write_TestReproExternalSSH.write.with_sftp_open_path_w_.fobj_write_body_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalSSH.write_TestReproExternalSSH.write.with_sftp_open_path_w_.fobj_write_body_", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1069, "end_line": 1090, "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/func/test_repro.py_TestReproExternalLOCAL_TestReproExternalLOCAL.write.with_open_path_w_as_.fd_write_body_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproExternalLOCAL_TestReproExternalLOCAL.write.with_open_path_w_as_.fd_write_body_", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1093, "end_line": 1137, "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/func/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/func/test_repro.py_TestReproExternalHTTP_TestReproExternalHTTP.test.None_12", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1142, "end_line": 1219, "span_ids": ["TestReproExternalHTTP.external_cache_id", "TestReproExternalHTTP.test", "TestReproExternalHTTP", "TestReproExternalHTTP.local_cache", "TestReproExternalHTTP.external_cache", "TestReproExternalHTTP.remote"], "tokens": 549}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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_url(import_url, import_output)\n\n self.assertTrue(os.path.exists(import_output))\n self.assertTrue(filecmp.cmp(import_output, self.FOO, shallow=False))\n\n self.dvc.remove(\"imported_file.dvc\")\n\n with StaticFileServer(handler=\"Content-MD5\"):\n import_url = urljoin(self.remote, self.FOO)\n import_output = \"imported_file\"\n import_stage = self.dvc.imp_url(import_url, import_output)\n\n self.assertTrue(os.path.exists(import_output))\n self.assertTrue(filecmp.cmp(import_output, self.FOO, shallow=False))\n\n # Run --deps\n with StaticFileServer():\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/func/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/func/test_repro.py_TestReproAllPipelines_TestReproNoCommit.test.self_assertEqual_len_os_l", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1250, "end_line": 1287, "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/func/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/func/test_repro.py_TestReproAlreadyCached_TestReproAlreadyCached.test_force_with_dependencies.self_assertNotEqual_run_o", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1290, "end_line": 1316, "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/tests/func/test_repro.py_TestReproAlreadyCached.test_force_import_TestReproAlreadyCached.test_force_import.with_patch_download_as_mo.with_patch_checkout_as_mo.self_assertEqual_mock_che": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproAlreadyCached.test_force_import_TestReproAlreadyCached.test_force_import.with_patch_download_as_mo.with_patch_checkout_as_mo.self_assertEqual_mock_che", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1313, "end_line": 1336, "span_ids": ["TestReproAlreadyCached.test_force_import"], "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 TestReproAlreadyCached(TestRepro):\n\n def test_force_import(self):\n ret = main([\"import-url\", self.FOO, self.BAR])\n self.assertEqual(ret, 0)\n\n patch_download = patch.object(\n RemoteLOCAL,\n \"download\",\n side_effect=RemoteLOCAL.download,\n autospec=True,\n )\n\n patch_checkout = patch.object(\n OutputBase,\n \"checkout\",\n side_effect=OutputBase.checkout,\n autospec=True,\n )\n\n with patch_download as mock_download:\n with patch_checkout as mock_checkout:\n ret = main([\"repro\", \"--force\", \"bar.dvc\"])\n self.assertEqual(ret, 0)\n self.assertEqual(mock_download.call_count, 1)\n self.assertEqual(mock_checkout.call_count, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestShouldDisplayMetricsOnReproWithMetricsOption_TestShouldDisplayMetricsOnReproWithMetricsOption.test.self_assertIn_expected_me": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestShouldDisplayMetricsOnReproWithMetricsOption_TestShouldDisplayMetricsOnReproWithMetricsOption.test.self_assertIn_expected_me", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1344, "end_line": 1370, "span_ids": ["TestShouldDisplayMetricsOnReproWithMetricsOption", "TestShouldDisplayMetricsOnReproWithMetricsOption.test"], "tokens": 160}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShouldDisplayMetricsOnReproWithMetricsOption(TestDvc):\n def test(self):\n metrics_file = \"metrics_file\"\n metrics_value = 0.123489015\n ret = main(\n [\n \"run\",\n \"-m\",\n metrics_file,\n \"echo {} >> {}\".format(metrics_value, metrics_file),\n ]\n )\n self.assertEqual(0, ret)\n\n self._caplog.clear()\n 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(metrics_file, metrics_value)\n self.assertIn(expected_metrics_display, self._caplog.text)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_foo_copy_foo_copy.return._fname_fname_stage_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_foo_copy_foo_copy.return._fname_fname_stage_f", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1544, "end_line": 1559, "span_ids": ["foo_copy"], "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": "@pytest.fixture\ndef foo_copy(repo_dir, dvc_repo):\n stages = dvc_repo.add(repo_dir.FOO)\n assert len(stages) == 1\n foo_stage = stages[0]\n assert foo_stage is not None\n\n fname = \"foo_copy\"\n stage_fname = fname + \".dvc\"\n dvc_repo.run(\n fname=stage_fname,\n outs=[fname],\n deps=[repo_dir.FOO, repo_dir.CODE],\n cmd=\"python {} {} {}\".format(repo_dir.CODE, repo_dir.FOO, fname),\n )\n return {\"fname\": fname, \"stage_fname\": stage_fname}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_dvc_formatting_retained_test_dvc_formatting_retained.assert__hide_md5_stage_te": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_dvc_formatting_retained_test_dvc_formatting_retained.assert__hide_md5_stage_te", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1557, "end_line": 1572, "span_ids": ["test_dvc_formatting_retained"], "tokens": 167}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_dvc_formatting_retained(dvc_repo, foo_copy):\n root = pathlib.Path(dvc_repo.root_dir)\n stage_file = root / foo_copy[\"stage_fname\"]\n\n # Add comments and custom formatting to DVC-file\n lines = list(map(_format_dvc_line, stage_file.read_text().splitlines()))\n lines.insert(0, \"# Starting comment\")\n stage_text = \"\".join(l + \"\\n\" for l in lines)\n stage_file.write_text(stage_text)\n\n # Rewrite data source and repro\n (root / \"foo\").write_text(\"new_foo\")\n dvc_repo.reproduce(foo_copy[\"stage_fname\"])\n\n # All differences should be only about md5\n assert _hide_md5(stage_text) == _hide_md5(stage_file.read_text())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_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/func/test_run.py_os_from_tests_basic_env_impo", "embedding": null, "metadata": {"file_path": "tests/func/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 31, "span_ids": ["imports"], "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": "import os\nimport uuid\n\nimport logging\nimport mock\nimport shutil\nimport filecmp\nimport subprocess\nimport signal\nimport threading\nimport pytest\n\nfrom dvc.main import main\nfrom dvc.output import OutputBase\nfrom dvc.repo import Repo as DvcRepo\nfrom dvc.utils import file_md5\nfrom dvc.utils.stage import 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/func/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/func/test_run.py_TestRun_TestRun.test.with_self_assertRaises_Ou.self_dvc_run_", "embedding": null, "metadata": {"file_path": "tests/func/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 31, "end_line": 67, "span_ids": ["TestRun.test", "TestRun"], "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 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].fspath, outs[0])\n self.assertEqual(stage.outs[0].checksum, file_md5(self.FOO)[0])\n self.assertTrue(stage.path, fname)\n\n with self.assertRaises(OutputDuplicationError):\n self.dvc.run(\n cmd=cmd,\n deps=deps,\n outs=outs,\n outs_no_cache=outs_no_cache,\n fname=\"duplicate\" + fname,\n 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/func/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/func/test_run.py_TestRunCircularDependency_TestRunCircularDependency.test_graph.with_self_assertRaises_Cy.self_dvc_run_", "embedding": null, "metadata": {"file_path": "tests/func/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 126, "end_line": 166, "span_ids": ["TestRunCircularDependency.test", "TestRunCircularDependency.test_non_normalized_paths", "TestRunCircularDependency.test_graph", "TestRunCircularDependency.test_outs_no_cache", "TestRunCircularDependency"], "tokens": 262}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRunCircularDependency(TestDvc):\n def test(self):\n with self.assertRaises(CircularDependencyError):\n self.dvc.run(\n cmd=\"\",\n deps=[self.FOO],\n outs=[self.FOO],\n fname=\"circular-dependency.dvc\",\n )\n\n def test_outs_no_cache(self):\n with self.assertRaises(CircularDependencyError):\n self.dvc.run(\n cmd=\"\",\n deps=[self.FOO],\n outs_no_cache=[self.FOO],\n fname=\"circular-dependency.dvc\",\n )\n\n def test_non_normalized_paths(self):\n with self.assertRaises(CircularDependencyError):\n self.dvc.run(\n cmd=\"\",\n deps=[\"./foo\"],\n outs=[\"foo\"],\n fname=\"circular-dependency.dvc\",\n )\n\n def test_graph(self):\n self.dvc.run(\n deps=[self.FOO], outs=[\"bar.txt\"], cmd=\"echo bar > bar.txt\"\n )\n\n self.dvc.run(\n deps=[\"bar.txt\"], outs=[\"baz.txt\"], cmd=\"echo baz > baz.txt\"\n )\n\n with self.assertRaises(CyclicGraphError):\n self.dvc.run(\n deps=[\"baz.txt\"], outs=[self.FOO], cmd=\"echo baz > foo\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestRunDuplicatedArguments_TestRunDuplicatedArguments.test_non_normalized_paths.with_self_assertRaises_Ar.self_dvc_run_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestRunDuplicatedArguments_TestRunDuplicatedArguments.test_non_normalized_paths.with_self_assertRaises_Ar.self_dvc_run_", "embedding": null, "metadata": {"file_path": "tests/func/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 169, "end_line": 195, "span_ids": ["TestRunDuplicatedArguments.test", "TestRunDuplicatedArguments.test_non_normalized_paths", "TestRunDuplicatedArguments", "TestRunDuplicatedArguments.test_outs_no_cache"], "tokens": 171}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRunDuplicatedArguments(TestDvc):\n def test(self):\n with self.assertRaises(ArgumentDuplicationError):\n self.dvc.run(\n cmd=\"\",\n deps=[],\n outs=[self.FOO, self.FOO],\n fname=\"circular-dependency.dvc\",\n )\n\n def test_outs_no_cache(self):\n with self.assertRaises(ArgumentDuplicationError):\n self.dvc.run(\n cmd=\"\",\n outs=[self.FOO],\n outs_no_cache=[self.FOO],\n fname=\"circular-dependency.dvc\",\n )\n\n def test_non_normalized_paths(self):\n with self.assertRaises(ArgumentDuplicationError):\n self.dvc.run(\n cmd=\"\",\n deps=[],\n outs=[\"foo\", \"./foo\"],\n fname=\"circular-dependency.dvc\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.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/func/test_run.py_TestRunStageInsideOutput_TestRunBadCwd.test_same_prefix.with_self_assertRaises_St.self_dvc_run_cmd_cwd_", "embedding": null, "metadata": {"file_path": "tests/func/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 198, "end_line": 225, "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/func/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/func/test_run.py_TestRunBadWdir_TestRunBadWdir.test_not_dir.with_self_assertRaises_St.self_dvc_run_cmd_wdir", "embedding": null, "metadata": {"file_path": "tests/func/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 228, "end_line": 250, "span_ids": ["TestRunBadWdir.test_same_prefix", "TestRunBadWdir.test", "TestRunBadWdir", "TestRunBadWdir.test_not_found", "TestRunBadWdir.test_not_dir"], "tokens": 203}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRunBadWdir(TestDvc):\n def test(self):\n with self.assertRaises(StagePathOutsideError):\n self.dvc.run(cmd=\"\", wdir=self.mkdtemp())\n\n def test_same_prefix(self):\n with self.assertRaises(StagePathOutsideError):\n path = \"{}-{}\".format(self._root_dir, uuid.uuid4())\n os.mkdir(path)\n self.dvc.run(cmd=\"\", wdir=path)\n\n def test_not_found(self):\n with self.assertRaises(StagePathNotFoundError):\n path = os.path.join(self._root_dir, str(uuid.uuid4()))\n self.dvc.run(cmd=\"\", wdir=path)\n\n def test_not_dir(self):\n with self.assertRaises(StagePathNotDirectoryError):\n path = os.path.join(self._root_dir, str(uuid.uuid4()))\n os.mkdir(path)\n path = os.path.join(path, str(uuid.uuid4()))\n open(path, \"a\").close()\n self.dvc.run(cmd=\"\", wdir=path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestRunBadName_TestRunBadName.test_not_found.with_self_assertRaises_St.self_dvc_run_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestRunBadName_TestRunBadName.test_not_found.with_self_assertRaises_St.self_dvc_run_", "embedding": null, "metadata": {"file_path": "tests/func/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 253, "end_line": 278, "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/func/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/func/test_run.py_TestRunRemoveOuts_TestRunRemoveOuts.test.self_assertEqual_ret_0_", "embedding": null, "metadata": {"file_path": "tests/func/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 331, "end_line": 353, "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/func/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/func/test_run.py_TestCmdRunOverwrite_TestCmdRunOverwrite.test.None_9", "embedding": null, "metadata": {"file_path": "tests/func/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 508, "end_line": 598, "span_ids": ["TestCmdRunOverwrite.test", "TestCmdRunOverwrite"], "tokens": 507}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCmdRunOverwrite(TestDvc):\n def test(self):\n # NOTE: using sleep() is a workaround for filesystems\n # with low mtime resolution. We have to use mtime since\n # comparing mtime's is the only way to check that the stage\n # file didn't change(size and inode in the first test down\n # below don't change).\n import time\n\n ret = main(\n [\n \"run\",\n \"-d\",\n self.FOO,\n \"-d\",\n self.CODE,\n \"-o\",\n \"out\",\n \"-f\",\n \"out.dvc\",\n \"python\",\n self.CODE,\n self.FOO,\n \"out\",\n ]\n )\n self.assertEqual(ret, 0)\n\n stage_mtime = os.path.getmtime(\"out.dvc\")\n\n time.sleep(1)\n\n ret = main(\n [\n \"run\",\n \"-d\",\n self.FOO,\n \"-d\",\n self.CODE,\n \"-o\",\n \"out\",\n \"-f\",\n \"out.dvc\",\n \"python\",\n self.CODE,\n self.FOO,\n \"out\",\n ]\n )\n self.assertEqual(ret, 0)\n\n # NOTE: check that dvcfile was NOT overwritten\n self.assertEqual(stage_mtime, os.path.getmtime(\"out.dvc\"))\n stage_mtime = os.path.getmtime(\"out.dvc\")\n\n time.sleep(1)\n\n ret = main(\n [\n \"run\",\n \"-d\",\n self.FOO,\n \"-d\",\n self.CODE,\n \"--overwrite-dvcfile\",\n \"--ignore-build-cache\",\n \"-o\",\n \"out\",\n \"-f\",\n \"out.dvc\",\n \"python\",\n self.CODE,\n self.FOO,\n \"out\",\n ]\n )\n self.assertEqual(ret, 0)\n\n # NOTE: check that dvcfile was overwritten\n self.assertNotEqual(stage_mtime, os.path.getmtime(\"out.dvc\"))\n stage_mtime = os.path.getmtime(\"out.dvc\")\n\n time.sleep(1)\n\n ret = main(\n [\"run\", \"--overwrite-dvcfile\", \"-f\", \"out.dvc\", \"-d\", self.BAR]\n )\n self.assertEqual(ret, 0)\n\n # NOTE: check that dvcfile was overwritten\n self.assertNotEqual(stage_mtime, os.path.getmtime(\"out.dvc\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.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/func/test_run.py_TestCmdRunWorkingDirectory_TestCmdRunWorkingDirectory.test_default_wdir_is_written.None_1", "embedding": null, "metadata": {"file_path": "tests/func/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 613, "end_line": 625, "span_ids": ["TestCmdRunWorkingDirectory", "TestCmdRunWorkingDirectory.test_default_wdir_is_written"], "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 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 d = load_stage_file(stage.relpath)\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 d = load_stage_file(stage.relpath)\n self.assertEqual(d[Stage.PARAM_WDIR], \".\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestCmdRunWorkingDirectory.test_fname_changes_path_and_wdir_TestCmdRunWorkingDirectory.test_fname_changes_path_and_wdir.self_assertEqual_d_Stage_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestCmdRunWorkingDirectory.test_fname_changes_path_and_wdir_TestCmdRunWorkingDirectory.test_fname_changes_path_and_wdir.self_assertEqual_d_Stage_", "embedding": null, "metadata": {"file_path": "tests/func/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 627, "end_line": 642, "span_ids": ["TestCmdRunWorkingDirectory.test_fname_changes_path_and_wdir"], "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 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 d = load_stage_file(stage.relpath)\n self.assertEqual(d[Stage.PARAM_WDIR], \"..\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.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/func/test_run.py_TestCmdRunWorkingDirectory.test_cwd_is_ignored_TestCmdRunWorkingDirectory.test_cwd_is_ignored.self_assertEqual_", "embedding": null, "metadata": {"file_path": "tests/func/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 644, "end_line": 659, "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/func/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/func/test_run.py_TestRunDeterministicBase_TestRunDeterministicBase._run.self.stage.self_dvc_run_", "embedding": null, "metadata": {"file_path": "tests/func/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 662, "end_line": 683, "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/func/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/func/test_run.py_TestRunDeterministic_TestRunDeterministicChangedCmd.test.with_self_assertRaises_St.self__run_", "embedding": null, "metadata": {"file_path": "tests/func/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 686, "end_line": 747, "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/func/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/func/test_run.py_TestRunCommit_TestRunCommit.test.None_5", "embedding": null, "metadata": {"file_path": "tests/func/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 750, "end_line": 763, "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/func/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/func/test_run.py_TestRunPersist_TestRunPersist.should_remove_persistent_outs.self_assertFalse_os_path_", "embedding": null, "metadata": {"file_path": "tests/func/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 766, "end_line": 812, "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/func/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/func/test_run.py_TestRunPersistOuts_TestShouldRaiseOnOverlappingOutputPaths.test.None_4", "embedding": null, "metadata": {"file_path": "tests/func/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 815, "end_line": 859, "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/func/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/func/test_run.py_TestRerunWithSameOutputs_TestRerunWithSameOutputs._run_twice_with_same_outputs.None_2", "embedding": null, "metadata": {"file_path": "tests/func/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 862, "end_line": 894, "span_ids": ["TestRerunWithSameOutputs", "TestRerunWithSameOutputs._read_content_only", "TestRerunWithSameOutputs._outs_command", "TestRerunWithSameOutputs._run_twice_with_same_outputs"], "tokens": 207}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRerunWithSameOutputs(TestDvc):\n def _read_content_only(self, path):\n with open(path, \"r\") as fobj:\n return [line.rstrip() for line in fobj]\n\n @property\n def _outs_command(self):\n raise NotImplementedError\n\n def _run_twice_with_same_outputs(self):\n ret = main(\n [\n \"run\",\n \"--outs\",\n self.FOO,\n \"echo {} > {}\".format(self.FOO_CONTENTS, self.FOO),\n ]\n )\n self.assertEqual(0, ret)\n\n output_file_content = self._read_content_only(self.FOO)\n self.assertEqual([self.FOO_CONTENTS], output_file_content)\n\n ret = main(\n [\n \"run\",\n self._outs_command,\n self.FOO,\n \"--overwrite-dvcfile\",\n \"echo {} >> {}\".format(self.BAR_CONTENTS, self.FOO),\n ]\n )\n self.assertEqual(0, ret)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestNewRunShouldRemoveOutsOnNoPersist_TestNewRunShouldNotRemoveOutsOnPersist._outs_command.return._outs_persist_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestNewRunShouldRemoveOutsOnNoPersist_TestNewRunShouldNotRemoveOutsOnPersist._outs_command.return._outs_persist_", "embedding": null, "metadata": {"file_path": "tests/func/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 897, "end_line": 920, "span_ids": ["TestNewRunShouldNotRemoveOutsOnPersist._outs_command", "TestNewRunShouldRemoveOutsOnNoPersist", "TestNewRunShouldNotRemoveOutsOnPersist.test", "TestNewRunShouldRemoveOutsOnNoPersist._outs_command", "TestNewRunShouldNotRemoveOutsOnPersist", "TestNewRunShouldRemoveOutsOnNoPersist.test"], "tokens": 168}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestNewRunShouldRemoveOutsOnNoPersist(TestRerunWithSameOutputs):\n def test(self):\n self._run_twice_with_same_outputs()\n\n output_file_content = self._read_content_only(self.FOO)\n self.assertEqual([self.BAR_CONTENTS], output_file_content)\n\n @property\n def _outs_command(self):\n return \"--outs\"\n\n\nclass TestNewRunShouldNotRemoveOutsOnPersist(TestRerunWithSameOutputs):\n def test(self):\n self._run_twice_with_same_outputs()\n\n output_file_content = self._read_content_only(self.FOO)\n self.assertEqual(\n [self.FOO_CONTENTS, self.BAR_CONTENTS], output_file_content\n )\n\n @property\n def _outs_command(self):\n return \"--outs-persist\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_s3.py__upload_multipart_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_s3.py__upload_multipart_", "embedding": null, "metadata": {"file_path": "tests/func/test_s3.py", "file_name": "test_s3.py", "file_type": "text/x-python", "category": "test", "start_line": 25, "end_line": 64, "span_ids": ["_upload_multipart", "test_copy_multipart_preserve_etag"], "tokens": 317}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _upload_multipart(s3, Bucket, Key):\n mpu = s3.create_multipart_upload(Bucket=Bucket, Key=Key)\n mpu_id = mpu[\"UploadId\"]\n\n parts = []\n n_parts = 10\n for i in range(1, n_parts + 1):\n # NOTE: Generation parts of variable size. Part size should be at\n # least 5MB:\n # https://docs.aws.amazon.com/AmazonS3/latest/API/mpUploadComplete.html\n part_size = 10 * 1024 * 1024 + 2 ** i\n body = str(i) * part_size\n part = s3.upload_part(\n Bucket=Bucket,\n Key=Key,\n PartNumber=i,\n UploadId=mpu_id,\n Body=body,\n ContentLength=len(body),\n )\n parts.append({\"PartNumber\": i, \"ETag\": part[\"ETag\"]})\n\n s3.complete_multipart_upload(\n Bucket=Bucket,\n Key=Key,\n UploadId=mpu_id,\n MultipartUpload={\"Parts\": parts},\n )\n\n\ndef test_copy_multipart_preserve_etag():\n from_info, to_info = _get_src_dst()\n\n if not _should_test_aws():\n pytest.skip()\n\n s3 = boto3.client(\"s3\")\n _upload_multipart(s3, from_info.bucket, from_info.path)\n RemoteS3._copy(s3, from_info, to_info, {})", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_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/func/test_scm.py_from___future___import_un_TestSCM.test_git.self_assertIsInstance_SCM", "embedding": null, "metadata": {"file_path": "tests/func/test_scm.py", "file_name": "test_scm.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 22, "span_ids": ["TestSCM.test_git", "imports", "TestSCM", "TestSCM.test_none"], "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\nimport os\n\nimport pytest\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/func/test_scm.py_TestSCMGit_TestSCMGit.test_is_tracked.None_10": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_TestSCMGit_TestSCMGit.test_is_tracked.None_10", "embedding": null, "metadata": {"file_path": "tests/func/test_scm.py", "file_name": "test_scm.py", "file_type": "text/x-python", "category": "test", "start_line": 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/func/test_stage.py_tempfile_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/func/test_stage.py_tempfile_TestSchemaCmd.test_cmd_str.Stage_validate_d_", "embedding": null, "metadata": {"file_path": "tests/func/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 34, "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": 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 tempfile\nimport os\n\nfrom dvc.main import main\nfrom dvc.output.local import OutputLOCAL\nfrom dvc.remote.local import RemoteLOCAL\nfrom dvc.stage import Stage, StageFileFormatError\nfrom dvc.utils.stage import load_stage_file, dump_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/func/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/func/test_stage.py_TestSchemaDepsOuts_TestSchemaDepsOuts.test_empty_list.None_1", "embedding": null, "metadata": {"file_path": "tests/func/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 37, "end_line": 57, "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/func/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/func/test_stage.py_TestSchemaDepsOuts.test_list_TestSchemaDepsOuts.test_list.None_1", "embedding": null, "metadata": {"file_path": "tests/func/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 59, "end_line": 71, "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/func/test_stage.py_TestReload_TestReload.test.self_assertEqual_d_stage_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_TestReload_TestReload.test.self_assertEqual_d_stage_", "embedding": null, "metadata": {"file_path": "tests/func/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 74, "end_line": 93, "span_ids": ["TestReload.test", "TestReload"], "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 TestReload(TestDvc):\n def test(self):\n stages = self.dvc.add(self.FOO)\n self.assertEqual(len(stages), 1)\n stage = stages[0]\n self.assertTrue(stage is not None)\n\n d = load_stage_file(stage.relpath)\n\n # NOTE: checking that reloaded stage didn't change its checksum\n md5 = \"11111111111111111111111111111111\"\n d[stage.PARAM_MD5] = md5\n dump_stage_file(stage.relpath, d)\n\n 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/func/test_stage.py_TestDefaultWorkingDirectory_TestDefaultWorkingDirectory.test_ignored_in_checksum.with_self_dvc_state_.self_assertFalse_stage_ch": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_TestDefaultWorkingDirectory_TestDefaultWorkingDirectory.test_ignored_in_checksum.with_self_dvc_state_.self_assertFalse_stage_ch", "embedding": null, "metadata": {"file_path": "tests/func/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 96, "end_line": 118, "span_ids": ["TestDefaultWorkingDirectory", "TestDefaultWorkingDirectory.test_ignored_in_checksum"], "tokens": 161}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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 d = load_stage_file(stage.relpath)\n self.assertEqual(d[stage.PARAM_WDIR], \".\")\n\n del d[stage.PARAM_WDIR]\n dump_stage_file(stage.relpath, d)\n\n d = load_stage_file(stage.relpath)\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/tests/func/test_stage.py_TestExternalRemoteResolution_TestExternalRemoteResolution.test_remote_output.assert_os_path_exists_fil": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_TestExternalRemoteResolution_TestExternalRemoteResolution.test_remote_output.assert_os_path_exists_fil", "embedding": null, "metadata": {"file_path": "tests/func/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 121, "end_line": 143, "span_ids": ["TestExternalRemoteResolution.test_remote_output", "TestExternalRemoteResolution"], "tokens": 150}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestExternalRemoteResolution(TestDvc):\n def test_remote_output(self):\n tmp_path = tempfile.mkdtemp()\n storage = os.path.join(tmp_path, \"storage\")\n file_path = os.path.join(storage, \"file\")\n\n os.makedirs(storage)\n\n assert main([\"remote\", \"add\", \"tmp\", tmp_path]) == 0\n assert main([\"remote\", \"add\", \"storage\", \"remote://tmp/storage\"]) == 0\n assert (\n main(\n [\n \"run\",\n \"-O\",\n \"remote://storage/file\",\n \"echo file > {path}\".format(path=file_path),\n ]\n )\n == 0\n )\n\n assert os.path.exists(file_path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_TestExternalRemoteResolution.test_remote_dependency_TestExternalRemoteResolution.test_remote_dependency.assert_os_path_exists_mo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_TestExternalRemoteResolution.test_remote_dependency_TestExternalRemoteResolution.test_remote_dependency.assert_os_path_exists_mo", "embedding": null, "metadata": {"file_path": "tests/func/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 145, "end_line": 159, "span_ids": ["TestExternalRemoteResolution.test_remote_dependency"], "tokens": 148}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestExternalRemoteResolution(TestDvc):\n\n def test_remote_dependency(self):\n tmp_path = tempfile.mkdtemp()\n storage = os.path.join(tmp_path, \"storage\")\n file_path = os.path.join(storage, \"file\")\n\n os.makedirs(storage)\n\n with open(file_path, \"w\") as fobj:\n fobj.write(\"Isle of Dogs\")\n\n assert main([\"remote\", \"add\", \"tmp\", tmp_path]) == 0\n assert main([\"remote\", \"add\", \"storage\", \"remote://tmp/storage\"]) == 0\n assert main([\"import-url\", \"remote://storage/file\", \"movie.txt\"]) == 0\n\n assert os.path.exists(\"movie.txt\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_test_md5_ignores_comments_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_stage.py_test_md5_ignores_comments_", "embedding": null, "metadata": {"file_path": "tests/func/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 162, "end_line": 186, "span_ids": ["test_meta_is_preserved", "test_md5_ignores_comments"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_md5_ignores_comments(repo_dir, dvc_repo):\n stage, = dvc_repo.add(\"foo\")\n\n with open(stage.path, \"a\") as f:\n f.write(\"# End comment\\n\")\n\n new_stage = Stage.load(dvc_repo, stage.path)\n assert not new_stage.changed_md5()\n\n\ndef test_meta_is_preserved(dvc_repo):\n stage, = dvc_repo.add(\"foo\")\n\n # Add meta to DVC-file\n data = load_stage_file(stage.path)\n data[\"meta\"] = {\"custom_key\": 42}\n dump_stage_file(stage.path, data)\n\n # Loading and dumping to test that it works and meta is retained\n new_stage = Stage.load(dvc_repo, stage.path)\n new_stage.dump()\n\n new_data = load_stage_file(stage.path)\n assert new_data[\"meta\"] == data[\"meta\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_status.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_status.py_os_", "embedding": null, "metadata": {"file_path": "tests/func/test_status.py", "file_name": "test_status.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 26, "span_ids": ["imports", "TestStatus.test_implied_cloud", "TestStatus.test_quiet", "TestStatus"], "tokens": 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/func/test_system.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_system.py__", "embedding": null, "metadata": {"file_path": "tests/func/test_system.py", "file_name": "test_system.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 17, "span_ids": ["imports", "test_getdirinfo"], "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 os\nimport pytest\n\nfrom dvc.system import System\n\n\n@pytest.mark.skipif(os.name != \"nt\", reason=\"Windows specific\")\ndef test_getdirinfo(tmp_path):\n # simulate someone holding an exclussive access\n locked = str(tmp_path / \"locked\")\n fd = os.open(locked, os.O_WRONLY | os.O_CREAT | os.O_EXCL)\n try:\n # should not raise WinError\n System._getdirinfo(locked)\n finally:\n os.close(fd)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tag.py_os_TestTag.test.None_12": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tag.py_os_TestTag.test.None_12", "embedding": null, "metadata": {"file_path": "tests/func/test_tag.py", "file_name": "test_tag.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 45, "span_ids": ["TestTag", "imports", "TestTag.test"], "tokens": 281}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport shutil\nimport filecmp\nimport logging\n\nfrom dvc.main import main\nfrom dvc.utils import from_yaml_string\n\nfrom tests.basic_env import TestDvc\n\n\nclass TestTag(TestDvc):\n def test(self):\n fname = \"file\"\n shutil.copyfile(self.FOO, fname)\n\n stages = self.dvc.add(fname)\n self.assertEqual(len(stages), 1)\n stage = stages[0]\n self.assertTrue(stage is not None)\n\n ret = main([\"tag\", \"add\", \"v1\", stage.path])\n self.assertEqual(ret, 0)\n\n os.unlink(fname)\n shutil.copyfile(self.BAR, fname)\n\n ret = main([\"repro\", stage.path])\n self.assertEqual(ret, 0)\n\n ret = main([\"tag\", \"add\", \"v2\", stage.path])\n self.assertEqual(ret, 0)\n\n ret = main([\"tag\", \"list\", stage.path])\n self.assertEqual(ret, 0)\n\n ret = main([\"checkout\", stage.path + \"@v1\"])\n self.assertEqual(ret, 0)\n\n self.assertTrue(filecmp.cmp(fname, self.FOO, shallow=False))\n\n ret = main([\"checkout\", stage.path + \"@v2\"])\n self.assertEqual(ret, 0)\n\n self.assertTrue(filecmp.cmp(fname, self.BAR, shallow=False))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tag.py_TestTagAll_TestTagAll.test.None_10": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tag.py_TestTagAll_TestTagAll.test.None_10", "embedding": null, "metadata": {"file_path": "tests/func/test_tag.py", "file_name": "test_tag.py", "file_type": "text/x-python", "category": "test", "start_line": 48, "end_line": 90, "span_ids": ["TestTagAll.test", "TestTagAll"], "tokens": 298}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestTagAll(TestDvc):\n def test(self):\n ret = main([\"add\", self.FOO, self.BAR])\n self.assertEqual(ret, 0)\n\n self._caplog.clear()\n\n ret = main([\"tag\", \"list\"])\n self.assertEqual(ret, 0)\n\n self.assertEqual(\"\", self._caplog.text)\n\n ret = main([\"tag\", \"add\", \"v1\"])\n self.assertEqual(ret, 0)\n\n self._caplog.clear()\n\n ret = main([\"tag\", \"list\"])\n self.assertEqual(ret, 0)\n\n expected = {\n \"foo.dvc\": {\n \"foo\": {\"v1\": {\"md5\": \"acbd18db4cc2f85cedef654fccc4a4d8\"}}\n },\n \"bar.dvc\": {\n \"bar\": {\"v1\": {\"md5\": \"8978c98bb5a48c2fb5f2c4c905768afa\"}}\n },\n }\n\n stdout = \"\\n\".join(record.message for record in self._caplog.records)\n received = from_yaml_string(stdout)\n\n assert expected == received\n\n ret = main([\"tag\", \"remove\", \"v1\"])\n self.assertEqual(ret, 0)\n\n self._caplog.clear()\n\n ret = main([\"tag\", \"list\"])\n self.assertEqual(ret, 0)\n\n self.assertEqual(\"\", self._caplog.text)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tag.py_TestTagAddNoChecksumInfo_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tag.py_TestTagAddNoChecksumInfo_", "embedding": null, "metadata": {"file_path": "tests/func/test_tag.py", "file_name": "test_tag.py", "file_type": "text/x-python", "category": "test", "start_line": 93, "end_line": 119, "span_ids": ["TestTagAddNoChecksumInfo.test", "TestTagRemoveNoTag", "TestTagAddNoChecksumInfo", "TestTagRemoveNoTag.test"], "tokens": 213}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestTagAddNoChecksumInfo(TestDvc):\n def test(self):\n ret = main([\"run\", \"-o\", self.FOO, \"--no-exec\"])\n self.assertEqual(ret, 0)\n\n self._caplog.clear()\n\n with self._caplog.at_level(logging.WARNING, logger=\"dvc\"):\n ret = main([\"tag\", \"add\", \"v1\", \"foo.dvc\"])\n self.assertEqual(ret, 0)\n\n assert \"missing checksum info for 'foo'\" in self._caplog.text\n\n\nclass TestTagRemoveNoTag(TestDvc):\n def test(self):\n ret = main([\"add\", self.FOO])\n self.assertEqual(ret, 0)\n\n self._caplog.clear()\n\n with self._caplog.at_level(logging.WARNING, logger=\"dvc\"):\n ret = main([\"tag\", \"remove\", \"v1\", \"foo.dvc\"])\n self.assertEqual(ret, 0)\n\n assert \"tag 'v1' not found for 'foo'\" in self._caplog.text", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py__encoding_utf_8_TestWorkingTree.test_isfile.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py__encoding_utf_8_TestWorkingTree.test_isfile.None_2", "embedding": null, "metadata": {"file_path": "tests/func/test_tree.py", "file_name": "test_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 38, "span_ids": ["TestWorkingTree.test_isdir", "TestWorkingTree.test_open", "TestWorkingTree", "TestWorkingTree.test_exists", "TestWorkingTree.setUp", "docstring", "TestWorkingTree.test_isfile"], "tokens": 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": "# 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 with self.tree.open(self.FOO) as fd:\n self.assertEqual(fd.read(), self.FOO_CONTENTS)\n with self.tree.open(self.UNICODE) as fd:\n self.assertEqual(fd.read(), self.UNICODE_CONTENTS)\n\n def test_exists(self):\n self.assertTrue(self.tree.exists(self.FOO))\n self.assertTrue(self.tree.exists(self.UNICODE))\n self.assertFalse(self.tree.exists(\"not-existing-file\"))\n\n def test_isdir(self):\n self.assertTrue(self.tree.isdir(self.DATA_DIR))\n self.assertFalse(self.tree.isdir(self.FOO))\n self.assertFalse(self.tree.isdir(\"not-existing-file\"))\n\n def test_isfile(self):\n self.assertTrue(self.tree.isfile(self.FOO))\n self.assertFalse(self.tree.isfile(self.DATA_DIR))\n self.assertFalse(self.tree.isfile(\"not-existing-file\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_TestGitTree_TestGitTree.test_isfile.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_TestGitTree_TestGitTree.test_isfile.None_4", "embedding": null, "metadata": {"file_path": "tests/func/test_tree.py", "file_name": "test_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 41, "end_line": 82, "span_ids": ["TestGitTree.test_open", "TestGitTree.setUp", "TestGitTree", "TestGitTree.test_isfile", "TestGitTree.test_exists", "TestGitTree.test_isdir"], "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 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 with self.tree.open(self.FOO) as fd:\n self.assertEqual(fd.read(), self.FOO_CONTENTS)\n with self.tree.open(self.UNICODE) as fd:\n self.assertEqual(fd.read(), self.UNICODE_CONTENTS)\n with self.assertRaises(IOError):\n self.tree.open(\"not-existing-file\")\n with self.assertRaises(IOError):\n self.tree.open(self.DATA_DIR)\n\n def test_exists(self):\n self.assertFalse(self.tree.exists(self.FOO))\n self.assertFalse(self.tree.exists(self.UNICODE))\n self.assertFalse(self.tree.exists(self.DATA_DIR))\n self.scm.add([self.FOO, self.UNICODE, self.DATA])\n self.scm.commit(\"add\")\n self.assertTrue(self.tree.exists(self.FOO))\n self.assertTrue(self.tree.exists(self.UNICODE))\n self.assertTrue(self.tree.exists(self.DATA_DIR))\n self.assertFalse(self.tree.exists(\"non-existing-file\"))\n\n def test_isdir(self):\n self.scm.add([self.FOO, self.DATA_DIR])\n self.scm.commit(\"add\")\n self.assertTrue(self.tree.isdir(self.DATA_DIR))\n self.assertFalse(self.tree.isdir(self.FOO))\n self.assertFalse(self.tree.isdir(\"non-existing-file\"))\n\n def test_isfile(self):\n self.scm.add([self.FOO, self.DATA_DIR])\n self.scm.commit(\"add\")\n self.assertTrue(self.tree.isfile(self.FOO))\n self.assertFalse(self.tree.isfile(self.DATA_DIR))\n self.assertFalse(self.tree.isfile(\"not-existing-file\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_AssertWalkEqualMixin_TestWalkInNoSCM.test_subdir.self_assertWalkEqual_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_AssertWalkEqualMixin_TestWalkInNoSCM.test_subdir.self_assertWalkEqual_", "embedding": null, "metadata": {"file_path": "tests/func/test_tree.py", "file_name": "test_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 85, "end_line": 129, "span_ids": ["TestWalkInNoSCM", "AssertWalkEqualMixin", "AssertWalkEqualMixin.assertWalkEqual", "TestWalkInNoSCM.test_subdir", "TestWalkInNoSCM.test"], "tokens": 278}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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(self._root_dir)\n self.assertWalkEqual(\n tree.walk(self._root_dir),\n [\n (\n self._root_dir,\n [\"data_dir\"],\n [\"code.py\", \"bar\", \"\u0442\u0435\u0441\u0442\", \"foo\"],\n ),\n (join(self._root_dir, \"data_dir\"), [\"data_sub_dir\"], [\"data\"]),\n (\n join(self._root_dir, \"data_dir\", \"data_sub_dir\"),\n [],\n [\"data_sub\"],\n ),\n ],\n )\n\n def test_subdir(self):\n tree = WorkingTree(self._root_dir)\n self.assertWalkEqual(\n tree.walk(join(\"data_dir\", \"data_sub_dir\")),\n [\n (\n join(self._root_dir, \"data_dir\", \"data_sub_dir\"),\n [],\n [\"data_sub\"],\n )\n ],\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_TestWalkInGit_TestWalkInGit.test_nobranch.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_TestWalkInGit_TestWalkInGit.test_nobranch.None_1", "embedding": null, "metadata": {"file_path": "tests/func/test_tree.py", "file_name": "test_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 132, "end_line": 160, "span_ids": ["TestWalkInGit.test_nobranch", "TestWalkInGit"], "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 TestWalkInGit(AssertWalkEqualMixin, TestGit):\n def test_nobranch(self):\n tree = WorkingTree(self._root_dir)\n self.assertWalkEqual(\n tree.walk(\".\"),\n [\n (\n self._root_dir,\n [\"data_dir\"],\n [\"bar\", \"\u0442\u0435\u0441\u0442\", \"code.py\", \"foo\"],\n ),\n (join(self._root_dir, \"data_dir\"), [\"data_sub_dir\"], [\"data\"]),\n (\n join(self._root_dir, \"data_dir\", \"data_sub_dir\"),\n [],\n [\"data_sub\"],\n ),\n ],\n )\n self.assertWalkEqual(\n tree.walk(join(\"data_dir\", \"data_sub_dir\")),\n [\n (\n join(self._root_dir, \"data_dir\", \"data_sub_dir\"),\n [],\n [\"data_sub\"],\n )\n ],\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_TestWalkInGit.test_branch_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_tree.py_TestWalkInGit.test_branch_", "embedding": null, "metadata": {"file_path": "tests/func/test_tree.py", "file_name": "test_tree.py", "file_type": "text/x-python", "category": "test", "start_line": 162, "end_line": 189, "span_ids": ["TestWalkInGit.test_branch"], "tokens": 192}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestWalkInGit(AssertWalkEqualMixin, TestGit):\n\n def test_branch(self):\n scm = SCM(self._root_dir)\n scm.add([self.DATA_SUB_DIR])\n scm.commit(\"add data_dir/data_sub_dir/data_sub\")\n tree = GitTree(self.git, \"master\")\n self.assertWalkEqual(\n tree.walk(\".\"),\n [\n (self._root_dir, [\"data_dir\"], [\"code.py\"]),\n (join(self._root_dir, \"data_dir\"), [\"data_sub_dir\"], []),\n (\n join(self._root_dir, \"data_dir\", \"data_sub_dir\"),\n [],\n [\"data_sub\"],\n ),\n ],\n )\n self.assertWalkEqual(\n tree.walk(join(\"data_dir\", \"data_sub_dir\")),\n [\n (\n join(self._root_dir, \"data_dir\", \"data_sub_dir\"),\n [],\n [\"data_sub\"],\n )\n ],\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_unprotect.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_unprotect.py_os_", "embedding": null, "metadata": {"file_path": "tests/func/test_unprotect.py", "file_name": "test_unprotect.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 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/func/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/func/test_utils.py_os_TestUtils.test_file_md5_crlf.self_assertEqual_utils_fi", "embedding": null, "metadata": {"file_path": "tests/func/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 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/func/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/func/test_utils.py_TestUtils.test_dict_md5_", "embedding": null, "metadata": {"file_path": "tests/func/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 40, "end_line": 72, "span_ids": ["TestUtils.test_dict_md5", "TestUtils.test_boxify"], "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 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\"]))\n\n def test_boxify(self):\n expected = (\n \"+-----------------+\\n\"\n \"| |\\n\"\n \"| message |\\n\"\n \"| |\\n\"\n \"+-----------------+\\n\"\n )\n\n assert expected == utils.boxify(\"message\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_connection.py_from___future___import_un_test_makedirs.assert_os_path_isdir_path": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_connection.py_from___future___import_un_test_makedirs.assert_os_path_isdir_path", "embedding": null, "metadata": {"file_path": "tests/unit/remote/ssh/test_connection.py", "file_name": "test_connection.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 28, "span_ids": ["test_isfile", "test_isdir", "imports", "test_makedirs", "test_exists"], "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\nimport os\nimport posixpath\n\nhere = os.path.abspath(os.path.dirname(__file__))\n\n\ndef test_isdir(ssh):\n assert ssh.isdir(here)\n assert not ssh.isdir(__file__)\n\n\ndef test_exists(ssh):\n assert not ssh.exists(\"/path/to/non/existent/file\")\n assert ssh.exists(__file__)\n\n\ndef test_isfile(ssh):\n assert ssh.isfile(__file__)\n assert not ssh.isfile(here)\n\n\ndef test_makedirs(tmp_path, ssh):\n tmp = tmp_path.absolute().as_posix()\n path = posixpath.join(tmp, \"dir\", \"subdir\")\n ssh.makedirs(path)\n assert os.path.isdir(path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_connection.py_test_walk_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_connection.py_test_walk_", "embedding": null, "metadata": {"file_path": "tests/unit/remote/ssh/test_connection.py", "file_name": "test_connection.py", "file_type": "text/x-python", "category": "test", "start_line": 51, "end_line": 87, "span_ids": ["test_walk"], "tokens": 233}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_walk(tmp_path, ssh):\n root_path = tmp_path\n dir_path = root_path / \"dir\"\n subdir_path = dir_path / \"subdir\"\n\n dir_path.mkdir()\n subdir_path.mkdir()\n\n root_data_path = root_path / \"root_data\"\n dir_data_path = dir_path / \"dir_data\"\n subdir_data_path = subdir_path / \"subdir_data\"\n\n with root_data_path.open(\"w+\") as fobj:\n fobj.write(\"\")\n\n with dir_data_path.open(\"w+\") as fobj:\n fobj.write(\"\")\n\n with subdir_data_path.open(\"w+\") as fobj:\n fobj.write(\"\")\n\n entries = [\n dir_path,\n subdir_path,\n root_data_path,\n dir_data_path,\n subdir_data_path,\n ]\n expected = set([entry.absolute().as_posix() for entry in entries])\n\n paths = set()\n for root, dirs, files in ssh.walk(root_path.absolute().as_posix()):\n for entry in dirs + files:\n paths.add(posixpath.join(root, entry))\n\n assert paths == expected", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_base.py_mock_TestMissingDeps.test.with_mock_patch_object_se.with_self_assertRaises_Re.self_REMOTE_CLS_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.with_mock_patch_object_se.with_self_assertRaises_Re.self_REMOTE_CLS_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": 16, "span_ids": ["imports", "TestRemoteBASE", "TestMissingDeps", "TestMissingDeps.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": "import mock\nfrom unittest import TestCase\n\nfrom dvc.remote.base import RemoteBASE, RemoteCmdError, RemoteMissingDepsError\n\n\nclass TestRemoteBASE(object):\n REMOTE_CLS = RemoteBASE\n\n\nclass TestMissingDeps(TestCase, TestRemoteBASE):\n def test(self):\n REQUIRES = {\"foo\": None, \"bar\": None, \"mock\": mock}\n with mock.patch.object(self.REMOTE_CLS, \"REQUIRES\", REQUIRES):\n with self.assertRaises(RemoteMissingDepsError):\n self.REMOTE_CLS(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.with_mock_patch_object_.with_self_assertRaises_Re.self_REMOTE_CLS_repo_con": {"__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.with_mock_patch_object_.with_self_assertRaises_Re.self_REMOTE_CLS_repo_con", "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": 20, "end_line": 35, "span_ids": ["TestCmdError.test", "TestCmdError"], "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 TestCmdError(TestCase, TestRemoteBASE):\n def test(self):\n repo = None\n config = {}\n\n cmd = \"sed 'hello'\"\n ret = \"1\"\n err = \"sed: expression #1, char 2: extra characters after command\"\n\n with mock.patch.object(\n self.REMOTE_CLS,\n \"remove\",\n side_effect=RemoteCmdError(\"base\", cmd, ret, err),\n ):\n with self.assertRaises(RemoteCmdError):\n self.REMOTE_CLS(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/test_ignore.py_os_mock_dvcignore.return.ignore_file": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_ignore.py_os_mock_dvcignore.return.ignore_file", "embedding": null, "metadata": {"file_path": "tests/unit/test_ignore.py", "file_name": "test_ignore.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 21, "span_ids": ["imports", "mock_dvcignore"], "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 os\n\nimport pytest\nfrom pathspec import PathSpec\nfrom pathspec.patterns import GitWildMatchPattern\n\nfrom dvc.ignore import DvcIgnoreFromFile, DvcIgnoreDir, DvcIgnoreFile\nfrom mock import patch, Mock\n\n\ndef mock_dvcignore(dvcignore_path, patterns):\n mock_ignore_file_handler = Mock()\n with patch.object(\n mock_ignore_file_handler,\n \"read_patterns\",\n return_value=PathSpec.from_lines(GitWildMatchPattern, patterns),\n ):\n ignore_file = DvcIgnoreFromFile(\n dvcignore_path, mock_ignore_file_handler\n )\n return ignore_file", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_ignore.py_test_ignore_from_file_should_filter_dirs_and_files_test_ignore_from_file_should_filter_dirs_and_files.assert_file1_file2_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_ignore.py_test_ignore_from_file_should_filter_dirs_and_files_test_ignore_from_file_should_filter_dirs_and_files.assert_file1_file2_", "embedding": null, "metadata": {"file_path": "tests/unit/test_ignore.py", "file_name": "test_ignore.py", "file_type": "text/x-python", "category": "test", "start_line": 24, "end_line": 39, "span_ids": ["test_ignore_from_file_should_filter_dirs_and_files"], "tokens": 162}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_ignore_from_file_should_filter_dirs_and_files():\n dvcignore_path = os.path.join(\n os.path.sep, \"full\", \"path\", \"to\", \"ignore\", \"file\", \".dvcignore\"\n )\n\n patterns = [\"dir_to_ignore\", \"file_to_ignore\"]\n\n root = os.path.dirname(dvcignore_path)\n dirs = [\"dir1\", \"dir2\", \"dir_to_ignore\"]\n files = [\"file1\", \"file2\", \"file_to_ignore\"]\n\n ignore = mock_dvcignore(dvcignore_path, patterns)\n new_dirs, new_files = ignore(root, dirs, files)\n\n assert {\"dir1\", \"dir2\"} == set(new_dirs)\n assert {\"file1\", \"file2\"} == set(new_files)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_ignore.py_test_match_ignore_from_file_test_match_ignore_from_file.assert_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_ignore.py_test_match_ignore_from_file_test_match_ignore_from_file.assert_", "embedding": null, "metadata": {"file_path": "tests/unit/test_ignore.py", "file_name": "test_ignore.py", "file_type": "text/x-python", "category": "test", "start_line": 42, "end_line": 95, "span_ids": ["test_match_ignore_from_file"], "tokens": 366}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"file_to_ignore_relpath, patterns, expected_match\",\n [\n (\"to_ignore\", [\"to_ignore\"], True),\n (\"to_ignore.txt\", [\"to_ignore*\"], True),\n (\n os.path.join(\"rel\", \"p\", \"p2\", \"to_ignore\"),\n [\"rel/**/to_ignore\"],\n True,\n ),\n (\n os.path.join(\n os.path.sep,\n \"full\",\n \"path\",\n \"to\",\n \"ignore\",\n \"file\",\n \"to_ignore\",\n ),\n [\"to_ignore\"],\n True,\n ),\n (\"to_ignore.txt\", [\"/*.txt\"], True),\n (\n os.path.join(\"rel\", \"path\", \"path2\", \"to_ignore\"),\n [\"rel/*/to_ignore\"],\n False,\n ),\n (os.path.join(\"path\", \"to_ignore.txt\"), [\"/*.txt\"], False),\n (\n os.path.join(\"rel\", \"path\", \"path2\", \"dont_ignore\"),\n [\"rel/**/to_ignore\"],\n False,\n ),\n (\"dont_ignore.txt\", [\"dont_ignore\"], False),\n (\"dont_ignore.txt\", [\"dont*\", \"!dont_ignore.txt\"], False),\n ],\n)\ndef test_match_ignore_from_file(\n file_to_ignore_relpath, patterns, expected_match\n):\n\n dvcignore_path = os.path.join(\n os.path.sep, \"full\", \"path\", \"to\", \"ignore\", \"file\", \".dvcignore\"\n )\n dvcignore_dirname = os.path.dirname(dvcignore_path)\n\n ignore_file = mock_dvcignore(dvcignore_path, patterns)\n\n assert (\n ignore_file.matches(dvcignore_dirname, file_to_ignore_relpath)\n == expected_match\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_ignore.py_test_should_ignore_dir_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_ignore.py_test_should_ignore_dir_", "embedding": null, "metadata": {"file_path": "tests/unit/test_ignore.py", "file_name": "test_ignore.py", "file_type": "text/x-python", "category": "test", "start_line": 109, "end_line": 133, "span_ids": ["test_should_ignore_file", "test_should_ignore_dir"], "tokens": 197}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"omit_dir\", [\".git\", \".hg\", \".dvc\"])\ndef test_should_ignore_dir(omit_dir):\n ignore = DvcIgnoreDir(omit_dir)\n\n root = os.path.join(os.path.sep, \"walk\", \"dir\", \"root\")\n dirs = [omit_dir, \"dir1\", \"dir2\"]\n files = []\n\n new_dirs, _ = ignore(root, dirs, files)\n\n assert set(new_dirs) == {\"dir1\", \"dir2\"}\n\n\ndef test_should_ignore_file():\n dvcignore = \".dvcignore\"\n ignore = DvcIgnoreFile(dvcignore)\n\n root = os.path.join(os.path.sep, \"walk\", \"dir\", \"root\")\n dirs = []\n files = [\"file1\", \"file2\", dvcignore]\n\n _, new_files = ignore(root, dirs, files)\n\n assert set(new_files) == {\"file1\", \"file2\"}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_from___future___import_un_TestColorFormatter.test_exception_with_description_and_message.with_caplog_at_level_logg.assert_expected_format": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_from___future___import_un_TestColorFormatter.test_exception_with_description_and_message.with_caplog_at_level_logg.assert_expected_format", "embedding": null, "metadata": {"file_path": "tests/unit/test_logger.py", "file_name": "test_logger.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 99, "span_ids": ["TestColorFormatter.test_exception_with_description_and_message", "TestColorFormatter.test_exception", "TestColorFormatter.test_exception_with_description_and_without_message", "imports", "TestColorFormatter.test_info", "TestColorFormatter.test_error", "TestColorFormatter.test_warning", "TestColorFormatter", "TestColorFormatter.test_debug"], "tokens": 601}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import unicode_literals\n\nimport traceback\nimport logging\nimport colorama\n\nimport dvc.logger\nfrom dvc.exceptions import DvcException\n\n\nlogger = logging.getLogger(\"dvc\")\nformatter = dvc.logger.ColorFormatter()\ncolors = {\n \"blue\": colorama.Fore.BLUE,\n \"red\": colorama.Fore.RED,\n \"yellow\": colorama.Fore.YELLOW,\n \"nc\": colorama.Fore.RESET,\n}\n\n\nclass TestColorFormatter:\n def test_debug(self, caplog):\n with caplog.at_level(logging.DEBUG, logger=\"dvc\"):\n logger.debug(\"message\")\n\n expected = \"{blue}DEBUG{nc}: message\".format(**colors)\n\n assert expected == formatter.format(caplog.records[0])\n\n def test_info(self, caplog):\n with caplog.at_level(logging.INFO, logger=\"dvc\"):\n logger.info(\"message\")\n\n assert \"message\" == formatter.format(caplog.records[0])\n\n def test_warning(self, caplog):\n with caplog.at_level(logging.INFO, logger=\"dvc\"):\n logger.warning(\"message\")\n\n expected = \"{yellow}WARNING{nc}: message\".format(**colors)\n\n assert expected == formatter.format(caplog.records[0])\n\n def test_error(self, caplog):\n with caplog.at_level(logging.INFO, logger=\"dvc\"):\n logger.error(\"message\")\n\n expected = (\n \"{red}ERROR{nc}: message\\n\"\n \"\\n\"\n \"{footer}\".format(footer=formatter.footer, **colors)\n )\n\n assert expected == formatter.format(caplog.records[0])\n\n def test_exception(self, caplog):\n with caplog.at_level(logging.INFO, logger=\"dvc\"):\n try:\n raise ValueError\n except Exception:\n logger.exception(\"message\")\n\n expected = (\n \"{red}ERROR{nc}: message\\n\"\n \"\\n\"\n \"{footer}\".format(footer=formatter.footer, **colors)\n )\n\n assert expected == formatter.format(caplog.records[0])\n\n def test_exception_with_description_and_without_message(self, caplog):\n with caplog.at_level(logging.INFO, logger=\"dvc\"):\n try:\n raise Exception(\"description\")\n except Exception:\n logger.exception(\"\")\n\n expected = (\n \"{red}ERROR{nc}: description\\n\"\n \"\\n\"\n \"{footer}\".format(footer=formatter.footer, **colors)\n )\n\n assert expected == formatter.format(caplog.records[0])\n\n def test_exception_with_description_and_message(self, caplog):\n with caplog.at_level(logging.INFO, logger=\"dvc\"):\n try:\n raise Exception(\"description\")\n except Exception:\n logger.exception(\"message\")\n\n expected = (\n \"{red}ERROR{nc}: message - description\\n\"\n \"\\n\"\n \"{footer}\".format(footer=formatter.footer, **colors)\n )\n\n assert expected == formatter.format(caplog.records[0])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_TestColorFormatter.test_exception_under_verbose_TestColorFormatter.test_exception_under_verbose.with_caplog_at_level_logg.assert_expected_format": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_TestColorFormatter.test_exception_under_verbose_TestColorFormatter.test_exception_under_verbose.with_caplog_at_level_logg.assert_expected_format", "embedding": null, "metadata": {"file_path": "tests/unit/test_logger.py", "file_name": "test_logger.py", "file_type": "text/x-python", "category": "test", "start_line": 101, "end_line": 123, "span_ids": ["TestColorFormatter.test_exception_under_verbose"], "tokens": 147}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestColorFormatter:\n\n def test_exception_under_verbose(self, caplog):\n with caplog.at_level(logging.DEBUG, logger=\"dvc\"):\n try:\n raise Exception(\"description\")\n except Exception:\n stack_trace = traceback.format_exc()\n logger.exception(\"\")\n\n expected = (\n \"{red}ERROR{nc}: description\\n\"\n \"{red}{line}{nc}\\n\"\n \"{stack_trace}\"\n \"{red}{line}{nc}\\n\"\n \"\\n\"\n \"{footer}\".format(\n footer=formatter.footer,\n line=\"-\" * 60,\n stack_trace=stack_trace,\n **colors\n )\n )\n\n assert expected == formatter.format(caplog.records[0])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_stage.py_TestStageChecksum.test_wdir_non_default_is_not_ignored_TestStageChecksum.test_wdir_non_default_is_not_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_non_default_is_not_ignored_TestStageChecksum.test_wdir_non_default_is_not_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": 39, "end_line": 54, "span_ids": ["TestStageChecksum.test_wdir_non_default_is_not_ignored"], "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 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 )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_version.py_mock_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_version.py_mock_", "embedding": null, "metadata": {"file_path": "tests/unit/test_version.py", "file_name": "test_version.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 23, "span_ids": ["imports", "test_is_release"], "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": "import mock\nimport subprocess\n\n\nimport dvc.version\nfrom dvc.utils.compat import cast_bytes\n\n\ndef test_is_release():\n with mock.patch.object(dvc.version.subprocess, \"check_output\") as m:\n m.side_effect = subprocess.CalledProcessError(1, \"cmd\")\n ret = dvc.version._is_release(None, dvc.version._BASE_VERSION)\n assert ret is False\n\n m.side_effect = None\n m.return_value = cast_bytes(dvc.version._BASE_VERSION)\n ret = dvc.version._is_release(None, dvc.version._BASE_VERSION)\n assert ret\n\n m.return_value = cast_bytes(\"630d1741c2d5dd89a3176bd15b63121b905d35c9\")\n ret = dvc.version._is_release(None, dvc.version._BASE_VERSION)\n assert ret is False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_collections.py_from_dvc_utils_collection_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_collections.py_from_dvc_utils_collection_", "embedding": null, "metadata": {"file_path": "tests/unit/utils/test_collections.py", "file_name": "test_collections.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 50, "span_ids": ["imports", "test_apply_diff_seq", "MyDict", "test_apply_diff_mapping", "test_apply_diff_is_inplace", "MyInt"], "tokens": 299}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.utils.collections import apply_diff\n\n\nclass MyDict(dict):\n pass\n\n\nclass MyInt(int):\n pass\n\n\ndef test_apply_diff_is_inplace():\n dest = MyDict()\n dest.attr = 42\n apply_diff({}, dest)\n\n assert type(dest) is MyDict, \"Preserves class\"\n assert dest.attr == 42, \"Preserves custom attrs\"\n\n\ndef test_apply_diff_mapping():\n src = {\"a\": 1}\n dest = {\"b\": 2}\n apply_diff(src, dest)\n assert dest == src, \"Adds and removes keys\"\n\n src = {\"a\": 1}\n dest = {\"a\": MyInt(1)}\n apply_diff(src, dest)\n assert type(dest[\"a\"]) is MyInt, \"Does not replace equals\"\n\n src = {\"d\": {\"a\": 1}}\n inner = {}\n dest = {\"d\": inner}\n apply_diff(src, dest)\n assert dest[\"d\"] is inner, \"Updates inner dicts\"\n\n\ndef test_apply_diff_seq():\n src = [1]\n dest = [MyInt(1)]\n apply_diff(src, dest)\n assert type(dest[0]) is MyInt, \"Does not replace equals\"\n\n src = {\"l\": [1]}\n inner = []\n dest = {\"l\": inner}\n apply_diff(src, dest)\n assert dest[\"l\"] is inner, \"Updates inner lists\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_TestContainsLink.test_should_return_false_when_base_path_is_symlink_TestContainsLink.test_should_return_false_when_base_path_is_symlink.with_patch_object_.self_assertFalse_contains": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_TestContainsLink.test_should_return_false_when_base_path_is_symlink_TestContainsLink.test_should_return_false_when_base_path_is_symlink.with_patch_object_.self_assertFalse_contains", "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": 81, "end_line": 94, "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/unit/utils/test_fs.py_test_get_parent_dirs_up_to_should_raise_on_no_absolute_test_get_parent_dirs_up_to_should_raise_on_no_absolute.with_pytest_raises_Assert.get_parent_dirs_up_to_pat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_test_get_parent_dirs_up_to_should_raise_on_no_absolute_test_get_parent_dirs_up_to_should_raise_on_no_absolute.with_pytest_raises_Assert.get_parent_dirs_up_to_pat", "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": 97, "end_line": 112, "span_ids": ["test_get_parent_dirs_up_to_should_raise_on_no_absolute"], "tokens": 117}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"path1, path2\",\n [\n (\n os.path.join(\"non\", \"abs\", \"path\"),\n os.path.join(os.sep, \"full\", \"path\"),\n ),\n (\n os.path.join(os.sep, \"full\", \"path\"),\n os.path.join(\"non\", \"abs\", \"path\"),\n ),\n ],\n)\ndef test_get_parent_dirs_up_to_should_raise_on_no_absolute(path1, path2):\n with pytest.raises(AssertionError):\n get_parent_dirs_up_to(path1, path2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/utils/__init__.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/utils/__init__.py_os_", "embedding": null, "metadata": {"file_path": "tests/utils/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 43, "span_ids": ["spy", "get_gitignore_content", "imports", "trees_equal", "cd"], "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 filecmp import dircmp\n\nfrom dvc.scm import Git\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\n@contextmanager\ndef cd(newdir):\n prevdir = os.getcwd()\n os.chdir(os.path.expanduser(newdir))\n try:\n yield\n finally:\n os.chdir(prevdir)\n\n\ndef trees_equal(dir_path_1, dir_path_2):\n\n comparison = dircmp(dir_path_1, dir_path_2)\n\n assert set(comparison.left_only) == set(comparison.right_only) == set()\n\n for d in comparison.common_dirs:\n trees_equal(os.path.join(dir_path_1, d), os.path.join(dir_path_2, d))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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.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.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/init.py", "file_name": "init.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 25, "span_ids": ["imports", "CmdInit.run", "CmdInit"], "tokens": 127}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import unicode_literals\n\nimport argparse\nimport logging\n\nfrom dvc.command.base import CmdBaseNoRepo, append_doc_link\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdInit(CmdBaseNoRepo):\n def run(self):\n from dvc.repo import Repo\n from dvc.exceptions import InitError\n\n try:\n self.repo = Repo.init(\n \".\", no_scm=self.args.no_scm, force=self.args.force\n )\n self.config = self.repo.config\n except InitError:\n logger.exception(\"failed to initiate dvc\")\n return 1\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud._init_cloud_DataCloud.push.return.self_repo_cache_local_pus": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud._init_cloud_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": 102, "end_line": 126, "span_ids": ["DataCloud.push", "DataCloud._init_cloud"], "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 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 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_remote(remote, \"push\"),\n show_checksums=show_checksums,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/https.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/https.py__", "embedding": null, "metadata": {"file_path": "dvc/dependency/https.py", "file_name": "https.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 9, "span_ids": ["imports", "DependencyHTTPS"], "tokens": 38}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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.https import RemoteHTTPS\nfrom .http import DependencyHTTP\n\n\nclass DependencyHTTPS(DependencyHTTP):\n REMOTE = RemoteHTTPS", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py_ColorFormatter._current_level_ColorFormatter._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_ColorFormatter._current_level_ColorFormatter._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": 81, "end_line": 119, "span_ids": ["ColorFormatter._walk_exc", "ColorFormatter._current_level", "ColorFormatter._description", "ColorFormatter._is_visible"], "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 ColorFormatter(logging.Formatter):\n\n def _current_level(self):\n return logging.getLogger(\"dvc\").getEffectiveLevel()\n\n def _is_visible(self, record):\n return record.levelno >= self._current_level()\n\n def _description(self, message, exception):\n description = \"\"\n\n if exception and message:\n description = \"{message} - {exception}\"\n elif exception:\n description = \"{exception}\"\n elif message:\n description = \"{message}\"\n\n return description.format(message=message, exception=exception)\n\n def _walk_exc(self, exc_info):\n import traceback\n\n buffer = StringIO()\n\n traceback.print_exception(*exc_info, file=buffer)\n\n exc = exc_info[1]\n tb = buffer.getvalue()\n\n exc_list = [str(exc)]\n tb_list = [tb]\n\n # NOTE: parsing chained exceptions. See dvc/exceptions.py for more info\n while hasattr(exc, \"cause\") and exc.cause:\n exc_list.append(str(exc.cause))\n if hasattr(exc, \"cause_tb\") and exc.cause_tb:\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/progress.py_Progress._bar_Progress._bar.return.num_pbar_percent_ta": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/progress.py_Progress._bar_Progress._bar.return.num_pbar_percent_ta", "embedding": null, "metadata": {"file_path": "dvc/progress.py", "file_name": "progress.py", "file_type": "text/x-python", "category": "implementation", "start_line": 82, "end_line": 106, "span_ids": ["Progress._bar"], "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 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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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._print_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/progress.py_Progress._print_", "embedding": null, "metadata": {"file_path": "dvc/progress.py", "file_name": "progress.py", "file_type": "text/x-python", "category": "implementation", "start_line": 108, "end_line": 155, "span_ids": ["Progress.__enter__", "impl:3", "Progress.__call__", "Progress.__exit__", "ProgressCallback.__init__", "ProgressCallback.finish", "ProgressCallback", "ProgressCallback.update", "Progress._print"], "tokens": 273}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Progress(object):\n\n @staticmethod\n def _print(*args, **kwargs):\n import logging\n\n logger = logging.getLogger(__name__)\n\n if logger.getEffectiveLevel() == logging.CRITICAL:\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()\n\n def __call__(self, seq, name=\"\", total=None):\n if total is None:\n total = len(seq)\n\n self.update_target(name, 0, total)\n for done, item in enumerate(seq, start=1):\n yield item\n self.update_target(name, done, total)\n self.finish_target(name)\n\n\nclass ProgressCallback(object):\n def __init__(self, total):\n self.total = total\n self.current = 0\n progress.reset()\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/azure.py_RemoteAZURE.blob_service_RemoteAZURE.blob_service.return.self___blob_service": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_RemoteAZURE.blob_service_RemoteAZURE.blob_service.return.self___blob_service", "embedding": null, "metadata": {"file_path": "dvc/remote/azure.py", "file_name": "azure.py", "file_type": "text/x-python", "category": "implementation", "start_line": 81, "end_line": 96, "span_ids": ["RemoteAZURE.blob_service"], "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 RemoteAZURE(RemoteBASE):\n\n @property\n def blob_service(self):\n if self.__blob_service is None:\n logger.debug(\"URL {}\".format(self.path_info))\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.path_info.bucket))\n try: # verify that container exists\n self.__blob_service.list_blobs(\n self.path_info.bucket, delimiter=\"/\", num_results=1\n )\n except AzureMissingResourceHttpError:\n self.__blob_service.create_container(self.path_info.bucket)\n return self.__blob_service", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE_RemoteBASE.get_file_checksum.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE_RemoteBASE.get_file_checksum.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 70, "end_line": 142, "span_ids": ["RemoteBASE.__init__", "RemoteBASE", "RemoteBASE.__repr__", "RemoteBASE.compat_config", "RemoteBASE.get_file_checksum", "RemoteBASE.supported", "RemoteBASE.cache"], "tokens": 563}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n scheme = \"base\"\n path_cls = URLInfo\n REQUIRES = {}\n JOBS = 4 * cpu_count()\n\n PARAM_RELPATH = \"relpath\"\n CHECKSUM_DIR_SUFFIX = \".dir\"\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 core = config.get(Config.SECTION_CORE, {})\n self.checksum_jobs = core.get(\n Config.SECTION_CORE_CHECKSUM_JOBS, CHECKSUM_JOBS\n )\n\n self.protected = False\n self.no_traverse = config.get(Config.SECTION_REMOTE_NO_TRAVERSE)\n self.state = StateBase()\n self._dir_info = {}\n\n def __repr__(self):\n return \"{class_name}: '{path_info}'\".format(\n class_name=type(self).__name__,\n path_info=self.path_info or \"No path\",\n )\n\n def compat_config(config):\n return config.copy()\n\n @classmethod\n def supported(cls, config):\n if isinstance(config, basestring):\n url = config\n else:\n url = config[Config.SECTION_REMOTE_URL]\n\n # NOTE: silently skipping remote, calling code should handle that\n parsed = urlparse(url)\n return parsed.scheme == cls.scheme\n\n @property\n def cache(self):\n return getattr(self.repo.cache, self.scheme)\n\n def get_file_checksum(self, path_info):\n raise NotImplementedError", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.is_dir_checksum_RemoteBASE.save_info.return._self_PARAM_CHECKSUM_sel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.is_dir_checksum_RemoteBASE.save_info.return._self_PARAM_CHECKSUM_sel", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 253, "end_line": 288, "span_ids": ["RemoteBASE.is_dir_checksum", "RemoteBASE.get_checksum", "RemoteBASE.save_info"], "tokens": 239}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n @classmethod\n def is_dir_checksum(cls, checksum):\n return checksum.endswith(cls.CHECKSUM_DIR_SUFFIX)\n\n def get_checksum(self, path_info):\n if not self.exists(path_info):\n return None\n\n checksum = self.state.get(path_info)\n\n # If we have dir checksum in state db, but dir cache file is lost,\n # then we need to recollect the dir via .get_dir_checksum() call below,\n # see https://github.com/iterative/dvc/issues/2219 for context\n if (\n checksum\n and self.is_dir_checksum(checksum)\n and not self.exists(self.cache.checksum_to_path_info(checksum))\n ):\n checksum = None\n\n if checksum:\n return checksum\n\n if self.isdir(path_info):\n checksum = self.get_dir_checksum(path_info)\n else:\n checksum = self.get_file_checksum(path_info)\n\n if checksum:\n self.state.save(path_info, checksum)\n\n return checksum\n\n def save_info(self, path_info):\n assert path_info.scheme == self.scheme\n return {self.PARAM_CHECKSUM: self.get_checksum(path_info)}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.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": 286, "end_line": 334, "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.link_RemoteBASE._save_file.self_state_save_cache_inf": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.link_RemoteBASE._save_file.self_state_save_cache_inf", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 310, "end_line": 331, "span_ids": ["RemoteBASE._save_file", "RemoteBASE.link"], "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 RemoteBASE(object):\n\n def link(self, from_info, to_info, link_type=None):\n self.copy(from_info, to_info)\n\n def _save_file(self, path_info, checksum, save_link=True):\n assert checksum\n\n cache_info = self.checksum_to_path_info(checksum)\n if self.changed_cache(checksum):\n self.move(path_info, cache_info)\n else:\n self.remove(path_info)\n\n self.link(cache_info, path_info)\n\n if save_link:\n self.state.save_link(path_info)\n\n # we need to update path and cache, since in case of reflink,\n # or copy cache type moving original file results in updates on\n # next executed command, which causes md5 recalculation\n self.state.save(path_info, checksum)\n self.state.save(cache_info, checksum)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.changed_cache_file_RemoteBASE.changed_cache_file.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.changed_cache_file_RemoteBASE.changed_cache_file.return.True", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 505, "end_line": 536, "span_ids": ["RemoteBASE.changed_cache_file"], "tokens": 203}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def changed_cache_file(self, checksum):\n \"\"\"Compare the given checksum with the (corresponding) actual one.\n\n - Use `State` as a cache for computed checksums\n + The entries are invalidated by taking into account the following:\n * mtime\n * inode\n * size\n * checksum\n\n - Remove the file from cache if it doesn't match the actual checksum\n \"\"\"\n cache_info = self.checksum_to_path_info(checksum)\n actual = self.get_checksum(cache_info)\n\n logger.debug(\n \"cache '{}' expected '{}' actual '{}'\".format(\n str(cache_info), checksum, actual\n )\n )\n\n if not checksum or not actual:\n return True\n\n if actual.split(\".\")[0] == checksum.split(\".\")[0]:\n return False\n\n if self.exists(cache_info):\n logger.warning(\"corrupted cache file '{}'.\".format(cache_info))\n self.remove(cache_info)\n\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.already_cached_RemoteBASE.safe_remove.self_remove_path_info_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.already_cached_RemoteBASE.safe_remove.self_remove_path_info_", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 565, "end_line": 586, "span_ids": ["RemoteBASE.already_cached", "RemoteBASE.safe_remove"], "tokens": 130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def already_cached(self, path_info):\n current = self.get_checksum(path_info)\n\n if not current:\n return False\n\n return not self.changed_cache(current)\n\n def safe_remove(self, path_info, force=False):\n if not self.exists(path_info):\n return\n\n if not force and not self.already_cached(path_info):\n msg = (\n \"file '{}' is going to be removed.\"\n \" Are you sure you want to proceed?\".format(str(path_info))\n )\n\n if not prompt.confirm(msg):\n raise ConfirmRemoveError(str(path_info))\n\n self.remove(path_info)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._checkout_file_RemoteBASE.makedirs.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._checkout_file_RemoteBASE.makedirs.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 568, "end_line": 584, "span_ids": ["RemoteBASE.makedirs", "RemoteBASE._checkout_file"], "tokens": 130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def _checkout_file(\n self, path_info, checksum, force, progress_callback=None\n ):\n cache_info = self.checksum_to_path_info(checksum)\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 self.link(cache_info, path_info)\n self.state.save_link(path_info)\n self.state.save(path_info, checksum)\n if progress_callback:\n progress_callback.update(str(path_info))\n\n def makedirs(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._checkout_dir_RemoteBASE._checkout_dir.self_state_save_path_info": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._checkout_dir_RemoteBASE._checkout_dir.self_state_save_path_info", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 689, "end_line": 719, "span_ids": ["RemoteBASE._checkout_dir"], "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 RemoteBASE(object):\n\n def _checkout_dir(\n self, path_info, checksum, force, progress_callback=None\n ):\n # Create dir separately so that dir is created\n # even if there are no files in it\n if not self.exists(path_info):\n self.makedirs(path_info)\n\n dir_info = self.get_dir_cache(checksum)\n\n logger.debug(\"Linking directory '{}'.\".format(path_info))\n\n for entry in dir_info:\n relative_path = entry[self.PARAM_RELPATH]\n entry_checksum = entry[self.PARAM_CHECKSUM]\n entry_cache_info = self.checksum_to_path_info(entry_checksum)\n entry_info = path_info / relative_path\n\n entry_checksum_info = {self.PARAM_CHECKSUM: entry_checksum}\n if self.changed(entry_info, entry_checksum_info):\n if self.exists(entry_info):\n self.safe_remove(entry_info, force=force)\n self.link(entry_cache_info, entry_info)\n self.state.save(entry_info, entry_checksum)\n if progress_callback:\n progress_callback.update(str(entry_info))\n\n self._remove_redundant_files(path_info, dir_info, force)\n\n self.state.save_link(path_info)\n self.state.save(path_info, checksum)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/https.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/https.py__", "embedding": null, "metadata": {"file_path": "dvc/remote/https.py", "file_name": "https.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 10, "span_ids": ["imports", "RemoteHTTPS"], "tokens": 38}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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.scheme import Schemes\n\nfrom .http import RemoteHTTP\n\n\nclass RemoteHTTPS(RemoteHTTP):\n scheme = Schemes.HTTPS", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_from___future___import_un_logger.logging_getLogger___name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_from___future___import_un_logger.logging_getLogger___name_", "embedding": null, "metadata": {"file_path": "dvc/remote/local/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 40, "span_ids": ["imports"], "tokens": 189}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import unicode_literals\n\nfrom copy import copy\n\nfrom dvc.scheme import Schemes\nfrom dvc.remote.local.slow_link_detection import slow_link_guard\nfrom dvc.utils.compat import str, makedirs, fspath_py35\n\nimport os\nimport stat\nfrom shortuuid import uuid\nimport shutil\nimport logging\n\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 to_chunks,\n tmp_fname,\n file_md5,\n walk_files,\n relpath,\n)\nfrom dvc.config import Config\nfrom dvc.exceptions import DvcException\nfrom dvc.progress import progress\nfrom concurrent.futures import ThreadPoolExecutor\n\nfrom dvc.path_info import PathInfo\n\nlogger = logging.getLogger(__name__)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.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/__init__.py_RemoteLOCAL._group_RemoteLOCAL._group.return.by_md5", "embedding": null, "metadata": {"file_path": "dvc/remote/local/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 279, "end_line": 299, "span_ids": ["RemoteLOCAL._group"], "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 _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[\"name\"]\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/__init__.py_RemoteLOCAL.status_RemoteLOCAL.status.return.ret": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_RemoteLOCAL.status_RemoteLOCAL.status.return.ret", "embedding": null, "metadata": {"file_path": "dvc/remote/local/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 301, "end_line": 332, "span_ids": ["RemoteLOCAL.status"], "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 RemoteLOCAL(RemoteBASE):\n\n def status(\n self,\n checksum_infos,\n remote,\n jobs=None,\n show_checksums=False,\n download=False,\n ):\n logger.info(\n \"Preparing to collect status from {}\".format(remote.path_info)\n )\n ret = self._group(checksum_infos, show_checksums=show_checksums) or {}\n md5s = list(ret)\n\n logger.info(\"Collecting information from local cache...\")\n local_exists = self.cache_exists(md5s)\n\n # This is a performance optimization. We can safely assume that,\n # if the resources that we want to fetch are already cached,\n # there's no need to check the remote storage for the existance of\n # those files.\n if download and sorted(local_exists) == sorted(md5s):\n remote_exists = local_exists\n else:\n logger.info(\"Collecting information from remote cache...\")\n remote_exists = list(remote.cache_exists(md5s))\n\n self._fill_statuses(ret, local_exists, remote_exists)\n\n self._log_missing_caches(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/remote/local/__init__.py_RemoteLOCAL._unprotect_file_RemoteLOCAL._unprotect_file.os_chmod_path_os_stat_pa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_RemoteLOCAL._unprotect_file_RemoteLOCAL._unprotect_file.os_chmod_path_os_stat_pa", "embedding": null, "metadata": {"file_path": "dvc/remote/local/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 457, "end_line": 478, "span_ids": ["RemoteLOCAL._unprotect_file"], "tokens": 213}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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()))\n\n # The operations order is important here - if some application\n # would access the file during the process of copyfile then it\n # would get only the part of file. So, at first, the file should be\n # copied with the temporary name, and then original file should be\n # replaced by new.\n copyfile(path, tmp, name=\"Unprotecting '{}'\".format(relpath(path)))\n remove(path)\n os.rename(tmp, path)\n\n else:\n logger.debug(\n \"Skipping copying for '{}', since it is not \"\n \"a symlink or a hardlink.\".format(path)\n )\n\n os.chmod(path, os.stat(path).st_mode | stat.S_IWRITE)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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/slow_link_detection.py_logging_SlowLinkDetectorDecorator.__call__.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/slow_link_detection.py_logging_SlowLinkDetectorDecorator.__call__.return.result", "embedding": null, "metadata": {"file_path": "dvc/remote/local/slow_link_detection.py", "file_name": "slow_link_detection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 45, "span_ids": ["SlowLinkDetectorDecorator.should_display", "imports", "SlowLinkDetectorDecorator.__init__", "SlowLinkDetectorDecorator.__call__", "SlowLinkDetectorDecorator"], "tokens": 271}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\nimport time\n\nimport colorama\nfrom dvc.config import Config\n\nlogger = logging.getLogger(__name__)\n\n\nclass SlowLinkDetectorDecorator(object):\n LINKING_TIMEOUT_SECONDS = 10.0\n was_displayed = False\n\n @classmethod\n def should_display(cls):\n if not cls.was_displayed:\n cls.was_displayed = True\n return True\n return False\n\n def __init__(self, method):\n self.method = method\n\n def __call__(self, *args, **kwargs):\n start = time.time()\n result = self.method(*args, **kwargs)\n execution_time_seconds = time.time() - start\n\n if (\n execution_time_seconds >= self.LINKING_TIMEOUT_SECONDS\n and self.should_display()\n ):\n msg = (\n \"You can cut execution time considerably by using a different\"\n \" `cache.type` configuration.\\nSee \"\n \"{blue}https://dvc.org/doc/commands-reference/config#cache{\"\n \"reset} for more information.\\n\"\n \"To disable this message, run:\\n\"\n \"'dvc config cache.slow_link_warning false'\".format(\n blue=colorama.Fore.BLUE, reset=colorama.Fore.RESET\n )\n )\n logger.warning(msg)\n\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/slow_link_detection.py_slow_link_guard_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/slow_link_detection.py_slow_link_guard_", "embedding": null, "metadata": {"file_path": "dvc/remote/local/slow_link_detection.py", "file_name": "slow_link_detection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 48, "end_line": 63, "span_ids": ["slow_link_guard"], "tokens": 114}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def slow_link_guard(method):\n def call(remote_local, *args, **kwargs):\n cache_config = remote_local.repo.config.config.get(\n Config.SECTION_CACHE, {}\n )\n should_warn = cache_config.get(\n Config.SECTION_CACHE_SLOW_LINK_WARNING, True\n ) and not cache_config.get(Config.SECTION_CACHE_TYPE, None)\n\n if should_warn:\n decorated = SlowLinkDetectorDecorator(method)\n return decorated(remote_local, *args, **kwargs)\n return method(remote_local, *args, **kwargs)\n\n return call", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3.copy_RemoteS3._list_paths.for_page_in_paginator_pag.for_item_in_contents_.yield_item_Key_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3.copy_RemoteS3._list_paths.for_page_in_paginator_pag.for_item_in_contents_.yield_item_Key_", "embedding": null, "metadata": {"file_path": "dvc/remote/s3.py", "file_name": "s3.py", "file_type": "text/x-python", "category": "implementation", "start_line": 198, "end_line": 222, "span_ids": ["RemoteS3._list_paths", "RemoteS3.remove", "RemoteS3.copy"], "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 RemoteS3(RemoteBASE):\n\n def copy(self, from_info, to_info, ctx=None):\n self._copy(ctx or self.s3, from_info, to_info, self.extra_args)\n\n def remove(self, path_info):\n if path_info.scheme != \"s3\":\n raise NotImplementedError\n\n logger.debug(\"Removing {}\".format(path_info))\n self.s3.delete_object(Bucket=path_info.bucket, Key=path_info.path)\n\n def _list_paths(self, bucket, prefix, s3=None):\n \"\"\" Read config for list object api, paginate through list objects.\"\"\"\n s3 = s3 or 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\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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._try_get_ssh_config_keyfile.return.None": {"__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._try_get_ssh_config_keyfile.return.None", "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": 106, "span_ids": ["RemoteSSH._try_get_ssh_config_port", "RemoteSSH.__init__", "imports", "RemoteSSH._try_get_ssh_config_keyfile", "RemoteSSH", "RemoteSSH.ssh_config_filename", "RemoteSSH._load_user_ssh_config"], "tokens": 683}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 getpass\nimport logging\nimport itertools\nimport errno\nfrom concurrent.futures import ThreadPoolExecutor\n\ntry:\n import paramiko\nexcept ImportError:\n paramiko = None\n\nimport dvc.prompt as prompt\nfrom dvc.remote.ssh.connection import SSHConnection\nfrom dvc.config import Config\nfrom dvc.utils import to_chunks\nfrom dvc.utils.compat import urlparse, StringIO\nfrom dvc.remote.base import RemoteBASE\nfrom dvc.scheme import Schemes\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass RemoteSSH(RemoteBASE):\n scheme = Schemes.SSH\n REQUIRES = {\"paramiko\": paramiko}\n\n JOBS = 4\n PARAM_CHECKSUM = \"md5\"\n DEFAULT_PORT = 22\n TIMEOUT = 1800\n\n def __init__(self, repo, config):\n super(RemoteSSH, self).__init__(repo, config)\n\n url = config.get(Config.SECTION_REMOTE_URL)\n if url:\n parsed = urlparse(url)\n user_ssh_config = self._load_user_ssh_config(parsed.hostname)\n\n host = user_ssh_config.get(\"hostname\", parsed.hostname)\n user = (\n config.get(Config.SECTION_REMOTE_USER)\n or parsed.username\n or user_ssh_config.get(\"user\")\n or getpass.getuser()\n )\n port = (\n config.get(Config.SECTION_REMOTE_PORT)\n or parsed.port\n or self._try_get_ssh_config_port(user_ssh_config)\n or self.DEFAULT_PORT\n )\n self.path_info = self.path_cls.from_parts(\n scheme=self.scheme,\n host=host,\n user=user,\n port=port,\n path=parsed.path,\n )\n else:\n self.path_info = None\n user_ssh_config = {}\n\n self.keyfile = config.get(\n Config.SECTION_REMOTE_KEY_FILE\n ) or self._try_get_ssh_config_keyfile(user_ssh_config)\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 @staticmethod\n def ssh_config_filename():\n return os.path.expanduser(os.path.join(\"~\", \".ssh\", \"config\"))\n\n @staticmethod\n def _load_user_ssh_config(hostname):\n user_config_file = RemoteSSH.ssh_config_filename()\n user_ssh_config = dict()\n if hostname and os.path.exists(user_config_file):\n ssh_config = paramiko.SSHConfig()\n with open(user_config_file) as f:\n # For whatever reason parsing directly from f is unreliable\n f_copy = StringIO(f.read())\n ssh_config.parse(f_copy)\n user_ssh_config = ssh_config.lookup(hostname)\n return user_ssh_config\n\n @staticmethod\n def _try_get_ssh_config_port(user_ssh_config):\n try:\n return int(user_ssh_config.get(\"port\"))\n except (ValueError, TypeError):\n return None\n\n @staticmethod\n def _try_get_ssh_config_keyfile(user_ssh_config):\n identity_file = user_ssh_config.get(\"identityfile\")\n if identity_file and len(identity_file) > 0:\n return identity_file[0]\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.active_stages_Repo.find_outs_by_path.return.matched": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.active_stages_Repo.find_outs_by_path.return.matched", "embedding": null, "metadata": {"file_path": "dvc/repo/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 505, "end_line": 537, "span_ids": ["Repo.active_stages", "Repo.find_outs_by_path"], "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 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.scheme == \"local\" and out.fspath == abs_path:\n return True\n\n if is_dir and recursive and out.path_info.isin(abs_path):\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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_add.return.stages": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/add.py_os_add.return.stages", "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": 40, "span_ids": ["add", "imports"], "tokens": 260}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport logging\nimport colorama\n\nfrom dvc.repo.scm_context import scm_context\nfrom dvc.stage import Stage\nfrom dvc.utils import walk_files, LARGE_DIR_SIZE\nfrom dvc.exceptions import RecursiveAddingWhileUsingFilename\n\n\nlogger = logging.getLogger(__name__)\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 if os.path.isdir(target) and len(targets) > LARGE_DIR_SIZE:\n logger.warning(\n \"You are adding a large directory '{target}' recursively,\"\n \" consider tracking it as a whole instead.\\n\"\n \"{purple}HINT:{nc} Remove the generated DVC-file and then\"\n \" run {cyan}dvc add {target}{nc}\".format(\n purple=colorama.Fore.MAGENTA,\n cyan=colorama.Fore.CYAN,\n nc=colorama.Style.RESET_ALL,\n target=target,\n )\n )\n\n stages = _create_stages(repo, targets, fname, no_commit)\n\n repo.check_dag(repo.stages() + stages)\n\n for stage in stages:\n stage.dump()\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/add.py__find_all_targets_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/add.py__find_all_targets_", "embedding": null, "metadata": {"file_path": "dvc/repo/add.py", "file_name": "add.py", "file_type": "text/x-python", "category": "implementation", "start_line": 43, "end_line": 74, "span_ids": ["_create_stages", "_find_all_targets"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _find_all_targets(repo, target, recursive):\n if os.path.isdir(target) and recursive:\n return [\n fname\n for fname in walk_files(target)\n if not repo.is_dvc_internal(fname)\n if not Stage.is_stage_file(fname)\n if not repo.scm.belongs_to_scm(fname)\n if not repo.scm.is_tracked(fname)\n ]\n return [target]\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/metrics/show.py__read_metrics__read_metrics.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/metrics/show.py__read_metrics__read_metrics.return.res", "embedding": null, "metadata": {"file_path": "dvc/repo/metrics/show.py", "file_name": "show.py", "file_type": "text/x-python", "category": "implementation", "start_line": 203, "end_line": 252, "span_ids": ["_read_metrics"], "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": "def _read_metrics(repo, 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 not typ:\n typ = os.path.splitext(out.fspath.lower())[1].replace(\".\", \"\")\n if out.use_cache:\n open_fun = open\n path = repo.cache.local.get(out.checksum)\n else:\n open_fun = repo.tree.open\n path = out.fspath\n try:\n\n with open_fun(path) as fd:\n metric = _read_metric(\n fd, typ=typ, xpath=xpath, fname=str(out), branch=branch\n )\n except IOError as e:\n if e.errno == errno.ENOENT:\n logger.warning(\n NO_METRICS_FILE_AT_REFERENCE_WARNING.format(\n out.path_info, branch\n )\n )\n metric = None\n else:\n raise\n\n if not metric:\n continue\n\n res[str(out)] = 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/scheme.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scheme.py__", "embedding": null, "metadata": {"file_path": "dvc/scheme.py", "file_name": "scheme.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 14, "span_ids": ["imports", "Schemes"], "tokens": 71}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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\nclass Schemes:\n SSH = \"ssh\"\n HDFS = \"hdfs\"\n S3 = \"s3\"\n AZURE = \"azure\"\n HTTP = \"http\"\n HTTPS = \"https\"\n GS = \"gs\"\n LOCAL = \"local\"\n OSS = \"oss\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.commit_Git.list_tags.return._t_name_for_t_in_self_git": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.commit_Git.list_tags.return._t_name_for_t_in_self_git", "embedding": null, "metadata": {"file_path": "dvc/scm/git/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 181, "end_line": 216, "span_ids": ["Git.is_tracked", "Git.is_dirty", "Git.commit", "Git.list_branches", "Git.checkout", "Git.untracked_files", "Git.list_tags", "Git.tag", "Git.branch", "Git.active_branch"], "tokens": 252}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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 = 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]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git._install_hook_Git._install_hook.os_chmod_hook_0o777_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git._install_hook_Git._install_hook.os_chmod_hook_0o777_", "embedding": null, "metadata": {"file_path": "dvc/scm/git/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 209, "end_line": 224, "span_ids": ["Git._install_hook"], "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 Git(Base):\n\n def _install_hook(self, name, cmd):\n command = \"dvc {}\".format(cmd)\n\n hook = os.path.join(self.root_dir, self.GIT_DIR, \"hooks\", name)\n\n if os.path.isfile(hook):\n with open(hook, \"r+\") as fobj:\n if command not in fobj.read():\n fobj.write(\"exec {command}\\n\".format(command=command))\n else:\n with open(hook, \"w+\") as fobj:\n fobj.write(\n \"#!/bin/sh\\n\" \"exec {command}\\n\".format(command=command)\n )\n\n os.chmod(hook, 0o777)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.install_Git.get_tree.return.GitTree_self_git_rev_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.install_Git.get_tree.return.GitTree_self_git_rev_", "embedding": null, "metadata": {"file_path": "dvc/scm/git/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 237, "end_line": 270, "span_ids": ["Git.cleanup_ignores", "Git.reset_ignores", "Git.install", "Git.track_file", "Git.belongs_to_scm", "Git.remind_to_track", "Git.get_tree"], "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 Git(Base):\n\n def install(self):\n self._install_hook(\"post-checkout\", \"checkout\")\n self._install_hook(\"pre-commit\", \"status\")\n self._install_hook(\"pre-push\", \"push\")\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/state.py_State_State._from_sqlite.return.num": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State_State._from_sqlite.return.num", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 45, "end_line": 148, "span_ids": ["State._execute", "State.__exit__", "State.__enter__", "State._fetchall", "State", "State._to_sqlite", "State.__init__", "State._from_sqlite"], "tokens": 717}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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(StateBase): # 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 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 _execute(self, cmd, parameters=()):\n logger.debug(cmd)\n return self.cursor.execute(cmd, parameters)\n\n def _fetchall(self):\n ret = self.cursor.fetchall()\n logger.debug(\"fetched: {}\".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/utils/__init__.py_copyfile_copyfile.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/utils/__init__.py_copyfile_copyfile.if_not_no_progress_bar_.progress_finish_target_na", "embedding": null, "metadata": {"file_path": "dvc/utils/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 115, "end_line": 142, "span_ids": ["copyfile"], "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 copyfile(src, dest, no_progress_bar=False, name=None):\n \"\"\"Copy file with progress bar\"\"\"\n from dvc.exceptions import DvcException\n from dvc.progress import progress\n from dvc.system import System\n\n copied = 0\n name = name if name else os.path.basename(dest)\n total = os.stat(src).st_size\n\n if os.path.isdir(dest):\n dest = os.path.join(dest, os.path.basename(src))\n\n try:\n System.reflink(src, dest)\n except DvcException:\n with open(src, \"rb\") as fsrc, open(dest, \"wb+\") as fdest:\n 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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {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-Crypto.py___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/hooks/hook-Crypto.py___", "embedding": null, "metadata": {"file_path": "scripts/hooks/hook-Crypto.py", "file_name": "hook-Crypto.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 61, "span_ids": ["docstring"], "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": "# -----------------------------------------------------------------------------\n\nimport os\nimport glob\n\nfrom PyInstaller.compat import EXTENSION_SUFFIXES\nfrom PyInstaller.utils.hooks import get_module_file_attribute\n\n# Include the modules as binaries in a subfolder named like the package.\n# Cryptodome's loader expects to find them inside the package directory for\n# the main module. We cannot use hiddenimports because that would add the\n# modules outside the package.\n\nbinaries = []\nbinary_module_names = [\n \"Crypto.Math\", # First in the list\n \"Crypto.Cipher\",\n \"Crypto.Util\",\n \"Crypto.Hash\",\n \"Crypto.Protocol\",\n]\n\ntry:\n for module_name in binary_module_names:\n m_dir = os.path.dirname(get_module_file_attribute(module_name))\n for ext in EXTENSION_SUFFIXES:\n module_bin = glob.glob(os.path.join(m_dir, \"_*%s\" % ext))\n for f in module_bin:\n binaries.append((f, module_name.replace(\".\", os.sep)))\nexcept ImportError:\n # Do nothing for PyCrypto (Crypto.Math does not exist there)\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/scripts/hooks/hook-aliyunsdkcore.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/scripts/hooks/hook-aliyunsdkcore.py__", "embedding": null, "metadata": {"file_path": "scripts/hooks/hook-aliyunsdkcore.py", "file_name": "hook-aliyunsdkcore.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 4, "span_ids": ["imports"], "tokens": 23}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 collect_data_files\n\ndatas = collect_data_files(\"aliyunsdkcore\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py__encoding_utf_8_TestDirFixture.setUp.self_create_self_UNICODE_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py__encoding_utf_8_TestDirFixture.setUp.self_create_self_UNICODE_", "embedding": null, "metadata": {"file_path": "tests/basic_env.py", "file_name": "basic_env.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 98, "span_ids": ["TestDirFixture.mkdtemp", "TestDirFixture.__init__", "TestDirFixture._pushd", "TestDirFixture.setUp", "TestDirFixture.create", "TestDirFixture", "TestDirFixture._popd", "docstring", "TestDirFixture.root_dir"], "tokens": 746}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# encoding: utf-8\n\nfrom __future__ import unicode_literals\n\nimport os\nimport shortuuid\nimport tempfile\nimport logging\nimport warnings\n\nfrom git import Repo\nfrom git.exc import GitCommandNotFound\nfrom unittest import TestCase\nimport pytest\n\nfrom dvc.repo import Repo as DvcRepo\nfrom dvc.utils.compat import open, str\nfrom dvc.utils import remove\n\n\nlogger = logging.getLogger(\"dvc\")\n\n\nclass TestDirFixture(object):\n DATA_DIR = \"data_dir\"\n DATA_SUB_DIR = os.path.join(DATA_DIR, \"data_sub_dir\")\n DATA = os.path.join(DATA_DIR, \"data\")\n DATA_SUB = os.path.join(DATA_SUB_DIR, \"data_sub\")\n DATA_CONTENTS = DATA\n DATA_SUB_CONTENTS = DATA_SUB\n FOO = \"foo\"\n FOO_CONTENTS = FOO\n BAR = \"bar\"\n # NOTE: len(FOO_CONTENTS) must be != len(BAR_CONTENTS)\n #\n # Our state database relies on file mtime and file size to determine\n # that a file has changed. Usually, mtime is enough by itself but on\n # some filesystems like APFS on macOS mtime resolution is so bad,\n # that our tests can overwrite a file in that time window without dvc\n # being able to detect that, thus causing tests to fail. Usually,\n # in tests, we replace foo with bar, so we need to make sure that when we\n # modify a file in our tests, its content length changes.\n BAR_CONTENTS = BAR + \"r\"\n CODE = \"code.py\"\n CODE_CONTENTS = (\n \"import sys\\nimport shutil\\n\"\n \"shutil.copyfile(sys.argv[1], sys.argv[2])\"\n )\n UNICODE = \"\u0442\u0435\u0441\u0442\"\n UNICODE_CONTENTS = \"\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\"\n\n def __init__(self):\n root_dir = self.mkdtemp()\n self._root_dir = os.path.realpath(root_dir)\n\n @property\n def root_dir(self):\n return self._root_dir\n\n def _pushd(self, d):\n if not hasattr(self, \"_saved_dir\"):\n self._saved_dir = os.path.realpath(os.curdir)\n os.chdir(d)\n\n def _popd(self):\n os.chdir(self._saved_dir)\n self._saved_dir = None\n\n def create(self, name, contents):\n dname = os.path.dirname(name)\n if len(dname) > 0 and not os.path.isdir(dname):\n os.makedirs(dname)\n\n with open(name, \"a\", encoding=\"utf-8\") as f:\n f.write(\n contents\n if isinstance(contents, str)\n else contents.decode(\"utf-8\")\n )\n\n @staticmethod\n def mkdtemp(base_directory=None):\n prefix = \"dvc-test.{}.\".format(os.getpid())\n suffix = \".{}\".format(shortuuid.uuid())\n return tempfile.mkdtemp(\n prefix=prefix, suffix=suffix, dir=base_directory\n )\n\n def setUp(self):\n self._pushd(self._root_dir)\n self.create(self.FOO, self.FOO_CONTENTS)\n self.create(self.BAR, self.BAR_CONTENTS)\n self.create(self.CODE, self.CODE_CONTENTS)\n os.mkdir(self.DATA_DIR)\n os.mkdir(self.DATA_SUB_DIR)\n self.create(self.DATA, self.DATA_CONTENTS)\n self.create(self.DATA_SUB, self.DATA_SUB_CONTENTS)\n self.create(self.UNICODE, self.UNICODE_CONTENTS)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py_TestDirFixture.tearDown_TestDirFixture.tearDown.try_.except_OSError_as_exc_.if_os_name_nt_and_ex.else_.raise": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py_TestDirFixture.tearDown_TestDirFixture.tearDown.try_.except_OSError_as_exc_.if_os_name_nt_and_ex.else_.raise", "embedding": null, "metadata": {"file_path": "tests/basic_env.py", "file_name": "basic_env.py", "file_type": "text/x-python", "category": "implementation", "start_line": 100, "end_line": 116, "span_ids": ["TestDirFixture.tearDown"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestDirFixture(object):\n\n def tearDown(self):\n self._popd()\n try:\n remove(self._root_dir)\n except OSError as exc:\n # We ignore this under Windows with a warning because it happened\n # to be really hard to trace all not properly closed files.\n #\n # Best guess so far is that gitpython is the culprit:\n # it opens files and uses __del__ to close them, which can happen\n # late in current pythons. TestGitFixture and TestDvcFixture try\n # to close that and it works on most of the tests, but not all.\n # Repos and thus git repos are created all over the dvc ;)\n if os.name == \"nt\" and exc.winerror == 32:\n warnings.warn(\"Failed to remove test dir: \" + str(exc))\n else:\n raise", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/conftest.py_from___future___import_un_repo_dir.try_.finally_.old_fixture_tearDown_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/conftest.py_from___future___import_un_repo_dir.try_.finally_.old_fixture_tearDown_", "embedding": null, "metadata": {"file_path": "tests/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 41, "span_ids": ["reset_loglevel", "imports", "repo_dir"], "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": "from __future__ import unicode_literals\nimport mockssh\nimport pytest\nimport os\nfrom git import Repo\nfrom git.exc import GitCommandNotFound\n\nfrom dvc.remote.config import RemoteConfig\nfrom dvc.utils.compat import cast_bytes_py2\nfrom dvc.remote.ssh.connection import SSHConnection\nfrom dvc.repo import Repo as DvcRepo\nfrom .basic_env import TestDirFixture, TestDvcGitFixture\n\n\n# Prevent updater and analytics from running their processes\nos.environ[cast_bytes_py2(\"DVC_TEST\")] = cast_bytes_py2(\"true\")\n\n\n@pytest.fixture(autouse=True)\ndef reset_loglevel(request, caplog):\n \"\"\"\n Use it to ensure log level at the start of each test\n regardless of dvc.logger.setup(), Repo configs or whatever.\n \"\"\"\n level = request.config.getoption(\"--log-level\")\n if level:\n with caplog.at_level(level.upper(), logger=\"dvc\"):\n yield\n else:\n yield\n\n\n# Wrap class like fixture as pytest-like one to avoid code duplication\n@pytest.fixture\ndef repo_dir():\n old_fixture = TestDirFixture()\n old_fixture.setUp()\n try:\n yield old_fixture\n finally:\n old_fixture.tearDown()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/conftest.py__NOTE_this_duplicates_c_git.try_.finally_.git_close_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/conftest.py__NOTE_this_duplicates_c_git.try_.finally_.git_close_", "embedding": null, "metadata": {"file_path": "tests/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 44, "end_line": 68, "span_ids": ["git", "repo_dir"], "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": "# NOTE: this duplicates code from GitFixture,\n# would fix itself once class-based fixtures are removed\n@pytest.fixture\ndef git(repo_dir):\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 = 5\n while True:\n try:\n git = Repo.init()\n break\n except GitCommandNotFound:\n retries -= 1\n if not retries:\n raise\n\n try:\n git.index.add([repo_dir.CODE])\n git.index.commit(\"add code\")\n yield git\n finally:\n git.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/tests/conftest.py_dvc_repo_ssh.yield_SSHConnection_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/conftest.py_dvc_repo_ssh.yield_SSHConnection_", "embedding": null, "metadata": {"file_path": "tests/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 71, "end_line": 96, "span_ids": ["dvc_repo", "ssh", "impl:2", "ssh_server"], "tokens": 129}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.fixture\ndef dvc_repo(repo_dir):\n yield DvcRepo.init(repo_dir._root_dir, no_scm=True)\n\n\nhere = os.path.abspath(os.path.dirname(__file__))\n\nuser = \"user\"\nkey_path = os.path.join(here, \"{0}.key\".format(user))\n\n\n@pytest.fixture\ndef ssh_server():\n users = {user: key_path}\n with mockssh.Server(users) as s:\n yield s\n\n\n@pytest.fixture\ndef ssh(ssh_server):\n yield SSHConnection(\n ssh_server.host,\n username=user,\n port=ssh_server.port,\n key_filename=key_path,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddUnupportedFile_TestAddDirectoryRecursive.test.self_assertEqual_len_stag": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddUnupportedFile_TestAddDirectoryRecursive.test.self_assertEqual_len_stag", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 59, "end_line": 87, "span_ids": ["TestAddUnupportedFile", "TestAddDirectory.test", "TestAddDirectoryRecursive", "TestAddDirectory", "TestAddUnupportedFile.test", "TestAddDirectoryRecursive.test"], "tokens": 219}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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\"])\n\n\nclass TestAddDirectoryRecursive(TestDvc):\n def test(self):\n stages = self.dvc.add(self.DATA_DIR, recursive=True)\n self.assertEqual(len(stages), 2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddCmdDirectoryRecursive_TestAddCmdDirectoryRecursive.test_warn_about_large_directories.with_self__caplog_at_leve.assert_warning_in_self__c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddCmdDirectoryRecursive_TestAddCmdDirectoryRecursive.test_warn_about_large_directories.with_self__caplog_at_leve.assert_warning_in_self__c", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 90, "end_line": 117, "span_ids": ["TestAddCmdDirectoryRecursive", "TestAddCmdDirectoryRecursive.test_warn_about_large_directories", "TestAddCmdDirectoryRecursive.test"], "tokens": 243}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestAddCmdDirectoryRecursive(TestDvc):\n def test(self):\n ret = main([\"add\", \"--recursive\", self.DATA_DIR])\n self.assertEqual(ret, 0)\n\n def test_warn_about_large_directories(self):\n warning = (\n \"You are adding a large directory 'large-dir' recursively,\"\n \" consider tracking it as a whole instead.\\n\"\n \"{purple}HINT:{nc} Remove the generated DVC-file and then\"\n \" run {cyan}dvc add large-dir{nc}\".format(\n purple=colorama.Fore.MAGENTA,\n cyan=colorama.Fore.CYAN,\n nc=colorama.Style.RESET_ALL,\n )\n )\n\n os.mkdir(\"large-dir\")\n\n # Create a lot of files\n for iteration in range(LARGE_DIR_SIZE + 1):\n path = os.path.join(\"large-dir\", str(iteration))\n with open(path, \"w\") as fobj:\n fobj.write(path)\n\n with self._caplog.at_level(logging.WARNING, logger=\"dvc\"):\n assert main([\"add\", \"--recursive\", \"large-dir\"]) == 0\n assert warning in self._caplog.messages", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestAddDirectoryWithForwardSlash_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/func/test_add.py_TestAddDirectoryWithForwardSlash_TestAddTrackedFile.test.with_self_assertRaises_Ou.self_dvc_add_fname_", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 120, "end_line": 140, "span_ids": ["TestAddTrackedFile", "TestAddDirectoryWithForwardSlash.test", "TestAddDirectoryWithForwardSlash", "TestAddTrackedFile.test"], "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 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(TestDvcGit):\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/func/test_add.py_TestShouldUpdateStateEntryForFileAfterAdd_TestShouldUpdateStateEntryForFileAfterAdd.test.with_patch_object_dvc_rem.None_11": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestShouldUpdateStateEntryForFileAfterAdd_TestShouldUpdateStateEntryForFileAfterAdd.test.with_patch_object_dvc_rem.None_11", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 254, "end_line": 280, "span_ids": ["TestShouldUpdateStateEntryForFileAfterAdd.test", "TestShouldUpdateStateEntryForFileAfterAdd"], "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 TestShouldUpdateStateEntryForFileAfterAdd(TestDvc):\n def test(self):\n file_md5_counter = spy(dvc.remote.local.file_md5)\n with patch.object(dvc.remote.local, \"file_md5\", file_md5_counter):\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, \"echo foo\"])\n self.assertEqual(ret, 0)\n self.assertEqual(file_md5_counter.mock.call_count, 1)\n\n os.rename(self.FOO, self.FOO + \".back\")\n ret = main([\"checkout\"])\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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestShouldUpdateStateEntryForDirectoryAfterAdd_TestShouldUpdateStateEntryForDirectoryAfterAdd.test.with_patch_object_dvc_rem.None_11": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_add.py_TestShouldUpdateStateEntryForDirectoryAfterAdd_TestShouldUpdateStateEntryForDirectoryAfterAdd.test.with_patch_object_dvc_rem.None_11", "embedding": null, "metadata": {"file_path": "tests/func/test_add.py", "file_name": "test_add.py", "file_type": "text/x-python", "category": "test", "start_line": 283, "end_line": 313, "span_ids": ["TestShouldUpdateStateEntryForDirectoryAfterAdd.test", "TestShouldUpdateStateEntryForDirectoryAfterAdd"], "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 TestShouldUpdateStateEntryForDirectoryAfterAdd(TestDvc):\n def test(self):\n file_md5_counter = spy(dvc.remote.local.file_md5)\n with patch.object(dvc.remote.local, \"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 ls = \"dir\" if os.name == \"nt\" else \"ls\"\n ret = main(\n [\"run\", \"-d\", self.DATA_DIR, \"{} {}\".format(ls, self.DATA_DIR)]\n )\n self.assertEqual(ret, 0)\n self.assertEqual(file_md5_counter.mock.call_count, 3)\n\n os.rename(self.DATA_DIR, self.DATA_DIR + \".back\")\n ret = main([\"checkout\"])\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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutTargetRecursiveShouldNotRemoveOtherUsedFiles_TestCheckoutRecursiveNotDirectory.test.try_.except_TargetNotDirectory.self_fail_should_not_rai": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_checkout.py_TestCheckoutTargetRecursiveShouldNotRemoveOtherUsedFiles_TestCheckoutRecursiveNotDirectory.test.try_.except_TargetNotDirectory.self_fail_should_not_rai", "embedding": null, "metadata": {"file_path": "tests/func/test_checkout.py", "file_name": "test_checkout.py", "file_type": "text/x-python", "category": "test", "start_line": 503, "end_line": 523, "span_ids": ["TestCheckoutTargetRecursiveShouldNotRemoveOtherUsedFiles", "TestCheckoutRecursiveNotDirectory", "TestCheckoutRecursiveNotDirectory.test", "TestCheckoutTargetRecursiveShouldNotRemoveOtherUsedFiles.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 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 try:\n self.dvc.checkout(target=self.FOO + \".dvc\", recursive=True)\n except TargetNotDirectoryError:\n self.fail(\"should not raise TargetNotDirectoryError\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_commit.py_pytest_test_commit_force.assert_dvc_repo_status_st": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_commit.py_pytest_test_commit_force.assert_dvc_repo_status_st", "embedding": null, "metadata": {"file_path": "tests/func/test_commit.py", "file_name": "test_commit.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 40, "span_ids": ["imports", "test_commit_force", "test_commit_recursive"], "tokens": 260}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\nfrom dvc.utils.stage import load_stage_file, dump_stage_file\n\nfrom dvc.stage import StageCommitError\n\n\ndef test_commit_recursive(dvc_repo, repo_dir):\n stages = dvc_repo.add(repo_dir.DATA_DIR, recursive=True, no_commit=True)\n assert len(stages) == 2\n\n assert dvc_repo.status() != {}\n\n dvc_repo.commit(repo_dir.DATA_DIR, recursive=True)\n\n assert dvc_repo.status() == {}\n\n\ndef test_commit_force(dvc_repo, repo_dir):\n stages = dvc_repo.add(repo_dir.FOO, no_commit=True)\n assert len(stages) == 1\n stage = stages[0]\n\n with dvc_repo.state:\n assert stage.outs[0].changed_cache()\n\n with open(repo_dir.FOO, \"a\") as fobj:\n fobj.write(repo_dir.FOO_CONTENTS)\n\n with dvc_repo.state:\n assert stage.outs[0].changed_cache()\n\n with pytest.raises(StageCommitError):\n dvc_repo.commit(stage.path)\n\n with dvc_repo.state:\n assert stage.outs[0].changed_cache()\n\n dvc_repo.commit(stage.path, force=True)\n\n assert dvc_repo.status(stage.path) == {}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_commit.py_test_commit_with_deps_test_commit_with_deps.None_1.assert_not_stage_outs_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_commit.py_test_commit_with_deps_test_commit_with_deps.None_1.assert_not_stage_outs_0_", "embedding": null, "metadata": {"file_path": "tests/func/test_commit.py", "file_name": "test_commit.py", "file_type": "text/x-python", "category": "test", "start_line": 43, "end_line": 67, "span_ids": ["test_commit_with_deps"], "tokens": 215}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_commit_with_deps(dvc_repo, repo_dir):\n stages = dvc_repo.add(repo_dir.FOO, no_commit=True)\n assert len(stages) == 1\n foo_stage = stages[0]\n assert foo_stage is not None\n assert len(foo_stage.outs) == 1\n\n fname = \"file\"\n stage = dvc_repo.run(\n cmd=\"python {} {} {}\".format(repo_dir.CODE, repo_dir.FOO, fname),\n outs=[fname],\n deps=[repo_dir.FOO, repo_dir.CODE],\n no_commit=True,\n )\n assert stage is not None\n assert len(stage.outs) == 1\n\n with dvc_repo.state:\n assert foo_stage.outs[0].changed_cache()\n assert stage.outs[0].changed_cache()\n\n dvc_repo.commit(stage.path, with_deps=True)\n with dvc_repo.state:\n assert not foo_stage.outs[0].changed_cache()\n assert not stage.outs[0].changed_cache()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_commit.py_test_commit_changed_md5_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_commit.py_test_commit_changed_md5_", "embedding": null, "metadata": {"file_path": "tests/func/test_commit.py", "file_name": "test_commit.py", "file_type": "text/x-python", "category": "test", "start_line": 70, "end_line": 83, "span_ids": ["test_commit_changed_md5"], "tokens": 111}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_commit_changed_md5(dvc_repo, repo_dir):\n stages = dvc_repo.add(repo_dir.FOO, no_commit=True)\n assert len(stages) == 1\n stage = stages[0]\n\n stage_file_content = load_stage_file(stage.path)\n stage_file_content[\"md5\"] = \"1111111111\"\n dump_stage_file(stage.path, stage_file_content)\n\n with pytest.raises(StageCommitError):\n dvc_repo.commit(stage.path)\n\n dvc_repo.commit(stage.path, force=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_from_subprocess_import_Ca__should_test_ssh.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_from_subprocess_import_Ca__should_test_ssh.return.True", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 133, "span_ids": ["_should_test_azure", "_should_test_oss", "_should_test_gcp", "imports", "_should_test_aws", "_should_test_ssh"], "tokens": 802}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 copy\nimport logging\nimport pytest\n\nfrom mock import patch\n\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 RemoteOSS,\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\nfrom dvc.utils.stage import load_stage_file, dump_stage_file\n\nfrom tests.basic_env import TestDvc\nfrom tests.conftest import user\nfrom tests.conftest import key_path\nfrom tests.utils import spy\n\n\nTEST_REMOTE = \"upstream\"\nTEST_SECTION = 'remote \"{}\"'.format(TEST_REMOTE)\nTEST_CONFIG = {\n Config.SECTION_CACHE: {},\n Config.SECTION_CORE: {Config.SECTION_CORE_REMOTE: TEST_REMOTE},\n TEST_SECTION: {Config.SECTION_REMOTE_URL: \"\"},\n}\n\nTEST_AWS_REPO_BUCKET = os.environ.get(\"DVC_TEST_AWS_REPO_BUCKET\", \"dvc-test\")\nTEST_GCP_REPO_BUCKET = os.environ.get(\"DVC_TEST_GCP_REPO_BUCKET\", \"dvc-test\")\nTEST_OSS_REPO_BUCKET = \"dvc-test\"\n\nTEST_GCP_CREDS_FILE = os.path.abspath(\n os.environ.get(\n \"GOOGLE_APPLICATION_CREDENTIALS\",\n os.path.join(\"scripts\", \"ci\", \"gcp-creds.json\"),\n )\n)\n# Ensure that absolute path is used\nos.environ[\"GOOGLE_APPLICATION_CREDENTIALS\"] = TEST_GCP_CREDS_FILE\n\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\n\n\ndef _should_test_gcp():\n if os.getenv(\"DVC_TEST_GCP\") == \"true\":\n return True\n\n if not os.path.exists(TEST_GCP_CREDS_FILE):\n return False\n\n try:\n check_output(\n [\n \"gcloud\",\n \"auth\",\n \"activate-service-account\",\n \"--key-file\",\n TEST_GCP_CREDS_FILE,\n ]\n )\n except (CalledProcessError, OSError):\n return False\n return True\n\n\ndef _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_oss():\n if os.getenv(\"DVC_TEST_OSS\") == \"true\":\n return True\n elif os.getenv(\"DVC_TEST_OSS\") == \"false\":\n return False\n\n return (\n os.getenv(\"OSS_ENDPOINT\")\n and os.getenv(\"OSS_ACCESS_KEY_ID\")\n and os.getenv(\"OSS_ACCESS_KEY_SECRET\")\n )\n\n\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/func/test_data_cloud.py__should_test_hdfs_get_ssh_url.return._ssh_127_0_0_1_22_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py__should_test_hdfs_get_ssh_url.return._ssh_127_0_0_1_22_", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 135, "end_line": 169, "span_ids": ["get_local_url", "get_local_storagepath", "get_ssh_url", "_should_test_hdfs"], "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 _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\n\n\ndef 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:22{}\".format(\n getpass.getuser(), get_local_storagepath()\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_get_ssh_url_mocked_get_ssh_url_mocked.return.url": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_get_ssh_url_mocked_get_ssh_url_mocked.return.url", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 173, "end_line": 189, "span_ids": ["get_ssh_url_mocked"], "tokens": 237}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_ssh_url_mocked(user, port):\n path = get_local_storagepath()\n if os.name == \"nt\":\n # NOTE: On Windows get_local_storagepath() will return an ntpath\n # that looks something like `C:\\some\\path`, which is not compatible\n # with SFTP paths [1], so we need to convert it to a proper posixpath.\n # To do that, we should construct a posixpath that would be relative\n # to the server's root. In our case our ssh server is running with\n # `c:/` as a root, and our URL format requires absolute paths, so the\n # resulting path would look like `/some/path`.\n #\n # [1]https://tools.ietf.org/html/draft-ietf-secsh-filexfer-13#section-6\n drive, path = os.path.splitdrive(path)\n assert drive.lower() == \"c:\"\n path = path.replace(\"\\\\\", \"/\")\n url = \"ssh://{}@127.0.0.1:{}{}\".format(user, port, path)\n return url", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_get_hdfs_url_get_oss_url.return._oss_format_get_oss": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_get_hdfs_url_get_oss_url.return._oss_format_get_oss", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 192, "end_line": 225, "span_ids": ["get_aws_storagepath", "get_oss_storagepath", "get_gcp_storagepath", "get_hdfs_url", "get_aws_url", "get_gcp_url", "get_oss_url", "get_azure_url"], "tokens": 206}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def 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():\n container_name = os.getenv(\"AZURE_STORAGE_CONTAINER_NAME\")\n assert container_name is not None\n return \"azure://{}/{}\".format(container_name, str(uuid.uuid4()))\n\n\ndef get_oss_storagepath():\n return \"{}/{}\".format(TEST_OSS_REPO_BUCKET, (uuid.uuid4()))\n\n\ndef get_oss_url():\n return \"oss://{}\".format(get_oss_storagepath())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRemoteSSHMocked_TestRemoteHDFS._get_cloud_class.return.RemoteHDFS": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRemoteSSHMocked_TestRemoteHDFS._get_cloud_class.return.RemoteHDFS", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 462, "end_line": 490, "span_ids": ["TestRemoteHDFS._get_url", "TestRemoteSSHMocked._get_cloud_class", "TestRemoteSSHMocked._should_test", "TestRemoteSSHMocked.setup_method_fixture", "TestRemoteSSHMocked._get_url", "TestRemoteHDFS._should_test", "TestRemoteSSHMocked._get_keyfile", "TestRemoteHDFS._get_cloud_class", "TestRemoteHDFS", "TestRemoteSSHMocked"], "tokens": 170}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.usefixtures(\"ssh_server\")\nclass TestRemoteSSHMocked(TestDataCloudBase):\n @pytest.fixture(autouse=True)\n def setup_method_fixture(self, request, ssh_server):\n self.ssh_server = ssh_server\n self.method_name = request.function.__name__\n\n def _get_url(self):\n return get_ssh_url_mocked(user, self.ssh_server.port)\n\n def _get_keyfile(self):\n return key_path\n\n def _should_test(self):\n return True\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/func/test_data_cloud.py_TestDataCloudCLIBase_TestDataCloudCLIBase.test.self__test_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestDataCloudCLIBase_TestDataCloudCLIBase.test.self__test_", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 493, "end_line": 576, "span_ids": ["TestDataCloudCLIBase.test", "TestDataCloudCLIBase._test", "TestDataCloudCLIBase._test_cloud", "TestDataCloudCLIBase", "TestDataCloudCLIBase._should_test", "TestDataCloudCLIBase.main"], "tokens": 598}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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_path\n\n stages = self.dvc.add(self.DATA_DIR)\n self.assertEqual(len(stages), 1)\n stage_dir = stages[0]\n self.assertTrue(stage_dir is not None)\n cache_dir = stage_dir.outs[0].cache_path\n\n # FIXME check status output\n 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 not self._should_test():\n raise SkipTest(\n \"Test {} is disabled\".format(self.__class__.__name__)\n )\n self._test()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_from___future___import_un_TestDiff.test.self_assertEqual_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_from___future___import_un_TestDiff.test.self_assertEqual_", "embedding": null, "metadata": {"file_path": "tests/func/test_diff.py", "file_name": "test_diff.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 56, "span_ids": ["TestDiff", "TestDiff.setUp", "imports", "_get_checksum", "TestDiff.test"], "tokens": 390}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import unicode_literals\n\nimport os\n\nfrom dvc.main import main\n\n\nfrom dvc.scm.base import FileNotInCommitError\nimport dvc.repo.diff as diff\nfrom dvc.command.diff import CmdDiff\n\n\nfrom tests.basic_env import TestDvcGit\n\n\ndef _get_checksum(repo, file_name):\n outs = [out for s in repo.stages() for out in s.outs]\n for out in outs:\n if out.def_path == file_name:\n return out.checksum\n\n\nclass TestDiff(TestDvcGit):\n def setUp(self):\n super(TestDiff, self).setUp()\n\n self.new_file = \"new_test_file\"\n self.create(self.new_file, self.new_file)\n self.dvc.add(self.new_file)\n self.a_ref = self.git.git.rev_parse(self.git.head.commit, short=True)\n self.new_checksum = _get_checksum(self.dvc, self.new_file)\n self.git.index.add([self.new_file + \".dvc\"])\n self.git.index.commit(\"adds new_file\")\n self.test_dct = {\n diff.DIFF_A_REF: self.a_ref,\n diff.DIFF_B_REF: self.git.git.rev_parse(\n self.git.head.commit, short=True\n ),\n diff.DIFF_LIST: [\n {\n diff.DIFF_TARGET: self.new_file,\n diff.DIFF_NEW_FILE: self.new_file,\n diff.DIFF_NEW_CHECKSUM: self.new_checksum,\n diff.DIFF_SIZE: 13,\n }\n ],\n }\n\n def test(self):\n out = self.dvc.scm.get_diff_trees(self.a_ref)\n self.assertFalse(out[diff.DIFF_EQUAL])\n self.assertEqual(self.a_ref, out[diff.DIFF_A_REF])\n self.assertEqual(\n self.git.git.rev_parse(self.git.head.commit, short=True),\n out[diff.DIFF_B_REF],\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_TestDiffDir_TestDiffDir.test.self_assertEqual_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_TestDiffDir_TestDiffDir.test.self_assertEqual_", "embedding": null, "metadata": {"file_path": "tests/func/test_diff.py", "file_name": "test_diff.py", "file_type": "text/x-python", "category": "test", "start_line": 91, "end_line": 116, "span_ids": ["TestDiffDir", "TestDiffDir.setUp", "TestDiffDir.test"], "tokens": 256}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestDiffDir(TestDvcGit):\n def setUp(self):\n super(TestDiffDir, self).setUp()\n\n self.dvc.add(self.DATA_DIR)\n self.git.index.add([self.DATA_DIR + \".dvc\"])\n self.git.index.commit(\"adds data_dir\")\n self.a_ref = self.git.git.rev_parse(\n self.dvc.scm.git.head.commit, short=True\n )\n self.old_checksum = _get_checksum(self.dvc, self.DATA_DIR)\n self.new_file = os.path.join(self.DATA_SUB_DIR, diff.DIFF_NEW_FILE)\n self.create(self.new_file, self.new_file)\n self.dvc.add(self.DATA_DIR)\n self.git.index.add([self.DATA_DIR + \".dvc\"])\n self.git.index.commit(message=\"adds data_dir with new_file\")\n self.new_checksum = _get_checksum(self.dvc, self.DATA_DIR)\n\n def test(self):\n out = self.dvc.scm.get_diff_trees(self.a_ref)\n self.assertFalse(out[diff.DIFF_EQUAL])\n self.assertEqual(self.a_ref, out[diff.DIFF_A_REF])\n self.assertEqual(\n self.git.git.rev_parse(self.git.head.commit, short=True),\n out[diff.DIFF_B_REF],\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_install.py_TestInstall.test_should_post_checkout_hook_checkout_TestInstall.test_should_post_checkout_hook_checkout.assert_os_path_isfile_rep": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_install.py_TestInstall.test_should_post_checkout_hook_checkout_TestInstall.test_should_post_checkout_hook_checkout.assert_os_path_isfile_rep", "embedding": null, "metadata": {"file_path": "tests/func/test_install.py", "file_name": "test_install.py", "file_type": "text/x-python", "category": "test", "start_line": 53, "end_line": 65, "span_ids": ["TestInstall.test_should_post_checkout_hook_checkout"], "tokens": 143}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(\n sys.platform == \"win32\", reason=\"Git hooks aren't supported on Windows\"\n)\nclass TestInstall(object):\n\n def test_should_post_checkout_hook_checkout(self, repo_dir, git, dvc_repo):\n assert main([\"install\"]) == 0\n\n stage_file = repo_dir.FOO + Stage.STAGE_FILE_SUFFIX\n\n dvc_repo.add(repo_dir.FOO)\n dvc_repo.scm.add([\".gitignore\", stage_file])\n dvc_repo.scm.commit(\"add\")\n\n os.unlink(repo_dir.FOO)\n dvc_repo.scm.checkout(\"new_branc\", create_new=True)\n\n assert os.path.isfile(repo_dir.FOO)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_install.py_TestInstall.test_should_pre_push_hook_push_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_install.py_TestInstall.test_should_pre_push_hook_push_", "embedding": null, "metadata": {"file_path": "tests/func/test_install.py", "file_name": "test_install.py", "file_type": "text/x-python", "category": "test", "start_line": 67, "end_line": 93, "span_ids": ["TestInstall.test_should_pre_push_hook_push"], "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": "@pytest.mark.skipif(\n sys.platform == \"win32\", reason=\"Git hooks aren't supported on Windows\"\n)\nclass TestInstall(object):\n\n def test_should_pre_push_hook_push(self, repo_dir, git, dvc_repo):\n assert main([\"install\"]) == 0\n\n temp = repo_dir.mkdtemp()\n git_remote = os.path.join(temp, \"project.git\")\n storage_path = os.path.join(temp, \"dvc_storage\")\n\n foo_checksum = file_md5(repo_dir.FOO)[0]\n expected_cache_path = dvc_repo.cache.local.get(foo_checksum)\n\n ret = main([\"remote\", \"add\", \"-d\", \"store\", storage_path])\n assert ret == 0\n\n ret = main([\"add\", repo_dir.FOO])\n assert ret == 0\n\n stage_file = repo_dir.FOO + Stage.STAGE_FILE_SUFFIX\n dvc_repo.scm.git.index.add([stage_file, \".gitignore\"])\n dvc_repo.scm.git.index.commit(\"commit message\")\n\n dvc_repo.scm.git.clone(git_remote)\n dvc_repo.scm.git.create_remote(\"origin\", git_remote)\n\n dvc_repo.scm.git.git.push(\"origin\", \"master\")\n\n assert os.path.isfile(expected_cache_path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py__coding_utf_8__TestMetricsBase.setUp.self_dvc_scm_checkout_ma": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py__coding_utf_8__TestMetricsBase.setUp.self_dvc_scm_checkout_ma", "embedding": null, "metadata": {"file_path": "tests/func/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 83, "span_ids": ["TestMetricsBase", "TestMetricsBase.setUp", "docstring"], "tokens": 513}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 -*-\nfrom __future__ import unicode_literals\n\nimport os\nimport json\nimport logging\n\nfrom dvc.repo import Repo as DvcRepo\nfrom dvc.main import main\nfrom dvc.exceptions import DvcException, BadMetricError, NoMetricsError\nfrom dvc.repo.metrics.show import NO_METRICS_FILE_AT_REFERENCE_WARNING\nfrom dvc.stage import Stage\nfrom dvc.utils import relpath\nfrom tests.basic_env import TestDvcGit\n\n\nclass TestMetricsBase(TestDvcGit):\n def setUp(self):\n super(TestMetricsBase, self).setUp()\n self.dvc.scm.commit(\"init\")\n\n branches = [\"foo\", \"bar\", \"baz\"]\n\n for branch in branches:\n self.dvc.scm.git.create_head(branch)\n\n for branch in branches:\n self.dvc.scm.checkout(branch)\n\n self.create(\"metric\", branch)\n self.create(\"metric_json\", json.dumps({\"branch\": branch}))\n self.create(\"metric_csv\", branch)\n self.create(\"metric_hcsv\", \"branch\\n\" + branch)\n self.create(\"metric_tsv\", branch)\n self.create(\"metric_htsv\", \"branch\\n\" + branch)\n\n if branch == \"foo\":\n deviation_mse_train = 0.173461\n else:\n deviation_mse_train = 0.356245\n\n self.create(\n \"metric_json_ext\",\n json.dumps(\n {\n \"metrics\": [\n {\n \"dataset\": \"train\",\n \"deviation_mse\": deviation_mse_train,\n \"value_mse\": 0.421601,\n },\n {\n \"dataset\": \"testing\",\n \"deviation_mse\": 0.289545,\n \"value_mse\": 0.297848,\n },\n {\n \"dataset\": \"validation\",\n \"deviation_mse\": 0.67528,\n \"value_mse\": 0.671502,\n },\n ]\n }\n ),\n )\n\n files = [\n \"metric\",\n \"metric_json\",\n \"metric_tsv\",\n \"metric_htsv\",\n \"metric_csv\",\n \"metric_hcsv\",\n \"metric_json_ext\",\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/func/test_metrics.py_TestMetrics_TestMetrics.test_show.None_27": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestMetrics_TestMetrics.test_show.None_27", "embedding": null, "metadata": {"file_path": "tests/func/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 85, "end_line": 151, "span_ids": ["TestMetrics", "TestMetrics.test_show"], "tokens": 660}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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(TestMetricsBase):\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\"])\n\n ret = self.dvc.metrics.show(\n \"metric_json_ext\",\n typ=\"json\",\n xpath=\"$.metrics[?(@.deviation_mse<0.30) & (@.value_mse>0.4)]\",\n all_branches=True,\n )\n self.assertEqual(len(ret), 1)\n self.assertSequenceEqual(\n ret[\"foo\"][\"metric_json_ext\"],\n [\n {\n \"dataset\": \"train\",\n \"deviation_mse\": 0.173461,\n \"value_mse\": 0.421601,\n }\n ],\n )\n self.assertRaises(KeyError, lambda: ret[\"bar\"])\n self.assertRaises(KeyError, lambda: ret[\"baz\"])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestMetricsType.test_show_TestMetricsType._do_show.for_branch_in_self_branch.if_isinstance_ret_branch_.else_.self_assertSequenceEqual_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestMetricsType.test_show_TestMetricsType._do_show.for_branch_in_self_branch.if_isinstance_ret_branch_.else_.self_assertSequenceEqual_", "embedding": null, "metadata": {"file_path": "tests/func/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 775, "end_line": 786, "span_ids": ["TestMetricsType.test_show", "TestMetricsType._do_show"], "tokens": 133}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestMetricsType(TestDvcGit):\n\n def test_show(self):\n for file_name, xpath in zip(self.files, self.xpaths):\n self._do_show(file_name, xpath)\n\n def _do_show(self, file_name, xpath):\n ret = self.dvc.metrics.show(file_name, xpath=xpath, all_branches=True)\n self.assertEqual(len(ret), 3)\n for branch in self.branches:\n if isinstance(ret[branch][file_name], list):\n self.assertSequenceEqual(ret[branch][file_name], [branch])\n else:\n self.assertSequenceEqual(ret[branch][file_name], 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/func/test_metrics.py_TestShouldDisplayMetricsEvenIfMetricIsMissing_TestShouldDisplayMetricsEvenIfMetricIsMissing.setUp.self__commit_metric_dvc_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestShouldDisplayMetricsEvenIfMetricIsMissing_TestShouldDisplayMetricsEvenIfMetricIsMissing.setUp.self__commit_metric_dvc_", "embedding": null, "metadata": {"file_path": "tests/func/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 786, "end_line": 808, "span_ids": ["TestShouldDisplayMetricsEvenIfMetricIsMissing._write_metric", "TestShouldDisplayMetricsEvenIfMetricIsMissing", "TestShouldDisplayMetricsEvenIfMetricIsMissing._commit_metric", "TestShouldDisplayMetricsEvenIfMetricIsMissing.setUp"], "tokens": 182}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShouldDisplayMetricsEvenIfMetricIsMissing(object):\n BRANCH_MISSING_METRIC = \"missing_metric_branch\"\n METRIC_FILE = \"metric\"\n METRIC_FILE_STAGE = METRIC_FILE + Stage.STAGE_FILE_SUFFIX\n\n def _write_metric(self):\n with open(self.METRIC_FILE, \"w+\") as fd:\n fd.write(\"0.5\")\n fd.flush()\n\n def _commit_metric(self, dvc, branch):\n dvc.scm.add([self.METRIC_FILE_STAGE])\n dvc.scm.commit(\"{} commit\".format(branch))\n\n def setUp(self, dvc):\n dvc.scm.branch(self.BRANCH_MISSING_METRIC)\n\n self._write_metric()\n\n ret = main([\"run\", \"-m\", self.METRIC_FILE])\n assert 0 == ret\n\n self._commit_metric(dvc, \"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/func/test_metrics.py_TestShouldDisplayMetricsEvenIfMetricIsMissing.test_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_metrics.py_TestShouldDisplayMetricsEvenIfMetricIsMissing.test_", "embedding": null, "metadata": {"file_path": "tests/func/test_metrics.py", "file_name": "test_metrics.py", "file_type": "text/x-python", "category": "test", "start_line": 813, "end_line": 834, "span_ids": ["TestShouldDisplayMetricsEvenIfMetricIsMissing.test"], "tokens": 161}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShouldDisplayMetricsEvenIfMetricIsMissing(object):\n\n def test(self, git, dvc_repo, caplog):\n self.setUp(dvc_repo)\n\n dvc_repo.scm.checkout(self.BRANCH_MISSING_METRIC)\n\n self._write_metric()\n ret = main([\"run\", \"-M\", self.METRIC_FILE])\n assert 0 == ret\n\n self._commit_metric(dvc_repo, self.BRANCH_MISSING_METRIC)\n os.remove(self.METRIC_FILE)\n\n ret = main([\"metrics\", \"show\", \"-a\"])\n\n assert (\n NO_METRICS_FILE_AT_REFERENCE_WARNING.format(\n self.METRIC_FILE, self.BRANCH_MISSING_METRIC\n )\n in caplog.text\n )\n assert 0 == ret", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_TestRemoteShouldHandleUppercaseRemoteName_test_large_dir_progress.with_patch_object_progres.assert_update_target_call": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_TestRemoteShouldHandleUppercaseRemoteName_test_large_dir_progress.with_patch_object_progres.assert_update_target_call", "embedding": null, "metadata": {"file_path": "tests/func/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 162, "end_line": 187, "span_ids": ["TestRemoteShouldHandleUppercaseRemoteName.test", "test_large_dir_progress", "TestRemoteShouldHandleUppercaseRemoteName"], "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 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)\n\n\ndef test_large_dir_progress(repo_dir, dvc_repo):\n from dvc.utils import LARGE_DIR_SIZE\n from dvc.progress import progress\n\n # Create a \"large dir\"\n for i in range(LARGE_DIR_SIZE + 1):\n repo_dir.create(os.path.join(\"gen\", \"{}.txt\".format(i)), str(i))\n\n with patch.object(progress, \"update_target\") as update_target:\n dvc_repo.add(\"gen\")\n assert update_target.called", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_repro_dir_repro_dir.yield_repo_dir": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_repro_dir_repro_dir.yield_repo_dir", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1373, "end_line": 1440, "span_ids": ["repro_dir"], "tokens": 556}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.fixture\ndef repro_dir(dvc_repo, repo_dir):\n repo_dir.dname = \"dir\"\n os.mkdir(repo_dir.dname)\n repo_dir.emptydname = \"emptydir\"\n os.mkdir(repo_dir.emptydname)\n subdname = os.path.join(repo_dir.dname, \"subdir\")\n os.mkdir(subdname)\n\n repo_dir.source = \"source\"\n repo_dir.source_stage = repo_dir.source + \".dvc\"\n stage = dvc_repo.run(\n fname=repo_dir.source_stage,\n outs=[repo_dir.source],\n deps=[repo_dir.FOO],\n )\n assert stage is not None\n assert filecmp.cmp(repo_dir.source, repo_dir.FOO, shallow=False)\n\n repo_dir.unrelated1 = \"unrelated1\"\n repo_dir.unrelated1_stage = repo_dir.unrelated1 + \".dvc\"\n stage = dvc_repo.run(\n fname=repo_dir.unrelated1_stage,\n outs=[repo_dir.unrelated1],\n deps=[repo_dir.source],\n )\n assert stage is not None\n\n repo_dir.unrelated2 = \"unrelated2\"\n repo_dir.unrelated2_stage = repo_dir.unrelated2 + \".dvc\"\n stage = dvc_repo.run(\n fname=repo_dir.unrelated2_stage,\n outs=[repo_dir.unrelated2],\n deps=[repo_dir.DATA],\n )\n assert stage is not None\n\n repo_dir.first = os.path.join(repo_dir.dname, \"first\")\n repo_dir.first_stage = repo_dir.first + \".dvc\"\n\n stage = dvc_repo.run(\n fname=repo_dir.first_stage,\n deps=[repo_dir.source],\n outs=[repo_dir.first],\n cmd=\"python {} {} {}\".format(\n repo_dir.CODE, repo_dir.source, repo_dir.first\n ),\n )\n assert stage is not None\n assert filecmp.cmp(repo_dir.first, repo_dir.FOO, shallow=False)\n\n repo_dir.second = os.path.join(subdname, \"second\")\n repo_dir.second_stage = repo_dir.second + \".dvc\"\n stage = dvc_repo.run(\n fname=repo_dir.second_stage,\n outs=[repo_dir.second],\n deps=[repo_dir.DATA],\n )\n assert stage is not None\n assert filecmp.cmp(repo_dir.second, repo_dir.DATA, shallow=False)\n\n repo_dir.third_stage = os.path.join(repo_dir.dname, \"Dvcfile\")\n stage = dvc_repo.run(\n fname=repo_dir.third_stage, deps=[repo_dir.first, repo_dir.second]\n )\n assert stage is not None\n\n yield repo_dir", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_recursive_repro_default_test_recursive_repro_default.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_recursive_repro_default_test_recursive_repro_default.None_5", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1443, "end_line": 1459, "span_ids": ["test_recursive_repro_default"], "tokens": 189}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_recursive_repro_default(dvc_repo, repro_dir):\n \"\"\"\n Test recursive repro on dir after a dep outside this dir has changed.\n \"\"\"\n os.unlink(repro_dir.FOO)\n shutil.copyfile(repro_dir.BAR, repro_dir.FOO)\n\n stages = dvc_repo.reproduce(repro_dir.dname, recursive=True)\n # Check that the dependency (\"source\") and the dependent stages\n # inside the folder have been reproduced (\"first\", \"third\")\n assert len(stages) == 3\n names = [stage.relpath for stage in stages]\n assert repro_dir.source_stage in names\n assert repro_dir.first_stage in names\n assert repro_dir.third_stage in names\n assert filecmp.cmp(repro_dir.source, repro_dir.BAR, shallow=False)\n assert filecmp.cmp(repro_dir.first, repro_dir.BAR, shallow=False)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_recursive_repro_single_test_recursive_repro_single.assert_filecmp_cmp_repro_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_recursive_repro_single_test_recursive_repro_single.assert_filecmp_cmp_repro_", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1462, "end_line": 1484, "span_ids": ["test_recursive_repro_single"], "tokens": 224}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_recursive_repro_single(dvc_repo, repro_dir):\n \"\"\"\n Test recursive single-item repro on dir\n after a dep outside this dir has changed.\n \"\"\"\n os.unlink(repro_dir.FOO)\n shutil.copyfile(repro_dir.BAR, repro_dir.FOO)\n\n os.unlink(repro_dir.DATA)\n shutil.copyfile(repro_dir.BAR, repro_dir.DATA)\n\n stages = dvc_repo.reproduce(\n repro_dir.dname, recursive=True, single_item=True\n )\n # Check that just stages inside given dir\n # with changed direct deps have been reproduced.\n # This means that \"first\" stage should not be reproduced\n # since it depends on \"source\".\n # Also check that \"second\" stage was reproduced before \"third\" stage\n assert len(stages) == 2\n assert repro_dir.second_stage == stages[0].relpath\n assert repro_dir.third_stage == stages[1].relpath\n assert filecmp.cmp(repro_dir.second, repro_dir.BAR, shallow=False)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_recursive_repro_single_force_test_recursive_repro_single_force.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_recursive_repro_single_force_test_recursive_repro_single_force.None_5", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1487, "end_line": 1508, "span_ids": ["test_recursive_repro_single_force"], "tokens": 203}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_recursive_repro_single_force(dvc_repo, repro_dir):\n \"\"\"\n Test recursive single-item force repro on dir\n without any dependencies changing.\n \"\"\"\n stages = dvc_repo.reproduce(\n repro_dir.dname, recursive=True, single_item=True, force=True\n )\n assert len(stages) == 3\n names = [stage.relpath for stage in stages]\n # Check that all stages inside given dir have been reproduced\n # Also check that \"second\" stage was reproduced before \"third\" stage\n # and that \"first\" stage was reproduced before \"third\" stage\n assert repro_dir.first_stage in names\n assert repro_dir.second_stage in names\n assert repro_dir.third_stage in names\n assert names.index(repro_dir.first_stage) < names.index(\n repro_dir.third_stage\n )\n assert names.index(repro_dir.second_stage) < names.index(\n repro_dir.third_stage\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_recursive_repro_empty_dir_test_recursive_repro_on_stage_file.assert_repro_dir_first_st": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_recursive_repro_empty_dir_test_recursive_repro_on_stage_file.assert_repro_dir_first_st", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1511, "end_line": 1541, "span_ids": ["test_recursive_repro_recursive_missing_file", "test_recursive_repro_on_stage_file", "test_recursive_repro_empty_dir"], "tokens": 231}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_recursive_repro_empty_dir(dvc_repo, repro_dir):\n \"\"\"\n Test recursive repro on an empty directory\n \"\"\"\n stages = dvc_repo.reproduce(\n repro_dir.emptydname, recursive=True, force=True\n )\n assert len(stages) == 0\n\n\ndef test_recursive_repro_recursive_missing_file(dvc_repo):\n \"\"\"\n Test recursive repro on a missing file\n \"\"\"\n with pytest.raises(StageFileDoesNotExistError):\n dvc_repo.reproduce(\"notExistingStage.dvc\", recursive=True)\n with pytest.raises(StageFileDoesNotExistError):\n dvc_repo.reproduce(\"notExistingDir/\", recursive=True)\n\n\ndef test_recursive_repro_on_stage_file(dvc_repo, repro_dir):\n \"\"\"\n Test recursive repro on a stage file instead of directory\n \"\"\"\n stages = dvc_repo.reproduce(\n repro_dir.first_stage, recursive=True, force=True\n )\n assert len(stages) == 2\n names = [stage.relpath for stage in stages]\n assert repro_dir.source_stage in names\n assert repro_dir.first_stage in names", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py__format_dvc_line__hide_md5.return.re_sub_r_b_a_f0_9_32_b": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py__format_dvc_line__hide_md5.return.re_sub_r_b_a_f0_9_32_b", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1580, "end_line": 1593, "span_ids": ["_format_dvc_line", "_hide_md5"], "tokens": 138}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _format_dvc_line(line):\n # Add line comment for all cache and md5 keys\n if \"cache:\" in line or \"md5:\" in line:\n return line + \" # line comment\"\n # Format command as one word per line\n elif line.startswith(\"cmd: \"):\n pre, command = line.split(None, 1)\n return pre + \" >\\n\" + \"\\n\".join(\" \" + s for s in command.split())\n else:\n return line\n\n\ndef _hide_md5(text):\n return re.sub(r\"\\b[a-f0-9]{32}\\b\", \"\", text)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestRunUnprotectOutsCopy_TestRunUnprotectOutsCopy.test.None_2.self_assertEqual_fd_read_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestRunUnprotectOutsCopy_TestRunUnprotectOutsCopy.test.None_2.self_assertEqual_fd_read_", "embedding": null, "metadata": {"file_path": "tests/func/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 357, "end_line": 404, "span_ids": ["TestRunUnprotectOutsCopy.test", "TestRunUnprotectOutsCopy"], "tokens": 309}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "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 with open(self.FOO, \"r\") as fd:\n self.assertEqual(fd.read(), \"foo\")\n\n ret = main(\n [\n \"run\",\n \"--overwrite-dvcfile\",\n \"--ignore-build-cache\",\n \"-d\",\n self.CODE,\n \"-o\",\n self.FOO,\n \"python\",\n self.CODE,\n self.FOO,\n ]\n )\n self.assertEqual(ret, 0)\n self.assertFalse(os.access(self.FOO, os.W_OK))\n with open(self.FOO, \"r\") as fd:\n self.assertEqual(fd.read(), \"foo\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestRunUnprotectOutsSymlink_TestRunUnprotectOutsSymlink.test.None_2.self_assertEqual_fd_read_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestRunUnprotectOutsSymlink_TestRunUnprotectOutsSymlink.test.None_2.self_assertEqual_fd_read_", "embedding": null, "metadata": {"file_path": "tests/func/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 407, "end_line": 458, "span_ids": ["TestRunUnprotectOutsSymlink", "TestRunUnprotectOutsSymlink.test"], "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 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 with open(self.FOO, \"r\") as fd:\n self.assertEqual(fd.read(), \"foo\")\n\n ret = main(\n [\n \"run\",\n \"--overwrite-dvcfile\",\n \"--ignore-build-cache\",\n \"-d\",\n self.CODE,\n \"-o\",\n self.FOO,\n \"python\",\n self.CODE,\n self.FOO,\n ]\n )\n self.assertEqual(ret, 0)\n self.assertFalse(os.access(self.FOO, os.W_OK))\n self.assertTrue(System.is_symlink(self.FOO))\n with open(self.FOO, \"r\") as fd:\n self.assertEqual(fd.read(), \"foo\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestRunUnprotectOutsHardlink_TestRunUnprotectOutsHardlink.test.None_2.self_assertEqual_fd_read_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestRunUnprotectOutsHardlink_TestRunUnprotectOutsHardlink.test.None_2.self_assertEqual_fd_read_", "embedding": null, "metadata": {"file_path": "tests/func/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 461, "end_line": 512, "span_ids": ["TestRunUnprotectOutsHardlink", "TestRunUnprotectOutsHardlink.test"], "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 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 with open(self.FOO, \"r\") as fd:\n self.assertEqual(fd.read(), \"foo\")\n\n ret = main(\n [\n \"run\",\n \"--overwrite-dvcfile\",\n \"--ignore-build-cache\",\n \"-d\",\n self.CODE,\n \"-o\",\n self.FOO,\n \"python\",\n self.CODE,\n self.FOO,\n ]\n )\n self.assertEqual(ret, 0)\n self.assertFalse(os.access(self.FOO, os.W_OK))\n self.assertTrue(System.is_hardlink(self.FOO))\n with open(self.FOO, \"r\") as fd:\n self.assertEqual(fd.read(), \"foo\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestCmdRunCliMetrics_TestCmdRunCliMetrics.test_not_cached.with_open_metrics_txt_.self_assertEqual_fd_read_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestCmdRunCliMetrics_TestCmdRunCliMetrics.test_not_cached.with_open_metrics_txt_.self_assertEqual_fd_read_", "embedding": null, "metadata": {"file_path": "tests/func/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 608, "end_line": 619, "span_ids": ["TestCmdRunCliMetrics", "TestCmdRunCliMetrics.test_cached", "TestCmdRunCliMetrics.test_not_cached"], "tokens": 129}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCmdRunCliMetrics(TestDvc):\n def test_cached(self):\n ret = main([\"run\", \"-m\", \"metrics.txt\", \"echo test > metrics.txt\"])\n self.assertEqual(ret, 0)\n with open(\"metrics.txt\", \"r\") as fd:\n self.assertEqual(fd.read().rstrip(), \"test\")\n\n def test_not_cached(self):\n ret = main([\"run\", \"-M\", \"metrics.txt\", \"echo test > metrics.txt\"])\n self.assertEqual(ret, 0)\n with open(\"metrics.txt\", \"r\") as fd:\n self.assertEqual(fd.read().rstrip(), \"test\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestShouldNotCheckoutUponCorruptedLocalHardlinkCache_TestShouldNotCheckoutUponCorruptedLocalHardlinkCache.test.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/func/test_run.py_TestShouldNotCheckoutUponCorruptedLocalHardlinkCache_TestShouldNotCheckoutUponCorruptedLocalHardlinkCache.test.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/func/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 935, "end_line": 962, "span_ids": ["TestShouldNotCheckoutUponCorruptedLocalHardlinkCache", "TestShouldNotCheckoutUponCorruptedLocalHardlinkCache.setUp", "TestShouldNotCheckoutUponCorruptedLocalHardlinkCache.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 TestShouldNotCheckoutUponCorruptedLocalHardlinkCache(TestDvc):\n def setUp(self):\n super(\n TestShouldNotCheckoutUponCorruptedLocalHardlinkCache, self\n ).setUp()\n ret = main([\"config\", \"cache.type\", \"hardlink\"])\n self.assertEqual(ret, 0)\n self.dvc = DvcRepo(\".\")\n\n def test(self):\n cmd = \"python {} {} {}\".format(self.CODE, self.FOO, self.BAR)\n stage = self.dvc.run(deps=[self.FOO], outs=[self.BAR], cmd=cmd)\n\n with open(self.BAR, \"w\") as fd:\n fd.write(\"corrupting the output cache\")\n\n patch_checkout = mock.patch.object(\n stage.outs[0], \"checkout\", wraps=stage.outs[0].checkout\n )\n patch_run = mock.patch.object(stage, \"_run\", wraps=stage._run)\n\n with self.dvc.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/unit/command/test_repro.py_from_dvc_command_repro_im_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_repro.py_from_dvc_command_repro_im_", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 32, "span_ids": ["test_downstream", "imports", "test_default_arguments"], "tokens": 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": "from dvc.command.repro import CmdRepro\nfrom dvc.cli import parse_args\n\ndefault_arguments = {\n \"all_pipelines\": False,\n \"downstream\": False,\n \"dry\": False,\n \"force\": False,\n \"ignore_build_cache\": False,\n \"interactive\": False,\n \"no_commit\": False,\n \"pipeline\": False,\n \"single_item\": False,\n \"recursive\": False,\n}\n\n\ndef test_default_arguments(dvc_repo, mocker):\n cmd = CmdRepro(parse_args([\"repro\"]))\n mocker.patch.object(cmd.repo, \"reproduce\")\n cmd.run()\n cmd.repo.reproduce.assert_called_with(\"Dvcfile\", **default_arguments)\n\n\ndef test_downstream(dvc_repo, mocker):\n cmd = CmdRepro(parse_args([\"repro\", \"--downstream\"]))\n mocker.patch.object(cmd.repo, \"reproduce\")\n cmd.run()\n arguments = default_arguments.copy()\n arguments.update({\"downstream\": True})\n cmd.repo.reproduce.assert_called_with(\"Dvcfile\", **arguments)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_getpass_TestRemoteSSH.test_no_path.self_assertEqual_remote_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_getpass_TestRemoteSSH.test_no_path.self_assertEqual_remote_p", "embedding": null, "metadata": {"file_path": "tests/unit/remote/ssh/test_ssh.py", "file_name": "test_ssh.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 37, "span_ids": ["TestRemoteSSH.test_url", "imports", "TestRemoteSSH", "TestRemoteSSH.test_no_path"], "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": "import getpass\nimport os\nimport sys\n\nfrom unittest import TestCase\n\nfrom mock import patch, mock_open\nimport pytest\n\nfrom dvc.remote.ssh import RemoteSSH\n\n\nclass TestRemoteSSH(TestCase):\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 self.assertEqual(remote.path_info, url)\n\n # SCP-like URL ssh://[user@]host.xz:/absolute/path\n url = \"ssh://{}@{}:{}\".format(user, host, path)\n config = {\"url\": url}\n\n remote = RemoteSSH(None, config)\n self.assertEqual(remote.path_info, url)\n\n def test_no_path(self):\n config = {\"url\": \"ssh://127.0.0.1\"}\n remote = RemoteSSH(None, config)\n self.assertEqual(remote.path_info.path, \"\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_test_ssh_keyfile_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_test_ssh_keyfile_", "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": 138, "end_line": 171, "span_ids": ["test_ssh_keyfile"], "tokens": 235}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"config,expected_keyfile\",\n [\n (\n {\"url\": \"ssh://example.com\", \"keyfile\": \"dvc_config.key\"},\n \"dvc_config.key\",\n ),\n (\n {\"url\": \"ssh://example.com\"},\n os.path.expanduser(\"~/.ssh/not_default.key\"),\n ),\n (\n {\n \"url\": \"ssh://not_in_ssh_config.com\",\n \"keyfile\": \"dvc_config.key\",\n },\n \"dvc_config.key\",\n ),\n ({\"url\": \"ssh://not_in_ssh_config.com\"}, None),\n ],\n)\n@patch(\"os.path.exists\", return_value=True)\n@patch(\n \"{}.open\".format(builtin_module_name),\n new_callable=mock_open,\n read_data=mock_ssh_config,\n)\ndef test_ssh_keyfile(mock_file, mock_exists, config, expected_keyfile):\n remote = RemoteSSH(None, config)\n\n mock_exists.assert_called_with(RemoteSSH.ssh_config_filename())\n mock_file.assert_called_with(RemoteSSH.ssh_config_filename())\n assert remote.keyfile == expected_keyfile", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_local.py_from_dvc_remote_local_imp_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_local.py_from_dvc_remote_local_imp_", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_local.py", "file_name": "test_local.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 30, "span_ids": ["imports", "test_status_download_optimization"], "tokens": 260}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.remote.local import RemoteLOCAL\n\n\ndef test_status_download_optimization(mocker):\n \"\"\"When comparing the status to pull a remote cache,\n And the desired files to fetch are already on the local cache,\n Don't check the existance of the desired files on the remote cache\n \"\"\"\n remote = RemoteLOCAL(None, {})\n\n infos = [\n {\"name\": \"foo\", \"md5\": \"acbd18db4cc2f85cedef654fccc4a4d8\"},\n {\"name\": \"bar\", \"md5\": \"37b51d194a7513e45b56f6524f2d51f2\"},\n ]\n\n local_exists = [\n \"acbd18db4cc2f85cedef654fccc4a4d8\",\n \"37b51d194a7513e45b56f6524f2d51f2\",\n ]\n\n mocker.patch.object(remote, \"cache_exists\", return_value=local_exists)\n\n other_remote = mocker.Mock()\n other_remote.url = \"other_remote\"\n other_remote.cache_exists.return_value = []\n\n remote.status(infos, other_remote, download=True)\n\n assert other_remote.cache_exists.call_count == 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_oss.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_oss.py_from_unittest_import_Test_", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_oss.py", "file_name": "test_oss.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 26, "span_ids": ["imports", "TestRemoteOSS.test_init", "TestRemoteOSS"], "tokens": 213}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from unittest import TestCase\n\nfrom dvc.remote.oss import RemoteOSS\n\n\nclass TestRemoteOSS(TestCase):\n bucket_name = \"bucket-name\"\n endpoint = \"endpoint\"\n key_id = \"Fq2UVErCz4I6tq\"\n key_secret = \"Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsu\"\n\n def test_init(self):\n prefix = \"some/prefix\"\n url = \"oss://{}/{}\".format(self.bucket_name, prefix)\n config = {\n \"url\": url,\n \"oss_key_id\": self.key_id,\n \"oss_key_secret\": self.key_secret,\n \"oss_endpoint\": self.endpoint,\n }\n remote = RemoteOSS(None, config)\n self.assertEqual(remote.path_info, url)\n self.assertEqual(remote.endpoint, self.endpoint)\n self.assertEqual(remote.key_id, self.key_id)\n self.assertEqual(remote.key_secret, self.key_secret)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_slow_link_detection.py_logging_TestSlowLinkGuard.test_should_decorate_on_slow_link_warning_and_no_cache_type.assert_0_self_method_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_slow_link_detection.py_logging_TestSlowLinkGuard.test_should_decorate_on_slow_link_warning_and_no_cache_type.assert_0_self_method_c", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_slow_link_detection.py", "file_name": "test_slow_link_detection.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 44, "span_ids": ["TestSlowLinkGuard.test_should_decorate_on_slow_link_warning_and_no_cache_type", "TestSlowLinkGuard", "imports", "TestSlowLinkGuard._cache_config", "TestSlowLinkGuard.setUp"], "tokens": 283}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\n\nimport colorama\nimport pytest\nfrom dvc.config import Config\nfrom dvc.remote.local.slow_link_detection import (\n slow_link_guard,\n SlowLinkDetectorDecorator,\n)\nfrom mock import Mock, patch\n\n\n@patch(\n \"dvc.remote.local.slow_link_detection.SlowLinkDetectorDecorator\",\n autospec=True,\n)\nclass TestSlowLinkGuard(object):\n @pytest.fixture(autouse=True)\n def setUp(self):\n self.method = Mock()\n self.remote_local_mock = Mock()\n self.config_mock = Mock()\n self.remote_local_mock.repo.config.config.get.return_value = (\n self.config_mock\n )\n\n def _cache_config(self, slow_link_warning, cache_type):\n def config_side_effect(section_name, _):\n if section_name == Config.SECTION_CACHE_SLOW_LINK_WARNING:\n return slow_link_warning\n elif section_name == Config.SECTION_CACHE_TYPE:\n return cache_type\n\n self.config_mock.get.side_effect = config_side_effect\n\n def test_should_decorate_on_slow_link_warning_and_no_cache_type(\n self, SlowLinkDetectorDecoratorClassMock\n ):\n self._cache_config(slow_link_warning=True, cache_type=None)\n\n slow_link_guard(self.method)(self.remote_local_mock)\n\n assert 1 == SlowLinkDetectorDecoratorClassMock.call_count\n assert 0 == self.method.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/remote/test_slow_link_detection.py_TestSlowLinkGuard.test_should_not_decorate_TestSlowLinkGuard.test_should_not_decorate.assert_1_self_method_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_slow_link_detection.py_TestSlowLinkGuard.test_should_not_decorate_TestSlowLinkGuard.test_should_not_decorate.assert_1_self_method_c", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_slow_link_detection.py", "file_name": "test_slow_link_detection.py", "file_type": "text/x-python", "category": "test", "start_line": 46, "end_line": 60, "span_ids": ["TestSlowLinkGuard.test_should_not_decorate"], "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": "@patch(\n \"dvc.remote.local.slow_link_detection.SlowLinkDetectorDecorator\",\n autospec=True,\n)\nclass TestSlowLinkGuard(object):\n\n @pytest.mark.parametrize(\n \"slow_link_warning, cache_type\",\n [(True, \"any_cache_type\"), (False, None)],\n )\n def test_should_not_decorate(\n self, SlowLinkDetectorDecoratorClassMock, slow_link_warning, cache_type\n ):\n self._cache_config(\n slow_link_warning=slow_link_warning, cache_type=cache_type\n )\n\n slow_link_guard(self.method)(self.remote_local_mock)\n\n assert 0 == SlowLinkDetectorDecoratorClassMock.call_count\n assert 1 == self.method.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/remote/test_slow_link_detection.py_TestSlowLinkDetectorDecorator_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/test_slow_link_detection.py_TestSlowLinkDetectorDecorator_", "embedding": null, "metadata": {"file_path": "tests/unit/remote/test_slow_link_detection.py", "file_name": "test_slow_link_detection.py", "file_type": "text/x-python", "category": "test", "start_line": 63, "end_line": 115, "span_ids": ["TestSlowLinkDetectorDecorator", "TestSlowLinkDetectorDecorator.setUp", "TestSlowLinkDetectorDecorator.test_should_not_log", "TestSlowLinkDetectorDecorator.test_should_log_only_once"], "tokens": 437}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestSlowLinkDetectorDecorator(object):\n @pytest.fixture(autouse=True)\n def setUp(self):\n self.args_mock = Mock()\n self.method_result_mock = Mock()\n\n def method_effect(arg):\n assert self.args_mock == arg\n return self.method_result_mock\n\n self.method_mock = Mock(side_effect=method_effect)\n\n @patch.object(SlowLinkDetectorDecorator, \"LINKING_TIMEOUT_SECONDS\", 0.0)\n def test_should_log_only_once(self, caplog):\n\n with caplog.at_level(logging.WARNING, logger=\"dvc\"):\n test_instance = SlowLinkDetectorDecorator(self.method_mock)\n result = test_instance(self.args_mock)\n assert self.method_result_mock == result\n\n # slow link guard keeps creating new SlowLinkDetectorDecorators\n # each time it is called, so we need to make sure that we are\n # preventing every new instance of this class from displaying the\n # message\n test_instance2 = SlowLinkDetectorDecorator(self.method_mock)\n result = test_instance2(self.args_mock)\n assert self.method_result_mock == result\n\n msg = (\n \"You can cut execution time considerably by using a different\"\n \" `cache.type` configuration.\\nSee \"\n \"{blue}https://dvc.org/doc/commands-reference/config#cache{\"\n \"reset} for more information.\\n\"\n \"To disable this message, run:\\n\"\n \"'dvc config cache.slow_link_warning false'\".format(\n blue=colorama.Fore.BLUE, reset=colorama.Fore.RESET\n )\n )\n assert 1 == len(caplog.messages)\n assert msg == caplog.messages[0]\n\n @patch.object(\n SlowLinkDetectorDecorator, \"LINKING_TIMEOUT_SECONDS\", 99999.0\n )\n def test_should_not_log(self, caplog):\n test_instance = SlowLinkDetectorDecorator(self.method_mock)\n\n with caplog.at_level(logging.WARNING, logger=\"dvc\"):\n result = test_instance(self.args_mock)\n\n assert self.method_result_mock == result\n assert 0 == len(caplog.messages)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_TestColorFormatter.test_nested_exceptions_TestColorFormatter.test_nested_exceptions.with_caplog_at_level_logg.assert_expected_format": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_TestColorFormatter.test_nested_exceptions_TestColorFormatter.test_nested_exceptions.with_caplog_at_level_logg.assert_expected_format", "embedding": null, "metadata": {"file_path": "tests/unit/test_logger.py", "file_name": "test_logger.py", "file_type": "text/x-python", "category": "test", "start_line": 125, "end_line": 151, "span_ids": ["TestColorFormatter.test_nested_exceptions"], "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 TestColorFormatter:\n\n def test_nested_exceptions(self, caplog):\n with caplog.at_level(logging.DEBUG, logger=\"dvc\"):\n try:\n raise Exception(\"first\")\n except Exception as exc:\n first_traceback = traceback.format_exc()\n try:\n raise DvcException(\"second\", cause=exc)\n except DvcException:\n second_traceback = traceback.format_exc()\n logger.exception(\"message\")\n\n expected = (\n \"{red}ERROR{nc}: message - second: first\\n\"\n \"{red}{line}{nc}\\n\"\n \"{stack_trace}\"\n \"{red}{line}{nc}\\n\"\n \"\\n\"\n \"{footer}\".format(\n footer=formatter.footer,\n line=\"-\" * 60,\n stack_trace=\"\\n\".join([first_traceback, second_traceback]),\n **colors\n )\n )\n\n assert expected == formatter.format(caplog.records[0])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_TestColorFormatter.test_progress_awareness_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_logger.py_TestColorFormatter.test_progress_awareness_", "embedding": null, "metadata": {"file_path": "tests/unit/test_logger.py", "file_name": "test_logger.py", "file_type": "text/x-python", "category": "test", "start_line": 153, "end_line": 182, "span_ids": ["TestColorFormatter.test_progress_awareness"], "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 TestColorFormatter:\n\n def test_progress_awareness(self, mocker, capsys, caplog):\n from dvc.progress import progress\n\n with mocker.patch(\"sys.stdout.isatty\", return_value=True):\n progress.set_n_total(100)\n progress.update_target(\"progress\", 1, 10)\n\n # logging an invisible message should not break\n # the progress bar output\n with caplog.at_level(logging.INFO, logger=\"dvc\"):\n debug_record = logging.LogRecord(\n name=\"dvc\",\n level=logging.DEBUG,\n pathname=__name__,\n lineno=1,\n msg=\"debug\",\n args=(),\n exc_info=None,\n )\n\n formatter.format(debug_record)\n captured = capsys.readouterr()\n assert \"\\n\" not in captured.out\n\n # just when the message is actually visible\n with caplog.at_level(logging.INFO, logger=\"dvc\"):\n logger.info(\"some info\")\n captured = capsys.readouterr()\n assert \"\\n\" in captured.out", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cache.py__Manages_cache_of_a_dvc_CacheConfig.set_dir.self_config_set_": {"__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_CacheConfig.set_dir.self_config_set_", "embedding": null, "metadata": {"file_path": "dvc/cache.py", "file_name": "cache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 21, "span_ids": ["CacheConfig.set_dir", "CacheConfig.__init__", "CacheConfig", "docstring"], "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": "\"\"\"Manages cache of a dvc repo.\"\"\"\n\nfrom __future__ import unicode_literals\n\nimport os\n\nfrom dvc.config import Config\n\n\nclass CacheConfig(object):\n def __init__(self, config):\n self.config = config\n\n def set_dir(self, dname, level=None):\n from dvc.remote.config import RemoteConfig\n\n configobj = self.config.get_configobj(level)\n path = RemoteConfig.resolve_path(dname, configobj.filename)\n self.config.set(\n Config.SECTION_CACHE, Config.SECTION_CACHE_DIR, path, level=level\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cache.py_Cache_Cache.__init__.self.azure.self__get_remote_config_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/cache.py_Cache_Cache.__init__.self.azure.self__get_remote_config_", "embedding": null, "metadata": {"file_path": "dvc/cache.py", "file_name": "cache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 24, "end_line": 64, "span_ids": ["Cache.__init__", "Cache"], "tokens": 335}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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 settings = 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 settings = {\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, **settings)\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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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.return.0": {"__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.return.0", "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": 31, "span_ids": ["imports", "CmdConfig", "CmdConfig.__init__", "CmdConfig.run"], "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": "from __future__ import unicode_literals\n\nimport argparse\nimport logging\n\nfrom dvc.command.base import CmdBaseNoRepo, append_doc_link\nfrom dvc.config import Config\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdConfig(CmdBaseNoRepo):\n def __init__(self, args):\n super(CmdConfig, self).__init__(args)\n\n self.config = Config(validate=False)\n\n def run(self):\n section, opt = self.args.name.lower().strip().split(\".\", 1)\n\n if self.args.unset:\n self.config.unset(section, opt, level=self.args.level)\n elif self.args.value is None:\n logger.info(self.config.get(section, opt, level=self.args.level))\n else:\n self.config.set(\n section, opt, self.args.value, level=self.args.level\n )\n\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/config.py_parent_config_parser_parent_config_parser_set_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/config.py_parent_config_parser_parent_config_parser_set_", "embedding": null, "metadata": {"file_path": "dvc/command/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 34, "end_line": 56, "span_ids": ["impl:3"], "tokens": 133}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "parent_config_parser = argparse.ArgumentParser(add_help=False)\nparent_config_parser.add_argument(\n \"--global\",\n dest=\"level\",\n action=\"store_const\",\n const=Config.LEVEL_GLOBAL,\n help=\"Use global config.\",\n)\nparent_config_parser.add_argument(\n \"--system\",\n dest=\"level\",\n action=\"store_const\",\n const=Config.LEVEL_SYSTEM,\n help=\"Use system config.\",\n)\nparent_config_parser.add_argument(\n \"--local\",\n dest=\"level\",\n action=\"store_const\",\n const=Config.LEVEL_LOCAL,\n help=\"Use local config.\",\n)\nparent_config_parser.set_defaults(level=Config.LEVEL_REPO)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/config.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/config.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 59, "end_line": 79, "span_ids": ["add_parser"], "tokens": 146}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n CONFIG_HELP = \"Get or set config options.\"\n\n config_parser = subparsers.add_parser(\n \"config\",\n parents=[parent_config_parser, parent_parser],\n description=append_doc_link(CONFIG_HELP, \"config\"),\n help=CONFIG_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n config_parser.add_argument(\n \"-u\",\n \"--unset\",\n default=False,\n action=\"store_true\",\n help=\"Unset option.\",\n )\n config_parser.add_argument(\"name\", help=\"Option name.\")\n config_parser.add_argument(\"value\", nargs=\"?\", help=\"Option value.\")\n config_parser.set_defaults(func=CmdConfig)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/remote.py_from___future___import_un_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_from___future___import_un_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": 1, "end_line": 62, "span_ids": ["CmdRemoteList", "CmdRemoteAdd", "CmdRemoteDefault.run", "CmdRemoteList.run", "imports", "CmdRemoteRemove", "CmdRemoteConfig.__init__", "CmdRemoteModify", "CmdRemoteDefault", "CmdRemoteAdd.run", "CmdRemoteConfig", "CmdRemoteModify.run", "CmdRemoteRemove.run"], "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": "from __future__ import unicode_literals\n\nimport argparse\nimport logging\n\nfrom dvc.command.base import append_doc_link, fix_subparsers\nfrom dvc.command.config import CmdConfig\nfrom dvc.remote.config import RemoteConfig\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdRemoteConfig(CmdConfig):\n def __init__(self, args):\n super(CmdRemoteConfig, self).__init__(args)\n self.remote_config = RemoteConfig(self.config)\n\n\nclass CmdRemoteAdd(CmdRemoteConfig):\n def run(self):\n self.remote_config.add(\n self.args.name,\n self.args.url,\n force=self.args.force,\n default=self.args.default,\n level=self.args.level,\n )\n return 0\n\n\nclass CmdRemoteRemove(CmdRemoteConfig):\n def run(self):\n self.remote_config.remove(self.args.name, level=self.args.level)\n return 0\n\n\nclass CmdRemoteModify(CmdRemoteConfig):\n def run(self):\n self.remote_config.modify(\n self.args.name,\n self.args.option,\n self.args.value,\n level=self.args.level,\n )\n return 0\n\n\nclass CmdRemoteDefault(CmdRemoteConfig):\n def run(self):\n self.remote_config.set_default(\n self.args.name, unset=self.args.unset, level=self.args.level\n )\n return 0\n\n\nclass CmdRemoteList(CmdRemoteConfig):\n def run(self):\n for name, url in self.remote_config.list(\n level=self.args.level\n ).items():\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/version.py_from___future___import_un_CmdVersion.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/version.py_from___future___import_un_CmdVersion.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/version.py", "file_name": "version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 60, "span_ids": ["imports", "CmdVersion.run", "CmdVersion"], "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": "from __future__ import unicode_literals\n\nimport os\nimport psutil\nimport platform\nimport argparse\nimport logging\nimport uuid\n\nfrom dvc.utils import is_binary\nfrom dvc.utils.compat import pathlib\nfrom dvc.repo import Repo\nfrom dvc.command.base import CmdBaseNoRepo, append_doc_link\nfrom dvc.version import __version__\nfrom dvc.exceptions import DvcException, NotDvcRepoError\nfrom dvc.system import System\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdVersion(CmdBaseNoRepo):\n def run(self):\n dvc_version = __version__\n python_version = platform.python_version()\n platform_type = platform.platform()\n binary = is_binary()\n\n info = (\n \"DVC version: {dvc_version}\\n\"\n \"Python version: {python_version}\\n\"\n \"Platform: {platform_type}\\n\"\n \"Binary: {binary}\\n\"\n ).format(\n dvc_version=dvc_version,\n python_version=python_version,\n platform_type=platform_type,\n binary=binary,\n )\n\n try:\n repo = Repo()\n root_directory = repo.root_dir\n\n info += (\n \"Cache: {cache}\\n\"\n \"Filesystem type (cache directory): {fs_cache}\\n\"\n ).format(\n cache=self.get_linktype_support_info(repo),\n fs_cache=self.get_fs_type(repo.cache.local.cache_dir),\n )\n\n except NotDvcRepoError:\n root_directory = os.getcwd()\n\n info += (\"Filesystem type (workspace): {fs_root}\").format(\n fs_root=self.get_fs_type(os.path.abspath(root_directory))\n )\n logger.info(info)\n return 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/version.py_CmdVersion.get_fs_type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/version.py_CmdVersion.get_fs_type_", "embedding": null, "metadata": {"file_path": "dvc/command/version.py", "file_name": "version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 58, "end_line": 112, "span_ids": ["CmdVersion.get_linktype_support_info", "CmdVersion.get_fs_type", "add_parser"], "tokens": 342}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CmdVersion(CmdBaseNoRepo):\n\n @staticmethod\n def get_fs_type(path):\n partition = {\n pathlib.Path(part.mountpoint): (part.fstype, part.device)\n for part in psutil.disk_partitions()\n }\n for parent in pathlib.Path(path).parents:\n if parent in partition:\n return partition[parent]\n return (\"unkown\", \"none\")\n\n @staticmethod\n def get_linktype_support_info(repo):\n links = {\n \"reflink\": System.reflink,\n \"hardlink\": System.hardlink,\n \"symlink\": System.symlink,\n }\n\n fname = \".\" + str(uuid.uuid4())\n src = os.path.join(repo.cache.local.cache_dir, fname)\n open(src, \"w\").close()\n dst = os.path.join(repo.root_dir, fname)\n\n cache = []\n\n for name, link in links.items():\n try:\n link(src, dst)\n os.unlink(dst)\n supported = True\n except DvcException:\n supported = False\n cache.append(\n \"{name} - {supported}\".format(\n name=name, supported=True if supported else False\n )\n )\n os.remove(src)\n\n return \", \".join(cache)\n\n\ndef add_parser(subparsers, parent_parser):\n VERSION_HELP = \"Show DVC version and system/environment informaion.\"\n\n version_parser = subparsers.add_parser(\n \"version\",\n parents=[parent_parser],\n description=append_doc_link(VERSION_HELP, \"version\"),\n help=VERSION_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n version_parser.set_defaults(func=CmdVersion)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py__DVC_config_objects__Choices.__call__.return.value_in_self_choices": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py__DVC_config_objects__Choices.__call__.return.value_in_self_choices", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 110, "span_ids": ["supported_cache_type", "Choices", "ConfigError.__init__", "is_percent", "Choices.__call__", "is_bool", "is_whole", "to_bool", "Choices.__init__", "docstring", "ConfigError"], "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": "\"\"\"DVC config objects.\"\"\"\n\nfrom __future__ import unicode_literals\n\nfrom dvc.utils.compat import str, open\n\nimport os\nimport re\nimport copy\nimport errno\nimport configobj\nimport logging\n\nfrom schema import Schema, Optional, And, Use, Regex, SchemaError\nfrom dvc.exceptions import DvcException, NotDvcRepoError\n\nlogger = logging.getLogger(__name__)\n\n\nclass ConfigError(DvcException):\n \"\"\"DVC config exception.\n\n Args:\n msg (str): error message.\n cause (Exception): optional exception that has caused this error.\n \"\"\"\n\n def __init__(self, msg, cause=None):\n super(ConfigError, self).__init__(\n \"config file error: {}\".format(msg), cause=cause\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 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\n\n\nclass Choices(object):\n \"\"\"Checks that value belongs to the specified set of values\n\n Args:\n *choices: pass allowed values as arguments, or pass a list or\n tuple as a single argument\n \"\"\"\n\n def __init__(self, *choices):\n if len(choices) == 1 and isinstance(choices[0], (list, tuple)):\n choices = choices[0]\n self.choices = choices\n\n def __call__(self, value):\n return value in self.choices", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config._load_configs_Config._load_configs.self._local_config_9.configobj_ConfigObj_confi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config._load_configs_Config._load_configs.self._local_config_9.configobj_ConfigObj_confi", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 386, "end_line": 407, "span_ids": ["Config._load_configs"], "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 Config(object):\n\n def _load_configs(self):\n system_config_file = os.path.join(\n self.get_system_config_dir(), self.CONFIG\n )\n\n global_config_file = os.path.join(\n self.get_global_config_dir(), self.CONFIG\n )\n\n self._system_config = configobj.ConfigObj(system_config_file)\n self._global_config = configobj.ConfigObj(global_config_file)\n self._repo_config = configobj.ConfigObj()\n self._local_config = configobj.ConfigObj()\n\n if not self.dvc_dir:\n return\n\n config_file = os.path.join(self.dvc_dir, self.CONFIG)\n config_local_file = os.path.join(self.dvc_dir, self.CONFIG_LOCAL)\n\n self._repo_config = configobj.ConfigObj(config_file)\n self._local_config = configobj.ConfigObj(config_local_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/config.py_Config.config_local_file_Config.load.self.config_2.configobj_ConfigObj_d_wr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config.config_local_file_Config.load.self.config_2.configobj_ConfigObj_d_wr", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 409, "end_line": 444, "span_ids": ["Config.load", "Config.config_file", "Config.config_local_file"], "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 Config(object):\n\n @property\n def config_local_file(self):\n return self._local_config.filename\n\n @property\n def config_file(self):\n return self._repo_config.filename\n\n def load(self):\n \"\"\"Loads config from all the config files.\n\n Raises:\n dvc.config.ConfigError: thrown if config has invalid format.\n \"\"\"\n self._load_configs()\n\n self.config = configobj.ConfigObj()\n for c in [\n self._system_config,\n self._global_config,\n self._repo_config,\n self._local_config,\n ]:\n c = self._resolve_paths(c)\n c = self._lower(c)\n self.config.merge(c)\n\n if not self.validate:\n return\n\n d = self.config.dict()\n try:\n d = Schema(self.SCHEMA).validate(d)\n except SchemaError as exc:\n raise ConfigError(\"config format error\", cause=exc)\n self.config = configobj.ConfigObj(d, write_empty_values=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/config.py_Config.save_Config._save.config_write_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config.save_Config._save.config_write_", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 446, "end_line": 479, "span_ids": ["Config.save", "Config._save"], "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 Config(object):\n\n def save(self, config=None):\n \"\"\"Saves config to config files.\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 self._save(conf)\n\n self.load()\n\n @staticmethod\n def _save(config):\n if config.filename is None:\n return\n\n logger.debug(\"Writing '{}'.\".format(config.filename))\n dname = os.path.dirname(os.path.abspath(config.filename))\n try:\n os.makedirs(dname)\n except OSError as exc:\n if exc.errno != errno.EEXIST:\n raise\n config.write()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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.self_save_config_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config.unset_Config.unset.self_save_config_", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 481, "end_line": 516, "span_ids": ["Config.unset"], "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 Config(object):\n\n def unset(self, section, opt=None, level=None, force=False):\n \"\"\"Unsets specified option and/or section in the config.\n\n Args:\n section (str): section name.\n opt (str): optional option name.\n level (int): config level to use.\n force (bool): don't error-out even if section doesn't exist. False\n by default.\n\n Raises:\n dvc.config.ConfigError: thrown if section doesn't exist and\n `force != True`.\n \"\"\"\n config = self.get_configobj(level)\n\n if section not in config.keys():\n if force:\n return\n raise ConfigError(\"section '{}' doesn't exist\".format(section))\n\n if opt:\n if opt not in config[section].keys():\n if force:\n return\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]\n else:\n del config[section]\n\n self.save(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/config.py_Config.set_Config.set.self_save_config_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config.set_Config.set.self_save_config_", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 518, "end_line": 545, "span_ids": ["Config.set"], "tokens": 187}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Config(object):\n\n def set(self, section, opt, value, level=None, force=True):\n \"\"\"Sets specified option in the config.\n\n Args:\n section (str): section name.\n opt (str): option name.\n value: value to set option to.\n level (int): config level to use.\n force (bool): set option even if section already exists. True by\n default.\n\n Raises:\n dvc.config.ConfigError: thrown if section already exists and\n `force != True`.\n\n \"\"\"\n config = self.get_configobj(level)\n\n if section not in config.keys():\n config[section] = {}\n elif not force:\n raise ConfigError(\n \"Section '{}' already exists. Use `-f|--force` to overwrite \"\n \"section with new value.\".format(section)\n )\n\n config[section][opt] = value\n self.save(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/config.py_Config.get_Config.get.return.config_section_opt_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config.get_Config.get.return.config_section_opt_", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 547, "end_line": 568, "span_ids": ["Config.get"], "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 Config(object):\n\n def get(self, section, opt=None, level=None):\n \"\"\"Return option value from the config.\n\n Args:\n section (str): section name.\n opt (str): option name.\n level (int): config level to use.\n\n Returns:\n value (str, int): option value.\n \"\"\"\n config = self.get_configobj(level)\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 return 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._lower_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config._lower_", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 570, "end_line": 600, "span_ids": ["Config.list_options", "Config._lower", "Config.get_configobj"], "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 Config(object):\n\n @staticmethod\n def _lower(config):\n new_config = configobj.ConfigObj()\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\n\n def get_configobj(self, level):\n configs = {\n self.LEVEL_LOCAL: self._local_config,\n self.LEVEL_REPO: self._repo_config,\n self.LEVEL_GLOBAL: self._global_config,\n self.LEVEL_SYSTEM: self._system_config,\n }\n\n return configs.get(level, self._repo_config)\n\n def list_options(self, section_regex, option, level=None):\n ret = {}\n config = self.get_configobj(level)\n for section in config.keys():\n r = re.match(section_regex, section)\n if r:\n name = r.group(\"name\")\n value = config[section].get(option, \"\")\n ret[name] = value\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/data_cloud.py_DataCloud_DataCloud._core.return.self__config_get_Config_S": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud_DataCloud._core.return.self__config_get_Config_S", "embedding": null, "metadata": {"file_path": "dvc/data_cloud.py", "file_name": "data_cloud.py", "file_type": "text/x-python", "category": "implementation", "start_line": 22, "end_line": 54, "span_ids": ["DataCloud._core", "DataCloud.__init__", "DataCloud", "DataCloud._config"], "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 DataCloud(object):\n \"\"\"Class that manages dvc remotes.\n\n Args:\n repo (dvc.repo.Repo): repo instance that belongs to the repo that\n we are working on.\n\n Raises:\n config.ConfigError: thrown when config has invalid format.\n \"\"\"\n\n CLOUD_MAP = {\n \"aws\": RemoteS3,\n \"gcp\": RemoteGS,\n \"azure\": RemoteAZURE,\n \"oss\": RemoteOSS,\n \"ssh\": RemoteSSH,\n \"hdfs\": RemoteHDFS,\n \"local\": RemoteLOCAL,\n \"http\": RemoteHTTP,\n \"https\": RemoteHTTP,\n }\n\n def __init__(self, repo):\n self.repo = repo\n\n @property\n def _config(self):\n return self.repo.config.config\n\n @property\n def _core(self):\n return self._config.get(Config.SECTION_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/dvc/data_cloud.py_DataCloud.get_remote_DataCloud._init_remote.return.Remote_self_repo_name_re": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/data_cloud.py_DataCloud.get_remote_DataCloud._init_remote.return.Remote_self_repo_name_re", "embedding": null, "metadata": {"file_path": "dvc/data_cloud.py", "file_name": "data_cloud.py", "file_type": "text/x-python", "category": "implementation", "start_line": 56, "end_line": 77, "span_ids": ["DataCloud.get_remote", "DataCloud._init_remote"], "tokens": 173}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DataCloud(object):\n\n def get_remote(self, remote=None, command=\"\"):\n if not remote:\n remote = self._core.get(Config.SECTION_CORE_REMOTE)\n\n if remote:\n return self._init_remote(remote)\n\n # Old config format support for backward compatibility\n if Config.SECTION_CORE_CLOUD in self._core:\n msg = \"using obsoleted config format. Consider updating.\"\n logger.warning(msg)\n return self._init_compat()\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(command)\n )\n\n def _init_remote(self, remote):\n return Remote(self.repo, name=remote)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/http.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/http.py__", "embedding": null, "metadata": {"file_path": "dvc/dependency/http.py", "file_name": "http.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 10, "span_ids": ["DependencyHTTP", "imports"], "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": "from __future__ import unicode_literals\n\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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase_OutputBase.changed_cache.return.self_cache_changed_cache_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase_OutputBase.changed_cache.return.self_cache_changed_cache_", "embedding": null, "metadata": {"file_path": "dvc/output/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 35, "end_line": 171, "span_ids": ["OutputBase.changed_checksum", "OutputBase.__init__", "OutputBase.changed_cache", "OutputBase.is_in_repo", "OutputBase.exists", "OutputBase._parse_path", "OutputBase.supported", "OutputBase.__repr__", "OutputBase.cache_path", "OutputBase.scheme", "OutputBase.dir_cache", "OutputBase.checksum", "OutputBase.cache", "OutputBase.__str__", "OutputBase.is_dir_checksum", "OutputBase", "OutputBase.assign_to_stage_file"], "tokens": 816}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 sep = \"/\"\n\n def __init__(\n self,\n stage,\n path,\n info=None,\n remote=None,\n cache=True,\n metric=False,\n persist=False,\n tags=None,\n ):\n # This output (and dependency) objects have too many paths/urls\n # here is a list and comments:\n #\n # .def_path - path from definition in stage file\n # .path_info - PathInfo/URLInfo structured resolved path\n # .fspath - local only, resolved\n # .__str__ - for presentation purposes, def_path/relpath\n #\n # By resolved path, which contains actual location,\n # should be absolute and don't contain remote:// refs.\n self.stage = stage\n self.repo = stage.repo if stage else None\n self.def_path = path\n self.info = info\n self.remote = remote or self.REMOTE(self.repo, {})\n self.use_cache = False if self.IS_DEPENDENCY else cache\n self.metric = False if self.IS_DEPENDENCY else metric\n self.persist = persist\n self.tags = None if self.IS_DEPENDENCY else (tags or {})\n\n if self.use_cache and self.cache is None:\n raise DvcException(\n \"no cache location setup for '{}' outputs.\".format(\n self.REMOTE.scheme\n )\n )\n\n self.path_info = self._parse_path(remote, path)\n\n def _parse_path(self, remote, path):\n if remote:\n parsed = urlparse(path)\n return remote.path_info / parsed.path.lstrip(\"/\")\n else:\n return self.REMOTE.path_cls(path)\n\n def __repr__(self):\n return \"{class_name}: '{def_path}'\".format(\n class_name=type(self).__name__, def_path=self.def_path\n )\n\n def __str__(self):\n return self.def_path\n\n @property\n def scheme(self):\n return self.REMOTE.scheme\n\n @property\n def is_in_repo(self):\n return False\n\n @property\n def cache(self):\n return getattr(self.repo.cache, self.scheme)\n\n @property\n def dir_cache(self):\n return self.cache.get_dir_cache(self.checksum)\n\n 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 supported(cls, url):\n return cls.REMOTE.supported(url)\n\n @property\n def cache_path(self):\n return self.cache.checksum_to_path_info(self.checksum).url\n\n @property\n def checksum(self):\n return self.info.get(self.remote.PARAM_CHECKSUM)\n\n @property\n def is_dir_checksum(self):\n return self.remote.is_dir_checksum(self.checksum)\n\n @property\n def exists(self):\n return self.remote.exists(self.path_info)\n\n def 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 return self.cache.changed_cache(self.checksum)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.status_OutputBase.isfile.return.self_remote_isfile_self_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.status_OutputBase.isfile.return.self_remote_isfile_self_p", "embedding": null, "metadata": {"file_path": "dvc/output/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 172, "end_line": 200, "span_ids": ["OutputBase.isdir", "OutputBase.is_empty", "OutputBase.status", "OutputBase.isfile", "OutputBase.changed"], "tokens": 156}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class OutputBase(object):\n\n def status(self):\n if self.checksum and self.use_cache and self.changed_cache():\n return {str(self): \"not in cache\"}\n\n if not self.exists:\n return {str(self): \"deleted\"}\n\n if self.changed_checksum():\n return {str(self): \"modified\"}\n\n if not self.checksum:\n return {str(self): \"new\"}\n\n return {}\n\n def changed(self):\n status = self.status()\n logger.debug(str(status))\n return bool(status)\n\n @property\n def is_empty(self):\n return self.remote.is_empty(self.path_info)\n\n def isdir(self):\n return self.remote.isdir(self.path_info)\n\n def isfile(self):\n return self.remote.isfile(self.path_info)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.save_OutputBase.save.self.info.self_remote_save_info_sel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.save_OutputBase.save.self.info.self_remote_save_info_sel", "embedding": null, "metadata": {"file_path": "dvc/output/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 202, "end_line": 239, "span_ids": ["OutputBase.save"], "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 OutputBase(object):\n\n def save(self):\n if not self.exists:\n raise self.DoesNotExistError(self)\n\n if not self.isfile and not self.isdir:\n raise self.IsNotFileOrDirError(self)\n\n if self.is_empty:\n logger.warning(\"'{}' is empty.\".format(self))\n\n if not self.use_cache:\n self.info = self.remote.save_info(self.path_info)\n if self.metric:\n self.verify_metric()\n if not self.IS_DEPENDENCY:\n logger.info(\n \"Output '{}' doesn't use cache. Skipping saving.\".format(\n self\n )\n )\n return\n\n assert not self.IS_DEPENDENCY\n\n if not self.changed():\n logger.info(\n \"Output '{}' didn't change. Skipping saving.\".format(self)\n )\n return\n\n if self.is_in_repo:\n if self.repo.scm.is_tracked(self.fspath):\n raise OutputAlreadyTrackedError(self)\n\n if self.use_cache:\n self.repo.scm.ignore(self.fspath)\n\n self.info = self.remote.save_info(self.path_info)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/hdfs.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/hdfs.py__", "embedding": null, "metadata": {"file_path": "dvc/output/hdfs.py", "file_name": "hdfs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 9, "span_ids": ["imports", "OutputHDFS"], "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 __future__ import unicode_literals\n\nfrom dvc.output.base import OutputBase\nfrom dvc.remote.hdfs import RemoteHDFS\n\n\nclass OutputHDFS(OutputBase):\n REMOTE = RemoteHDFS", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/local.py_from___future___import_un_OutputLOCAL._parse_path.return.self_REMOTE_path_cls_abs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/local.py_from___future___import_un_OutputLOCAL._parse_path.return.self_REMOTE_path_cls_abs_", "embedding": null, "metadata": {"file_path": "dvc/output/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 36, "span_ids": ["imports", "OutputLOCAL._parse_path", "OutputLOCAL"], "tokens": 272}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import unicode_literals\n\nimport os\nimport logging\n\nfrom dvc.utils.compat import urlparse, fspath_py35, str\nfrom dvc.istextfile import istextfile\nfrom dvc.exceptions import DvcException\nfrom dvc.remote.local import RemoteLOCAL\nfrom dvc.output.base import OutputBase\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass OutputLOCAL(OutputBase):\n REMOTE = RemoteLOCAL\n sep = os.sep\n\n def _parse_path(self, remote, path):\n parsed = urlparse(path)\n if parsed.scheme == \"remote\":\n p = remote.path_info / parsed.path.lstrip(\"/\")\n else:\n # NOTE: we can path either from command line or .dvc file,\n # so we should expect both posix and windows style paths.\n # PathInfo accepts both, i.e. / works everywhere, \\ only on win.\n #\n # FIXME: if we have Windows path containig / or posix one with \\\n # then we have #2059 bug and can't really handle that.\n p = self.REMOTE.path_cls(path)\n if not p.is_absolute():\n p = self.stage.wdir / p\n\n abs_p = os.path.abspath(os.path.normpath(fspath_py35(p)))\n return self.REMOTE.path_cls(abs_p)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/local.py_OutputLOCAL.__str___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/local.py_OutputLOCAL.__str___", "embedding": null, "metadata": {"file_path": "dvc/output/local.py", "file_name": "local.py", "file_type": "text/x-python", "category": "implementation", "start_line": 38, "end_line": 90, "span_ids": ["OutputLOCAL.is_in_repo", "OutputLOCAL.assign_to_stage_file", "OutputLOCAL.dumpd", "OutputLOCAL.fspath", "OutputLOCAL.verify_metric", "OutputLOCAL.__str__"], "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 OutputLOCAL(OutputBase):\n\n def __str__(self):\n return str(self.path_info)\n\n @property\n def fspath(self):\n return self.path_info.fspath\n\n @property\n def is_in_repo(self):\n def_scheme = urlparse(self.def_path).scheme\n return def_scheme != \"remote\" and not os.path.isabs(self.def_path)\n\n def assign_to_stage_file(self, stage):\n from dvc.repo import Repo\n\n # Make path info the same but relative to passed stage\n rel_path = self.path_info.relpath(self.stage.wdir)\n self.path_info = (\n self.REMOTE.path_cls(os.path.abspath(stage.wdir)) / rel_path\n )\n\n self.repo = Repo(self.fspath)\n\n self.stage = stage\n return self\n\n def dumpd(self):\n ret = super(OutputLOCAL, self).dumpd()\n if self.is_in_repo:\n path = self.path_info.relpath(self.stage.wdir).as_posix()\n else:\n path = self.def_path\n\n ret[self.PARAM_PATH] = path\n\n return ret\n\n def verify_metric(self):\n if not self.metric:\n return\n\n path = fspath_py35(self.path_info)\n if not os.path.exists(path):\n return\n\n if os.path.isdir(path):\n msg = \"directory '{}' cannot be used as metrics.\"\n raise DvcException(msg.format(self.path_info))\n\n if not istextfile(path):\n msg = \"binary file '{}' cannot be used as metrics.\"\n raise DvcException(msg.format(self.path_info))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/s3.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/s3.py__", "embedding": null, "metadata": {"file_path": "dvc/output/s3.py", "file_name": "s3.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 9, "span_ids": ["imports", "OutputS3"], "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 __future__ import unicode_literals\n\nfrom dvc.remote.s3 import RemoteS3\nfrom dvc.output.base import OutputBase\n\n\nclass OutputS3(OutputBase):\n REMOTE = RemoteS3", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/ssh.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/ssh.py__", "embedding": null, "metadata": {"file_path": "dvc/output/ssh.py", "file_name": "ssh.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 9, "span_ids": ["imports", "OutputSSH"], "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.base import OutputBase\nfrom dvc.remote.ssh import RemoteSSH\n\n\nclass OutputSSH(OutputBase):\n REMOTE = RemoteSSH", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_from___future___import_un_if_is_py2_.fs_encoding._utf_8_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_from___future___import_un_if_is_py2_.fs_encoding._utf_8_", "embedding": null, "metadata": {"file_path": "dvc/path_info.py", "file_name": "path_info.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 19, "span_ids": ["imports"], "tokens": 130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import unicode_literals, absolute_import\n\nimport sys\nimport os\nimport posixpath\n\nfrom funcy import cached_property\n\nfrom dvc.utils.compat import str, builtin_str, basestring, is_py2\nfrom dvc.utils.compat import pathlib, urlparse\n\n\n# On Python 2.7/Windows sys.getfilesystemencoding() is set to mbcs,\n# which is lossy, thus we can't use that,\n# see https://github.com/mcmtroffaes/pathlib2/issues/56.\nfrom dvc.utils import relpath\n\nif is_py2:\n fs_encoding = \"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/path_info.py_URLInfo_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_URLInfo_", "embedding": null, "metadata": {"file_path": "dvc/path_info.py", "file_name": "path_info.py", "file_type": "text/x-python", "category": "implementation", "start_line": 131, "end_line": 266, "span_ids": ["URLInfo.name", "URLInfo:4", "URLInfo.__eq__", "URLInfo.__hash__", "URLInfo.__getattr__", "CloudURLInfo", "URLInfo.netloc", "URLInfo.__repr__", "URLInfo.bucket", "URLInfo.__div__", "CloudURLInfo.path", "URLInfo.parent", "URLInfo._path", "URLInfo.relative_to", "URLInfo.isin", "URLInfo.__init__", "URLInfo.url", "URLInfo.host", "URLInfo.port", "URLInfo.parts", "URLInfo.user", "URLInfo.__str__", "URLInfo.parents", "URLInfo.from_parts", "URLInfo"], "tokens": 861}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class URLInfo(object):\n DEFAULT_PORTS = {\"http\": 80, \"https\": 443, \"ssh\": 22}\n\n def __init__(self, url):\n self.parsed = urlparse(url)\n assert self.parsed.scheme != \"remote\"\n\n @classmethod\n def from_parts(\n cls, scheme=None, netloc=None, host=None, user=None, port=None, path=\"\"\n ):\n assert scheme and (bool(host) ^ bool(netloc))\n\n if netloc is None:\n netloc = host\n if user:\n netloc = user + \"@\" + host\n if port:\n netloc += \":\" + str(port)\n return cls(\"{}://{}{}\".format(scheme, netloc, path))\n\n @cached_property\n def url(self):\n p = self.parsed\n return \"{}://{}{}\".format(p.scheme, self.netloc, p.path)\n\n def __str__(self):\n return self.url\n\n def __repr__(self):\n return \"{}: '{}'\".format(type(self).__name__, self)\n\n def __eq__(self, other):\n if isinstance(other, basestring):\n other = self.__class__(other)\n return (\n self.__class__ == other.__class__\n and self.scheme == other.scheme\n and self.netloc == other.netloc\n and self._path == other._path\n )\n\n def __hash__(self):\n return hash(self.url)\n\n def __div__(self, other):\n p = self.parsed\n new_path = posixpath.join(p.path, str(other))\n if not new_path.startswith(\"/\"):\n new_path = \"/\" + new_path\n new_url = \"{}://{}{}\".format(p.scheme, p.netloc, new_path)\n return self.__class__(new_url)\n\n __truediv__ = __div__\n\n def __getattr__(self, name):\n return getattr(self.parsed, name)\n\n @cached_property\n def netloc(self):\n p = self.parsed\n netloc = p.hostname\n if p.username:\n netloc = p.username + \"@\" + netloc\n if p.port and int(p.port) != self.DEFAULT_PORTS.get(p.scheme):\n netloc += \":\" + str(p.port)\n return netloc\n\n @property\n def port(self):\n return self.parsed.port or self.DEFAULT_PORTS.get(self.parsed.scheme)\n\n @property\n def host(self):\n return self.parsed.hostname\n\n @property\n def user(self):\n return self.parsed.username\n\n @cached_property\n def _path(self):\n return PosixPathInfo(self.parsed.path)\n\n @property\n def name(self):\n return self._path.name\n\n @property\n def parts(self):\n return (self.scheme, self.netloc) + self._path.parts\n\n @property\n def bucket(self):\n return self.parsed.netloc\n\n @property\n def parent(self):\n return self.from_parts(\n scheme=self.scheme,\n netloc=self.parsed.netloc,\n path=self._path.parent.fspath,\n )\n\n @property\n def parents(self):\n return _URLPathParents(\n type(self), self.scheme, self.parsed.netloc, self._path\n )\n\n def relative_to(self, other):\n if isinstance(other, str):\n other = URLInfo(other)\n if self.scheme != other.scheme or self.netloc != other.netloc:\n raise ValueError(\n \"'{}' does not start with '{}'\".format(self, other)\n )\n return self._path.relative_to(other._path)\n\n def isin(self, other):\n if isinstance(other, basestring):\n other = self.__class__(other)\n elif self.__class__ != other.__class__:\n return False\n return (\n self.scheme == other.scheme\n and self.netloc == other.netloc\n and self._path.isin(other._path)\n )\n\n\nclass CloudURLInfo(URLInfo):\n @property\n def path(self):\n return self.parsed.path.lstrip(\"/\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_RemoteAZURE_RemoteAZURE.__init__.self.path_info._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_RemoteAZURE_RemoteAZURE.__init__.self.path_info._", "embedding": null, "metadata": {"file_path": "dvc/remote/azure.py", "file_name": "azure.py", "file_type": "text/x-python", "category": "implementation", "start_line": 34, "end_line": 77, "span_ids": ["RemoteAZURE.__init__", "RemoteAZURE"], "tokens": 342}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteAZURE(RemoteBASE):\n scheme = Schemes.AZURE\n path_cls = CloudURLInfo\n REGEX = (\n r\"azure://((?P[^=;]*)?|(\"\n # backward compatibility\n r\"(ContainerName=(?P[^;]+);?)?\"\n r\"(?P.+)?)?)$\"\n )\n REQUIRES = {\"azure-storage-blob\": 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 url = config.get(Config.SECTION_REMOTE_URL, \"azure://\")\n\n match = re.match(self.REGEX, url) # backward compatibility\n path = match.group(\"path\")\n bucket = (\n urlparse(url if path else \"\").netloc\n or match.group(\"container_name\") # backward compatibility\n or os.getenv(\"AZURE_STORAGE_CONTAINER_NAME\")\n )\n\n self.connection_string = (\n config.get(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 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 self.path_info = (\n self.path_cls(url)\n if path\n else self.path_cls.from_parts(scheme=self.scheme, netloc=bucket)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.get_dir_checksum_RemoteBASE.get_dir_cache.return.dir_info": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.get_dir_checksum_RemoteBASE.get_dir_cache.return.dir_info", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 170, "end_line": 203, "span_ids": ["RemoteBASE._get_dir_info_checksum", "RemoteBASE.get_dir_checksum", "RemoteBASE.get_dir_cache"], "tokens": 270}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def get_dir_checksum(self, path_info):\n dir_info = self._collect_dir(path_info)\n checksum, tmp_info = self._get_dir_info_checksum(dir_info)\n new_info = self.cache.checksum_to_path_info(checksum)\n if self.cache.changed_cache_file(checksum):\n self.cache.move(tmp_info, new_info)\n\n self.state.save(path_info, checksum)\n self.state.save(new_info, checksum)\n\n return checksum\n\n def _get_dir_info_checksum(self, dir_info):\n tmp = tempfile.NamedTemporaryFile(delete=False).name\n with open(tmp, \"w+\") as fobj:\n json.dump(dir_info, fobj, sort_keys=True)\n\n from_info = PathInfo(tmp)\n to_info = self.cache.path_info / tmp_fname(\"\")\n self.cache.upload([from_info], [to_info], no_progress_bar=True)\n\n checksum = self.get_file_checksum(to_info) + self.CHECKSUM_DIR_SUFFIX\n return checksum, to_info\n\n def get_dir_cache(self, checksum):\n assert checksum\n\n dir_info = self._dir_info.get(checksum)\n if dir_info:\n return dir_info\n\n dir_info = self.load_dir_cache(checksum)\n self._dir_info[checksum] = dir_info\n return dir_info", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.load_dir_cache_RemoteBASE.load_dir_cache.return.d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.load_dir_cache_RemoteBASE.load_dir_cache.return.d", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 224, "end_line": 251, "span_ids": ["RemoteBASE.load_dir_cache"], "tokens": 217}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def load_dir_cache(self, checksum):\n path_info = self.checksum_to_path_info(checksum)\n\n fobj = tempfile.NamedTemporaryFile(delete=False)\n path = fobj.name\n to_info = PathInfo(path)\n self.cache.download([path_info], [to_info], no_progress_bar=True)\n\n try:\n with open(path, \"r\") as fobj:\n d = json.load(fobj)\n except ValueError:\n logger.exception(\"Failed to load dir cache '{}'\".format(path_info))\n return []\n finally:\n os.unlink(path)\n\n if not isinstance(d, list):\n msg = \"dir cache file format error '{}' [skipping the file]\"\n logger.error(msg.format(relpath(path)))\n return []\n\n for info in d:\n # NOTE: here is a BUG, see comment to .as_posix() below\n relative_path = PathInfo.from_posix(info[self.PARAM_RELPATH])\n info[self.PARAM_RELPATH] = relative_path.fspath\n\n return d", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._changed_dir_cache_RemoteBASE.changed_cache.return.self_changed_cache_file_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._changed_dir_cache_RemoteBASE.changed_cache.return.self_changed_cache_file_c", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 493, "end_line": 511, "span_ids": ["RemoteBASE.changed_cache", "RemoteBASE._changed_dir_cache"], "tokens": 128}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def _changed_dir_cache(self, checksum):\n if self.changed_cache_file(checksum):\n return True\n\n if not self._changed_unpacked_dir(checksum):\n return False\n\n for entry in self.get_dir_cache(checksum):\n entry_checksum = entry[self.PARAM_CHECKSUM]\n if self.changed_cache_file(entry_checksum):\n return True\n\n self._update_unpacked_dir(checksum)\n return False\n\n def changed_cache(self, checksum):\n if self.is_dir_checksum(checksum):\n return self._changed_dir_cache(checksum)\n return self.changed_cache_file(checksum)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.cache_exists_RemoteBASE.cache_exists.return.list_set_checksums_set": {"__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_set_checksums_set", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 638, "end_line": 676, "span_ids": ["RemoteBASE.cache_exists"], "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 RemoteBASE(object):\n\n def cache_exists(self, checksums):\n \"\"\"Check if the given checksums are stored in the remote.\n\n There are two ways of performing this check:\n\n - Traverse: Get a list of all the files in the remote\n (traversing the cache directory) and compare it with\n the given checksums.\n\n - No traverse: For each given checksum, run the `exists`\n method and filter the checksums that aren't on the remote.\n This is done in parallel threads.\n It also shows a progress bar when performing the check.\n\n The reason for such an odd logic is that most of the remotes\n take much shorter time to just retrieve everything they have under\n a certain prefix (e.g. s3, gs, ssh, hdfs). Other remotes that can\n check if particular file exists much quicker, use their own\n implementation of cache_exists (see http, local).\n\n Returns:\n A list with checksums that were found in the remote\n \"\"\"\n progress_callback = ProgressCallback(len(checksums))\n\n def exists_with_progress(chunks):\n return self.batch_exists(chunks, callback=progress_callback)\n\n if self.no_traverse and hasattr(self, \"batch_exists\"):\n with ThreadPoolExecutor(max_workers=self.JOBS) as executor:\n path_infos = [self.checksum_to_path_info(x) for x in checksums]\n chunks = to_chunks(path_infos, num_chunks=self.JOBS)\n results = executor.map(exists_with_progress, chunks)\n in_remote = itertools.chain.from_iterable(results)\n ret = list(itertools.compress(checksums, in_remote))\n progress_callback.finish(\"\")\n return ret\n\n return list(set(checksums) & set(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._remove_redundant_files_RemoteBASE.checkout.return.self__checkout_path_info_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._remove_redundant_files_RemoteBASE.checkout.return.self__checkout_path_info_", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 748, "end_line": 791, "span_ids": ["RemoteBASE.checkout", "RemoteBASE._remove_redundant_files"], "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 _remove_redundant_files(self, path_info, dir_info, force):\n existing_files = set(\n path_info / root / fname\n for root, _, files in self.walk(path_info)\n for fname in files\n )\n\n needed_files = {\n path_info / entry[self.PARAM_RELPATH] for entry in dir_info\n }\n\n for path in existing_files - needed_files:\n self.safe_remove(path, force)\n\n def checkout(\n self, path_info, checksum_info, force=False, progress_callback=None\n ):\n if path_info.scheme not in [\"local\", self.scheme]:\n raise NotImplementedError\n\n checksum = checksum_info.get(self.PARAM_CHECKSUM)\n if not checksum:\n logger.warning(\n \"No checksum info found for '{}'. \"\n \"It won't be created.\".format(str(path_info))\n )\n self.safe_remove(path_info, force=force)\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 return self._checkout(path_info, checksum, force, progress_callback)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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": 660, "end_line": 690, "span_ids": ["RemoteBASE.unprotect", "RemoteBASE._update_unpacked_dir", "RemoteBASE._get_unpacked_dir_names", "RemoteBASE._checkout", "RemoteBASE._changed_unpacked_dir", "RemoteBASE.extract_used_local_checksums"], "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 RemoteBASE(object):\n\n def _checkout(\n self, path_info, checksum, force=False, progress_callback=None\n ):\n if not self.is_dir_checksum(checksum):\n return self._checkout_file(\n path_info, checksum, force, progress_callback=progress_callback\n )\n return self._checkout_dir(\n path_info, checksum, force, progress_callback=progress_callback\n )\n\n @staticmethod\n def unprotect(path_info):\n pass\n\n def _get_unpacked_dir_names(self, checksums):\n return set()\n\n def extract_used_local_checksums(self, cinfos):\n from dvc.remote import RemoteLOCAL\n\n used = {info[RemoteLOCAL.PARAM_CHECKSUM] for info in cinfos[\"local\"]}\n unpacked = self._get_unpacked_dir_names(used)\n return used | unpacked\n\n def _changed_unpacked_dir(self, checksum):\n return True\n\n def _update_unpacked_dir(self, checksum, progress_callback=None):\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/config.py_os_RemoteConfig.get_settings.return.settings": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/config.py_os_RemoteConfig.get_settings.return.settings", "embedding": null, "metadata": {"file_path": "dvc/remote/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 71, "span_ids": ["imports", "RemoteConfig.get_settings", "RemoteConfig.__init__", "RemoteConfig"], "tokens": 448}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport logging\nimport posixpath\n\nfrom dvc.utils import relpath\nfrom dvc.utils.compat import urlparse\nfrom dvc.config import Config, ConfigError\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass RemoteConfig(object):\n def __init__(self, config):\n self.config = config\n\n def get_settings(self, name):\n \"\"\"\n Args:\n name (str): The name of the remote that we want to retrieve\n\n Returns:\n dict: The content beneath the given remote name.\n\n Example:\n >>> config = {'remote \"server\"': {'url': 'ssh://localhost/'}}\n >>> get_settings(\"server\")\n {'url': 'ssh://localhost/'}\n \"\"\"\n settings = self.config.config.get(\n Config.SECTION_REMOTE_FMT.format(name.lower())\n )\n\n if settings is None:\n raise ConfigError(\n \"unable to find remote section '{}'\".format(name)\n )\n\n parsed = urlparse(settings[\"url\"])\n\n # Support for cross referenced remotes.\n # This will merge the settings, giving priority to the outer reference.\n # For example, having:\n #\n # dvc remote add server ssh://localhost\n # dvc remote modify server user root\n # dvc remote modify server ask_password true\n #\n # dvc remote add images remote://server/tmp/pictures\n # dvc remote modify images user alice\n # dvc remote modify images ask_password false\n # dvc remote modify images password asdf1234\n #\n # Results on a config dictionary like:\n #\n # {\n # \"url\": \"ssh://localhost/tmp/pictures\",\n # \"user\": \"alice\",\n # \"password\": \"asdf1234\",\n # \"ask_password\": False,\n # }\n #\n if parsed.scheme == \"remote\":\n reference = self.get_settings(parsed.netloc)\n url = posixpath.join(reference[\"url\"], parsed.path.lstrip(\"/\"))\n merged = reference.copy()\n merged.update(settings)\n merged[\"url\"] = url\n return merged\n\n return settings", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/config.py_RemoteConfig.add_RemoteConfig.add.if_default_.self_config_set_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/config.py_RemoteConfig.add_RemoteConfig.add.if_default_.self_config_set_", "embedding": null, "metadata": {"file_path": "dvc/remote/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 90, "end_line": 112, "span_ids": ["RemoteConfig.add"], "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 RemoteConfig(object):\n\n def add(self, name, url, default=False, force=False, level=None):\n from dvc.remote import _get, RemoteLOCAL\n\n configobj = self.config.get_configobj(level)\n remote = _get({Config.SECTION_REMOTE_URL: url})\n if remote == RemoteLOCAL and not url.startswith(\"remote://\"):\n url = self.resolve_path(url, configobj.filename)\n\n self.config.set(\n Config.SECTION_REMOTE_FMT.format(name),\n Config.SECTION_REMOTE_URL,\n url,\n force=force,\n level=level,\n )\n if default:\n logger.info(\"Setting '{}' as a default remote.\".format(name))\n self.config.set(\n Config.SECTION_CORE,\n Config.SECTION_CORE_REMOTE,\n name,\n level=level,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/config.py_RemoteConfig.remove_RemoteConfig.remove.for_lev_in_.if_lev_level_.break": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/config.py_RemoteConfig.remove_RemoteConfig.remove.for_lev_in_.if_lev_level_.break", "embedding": null, "metadata": {"file_path": "dvc/remote/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 114, "end_line": 133, "span_ids": ["RemoteConfig.remove"], "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 RemoteConfig(object):\n\n def remove(self, name, level=None):\n self.config.unset(Config.SECTION_REMOTE_FMT.format(name), level=level)\n\n if level is None:\n level = Config.LEVEL_REPO\n\n for lev in [\n Config.LEVEL_LOCAL,\n Config.LEVEL_REPO,\n Config.LEVEL_GLOBAL,\n Config.LEVEL_SYSTEM,\n ]:\n self.config.unset(\n Config.SECTION_CORE,\n Config.SECTION_CORE_REMOTE,\n level=lev,\n force=True,\n )\n if lev == level:\n break", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/config.py_RemoteConfig.modify_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/config.py_RemoteConfig.modify_", "embedding": null, "metadata": {"file_path": "dvc/remote/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 135, "end_line": 152, "span_ids": ["RemoteConfig.modify", "RemoteConfig.set_default", "RemoteConfig.list"], "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 RemoteConfig(object):\n\n def modify(self, name, option, value, level=None):\n self.config.set(\n Config.SECTION_REMOTE_FMT.format(name), option, value, level=level\n )\n\n def list(self, level=None):\n return self.config.list_options(\n Config.SECTION_REMOTE_REGEX, Config.SECTION_REMOTE_URL, level=level\n )\n\n def set_default(self, name, unset=False, level=None):\n if unset:\n self.config.unset(Config.SECTION_CORE, Config.SECTION_CORE_REMOTE)\n return\n self.config.set(\n Config.SECTION_CORE, Config.SECTION_CORE_REMOTE, name, level=level\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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__.if_not_self_user_.self.user.config_get_": {"__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__.if_not_self_user_.self.user.config_get_", "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": 34, "span_ids": ["RemoteHDFS.__init__", "imports", "RemoteHDFS"], "tokens": 210}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import unicode_literals\n\nimport os\nimport re\nimport getpass\nimport posixpath\nimport logging\nfrom subprocess import Popen, PIPE\n\nfrom dvc.config import Config\nfrom dvc.scheme import Schemes\n\nfrom dvc.remote.base import RemoteBASE, RemoteCmdError\nfrom dvc.utils import fix_env, tmp_fname\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass RemoteHDFS(RemoteBASE):\n scheme = Schemes.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 url = config.get(Config.SECTION_REMOTE_URL, \"/\")\n self.path_info = self.path_cls(url)\n\n self.user = self.path_info.user\n if not self.user:\n self.user = config.get(\n Config.SECTION_REMOTE_USER, getpass.getuser()\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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/__init__.py_RemoteLOCAL_RemoteLOCAL.makedirs.if_not_self_exists_path_i.os_makedirs_fspath_py35_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_RemoteLOCAL_RemoteLOCAL.makedirs.if_not_self_exists_path_i.os_makedirs_fspath_py35_p", "embedding": null, "metadata": {"file_path": "dvc/remote/local/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 42, "end_line": 126, "span_ids": ["RemoteLOCAL.compat_config", "RemoteLOCAL.get", "RemoteLOCAL.supported", "RemoteLOCAL.makedirs", "RemoteLOCAL.cache_dir", "RemoteLOCAL.__init__", "RemoteLOCAL", "RemoteLOCAL.list_cache_paths", "RemoteLOCAL.exists"], "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 RemoteLOCAL(RemoteBASE):\n scheme = Schemes.LOCAL\n path_cls = PathInfo\n PARAM_CHECKSUM = \"md5\"\n PARAM_PATH = \"path\"\n\n UNPACKED_DIR_SUFFIX = \".unpacked\"\n\n DEFAULT_CACHE_TYPES = [\"reflink\", \"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\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 = copy(self.DEFAULT_CACHE_TYPES)\n\n # A clunky way to detect cache dir\n storagepath = config.get(Config.SECTION_LOCAL_STORAGEPATH, None)\n cache_dir = config.get(Config.SECTION_REMOTE_URL, storagepath)\n\n if cache_dir is not None and not os.path.isabs(cache_dir):\n cwd = config[Config.PRIVATE_CWD]\n cache_dir = os.path.abspath(os.path.join(cwd, cache_dir))\n\n if cache_dir is not None and not os.path.exists(cache_dir):\n os.mkdir(cache_dir)\n\n self.path_info = PathInfo(cache_dir) if cache_dir else None\n self._dir_info = {}\n\n @property\n def cache_dir(self):\n return self.path_info.fspath if self.path_info else None\n\n @classmethod\n def supported(cls, config):\n return True\n\n @staticmethod\n def compat_config(config):\n ret = config.copy()\n url = ret.pop(Config.SECTION_LOCAL_STORAGEPATH, \"\")\n ret[Config.SECTION_REMOTE_URL] = url\n return ret\n\n def list_cache_paths(self):\n assert self.path_info is not None\n\n clist = []\n for entry in os.listdir(fspath_py35(self.path_info)):\n subdir = self.path_info / entry\n if not os.path.isdir(fspath_py35(subdir)):\n continue\n clist.extend(\n subdir / cache for cache in os.listdir(fspath_py35(subdir))\n )\n\n return clist\n\n def get(self, md5):\n if not md5:\n return None\n\n return self.checksum_to_path_info(md5).url\n\n def exists(self, path_info):\n assert path_info.scheme == \"local\"\n return os.path.lexists(fspath_py35(path_info))\n\n def makedirs(self, path_info):\n if not self.exists(path_info):\n os.makedirs(fspath_py35(path_info))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_RemoteLOCAL.link_RemoteLOCAL.link.self__try_links_from_info": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_RemoteLOCAL.link_RemoteLOCAL.link.self__try_links_from_info", "embedding": null, "metadata": {"file_path": "dvc/remote/local/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 128, "end_line": 151, "span_ids": ["RemoteLOCAL.link"], "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 RemoteLOCAL(RemoteBASE):\n\n def link(self, from_info, to_info, link_type=None):\n from_path = from_info.fspath\n to_path = to_info.fspath\n\n assert os.path.isfile(from_path)\n\n dname = os.path.dirname(to_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(from_path) == 0:\n open(to_path, \"w+\").close()\n\n msg = \"Created empty file: {} -> {}\".format(from_path, to_path)\n logger.debug(msg)\n return\n\n if not link_type:\n link_types = self.cache_types\n else:\n link_types = [link_type]\n\n self._try_links(from_info, to_info, link_types)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_RemoteLOCAL._get_link_method_RemoteLOCAL._link.logger_debug_msg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_RemoteLOCAL._get_link_method_RemoteLOCAL._link.logger_debug_msg_", "embedding": null, "metadata": {"file_path": "dvc/remote/local/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 153, "end_line": 177, "span_ids": ["RemoteLOCAL._get_link_method", "RemoteLOCAL._link"], "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 RemoteLOCAL(RemoteBASE):\n\n @classmethod\n def _get_link_method(cls, link_type):\n try:\n return cls.CACHE_TYPE_MAP[link_type]\n except KeyError:\n raise DvcException(\n \"Cache type: '{}' not supported!\".format(link_type)\n )\n\n def _link(self, from_info, to_info, link_method):\n if self.exists(to_info):\n raise DvcException(\"Link '{}' already exists!\".format(to_info))\n else:\n link_method(from_info.fspath, to_info.fspath)\n\n if self.protected:\n self.protect(to_info)\n\n msg = \"Created {}'{}': {} -> {}\".format(\n \"protected \" if self.protected else \"\",\n self.cache_types[0],\n from_info,\n to_info,\n )\n logger.debug(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/__init__.py_RemoteLOCAL._try_links_RemoteLOCAL._try_links.raise_DvcException_no_po": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_RemoteLOCAL._try_links_RemoteLOCAL._try_links.raise_DvcException_no_po", "embedding": null, "metadata": {"file_path": "dvc/remote/local/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 179, "end_line": 194, "span_ids": ["RemoteLOCAL._try_links"], "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 RemoteLOCAL(RemoteBASE):\n\n @slow_link_guard\n def _try_links(self, from_info, to_info, link_types):\n i = len(link_types)\n while i > 0:\n link_method = self._get_link_method(link_types[0])\n try:\n self._link(from_info, to_info, link_method)\n return\n\n except DvcException as exc:\n msg = \"Cache type '{}' is not supported: {}\"\n logger.debug(msg.format(link_types[0], str(exc)))\n del link_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/__init__.py_RemoteLOCAL.push_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/__init__.py_RemoteLOCAL.push_RemoteLOCAL._log_missing_caches.if_missing_caches_.logger_warning_msg_", "embedding": null, "metadata": {"file_path": "dvc/remote/local/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 503, "end_line": 538, "span_ids": ["RemoteLOCAL.push", "RemoteLOCAL.pull", "RemoteLOCAL._log_missing_caches"], "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 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 _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/__init__.py_RemoteLOCAL._unprotect_dir_RemoteLOCAL._path_info_changed.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_RemoteLOCAL._unprotect_dir_RemoteLOCAL._path_info_changed.return.True", "embedding": null, "metadata": {"file_path": "dvc/remote/local/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 567, "end_line": 598, "span_ids": ["RemoteLOCAL._path_info_changed", "RemoteLOCAL.unprotect", "RemoteLOCAL.protect", "RemoteLOCAL._get_unpacked_dir_path_info", "RemoteLOCAL._unprotect_dir"], "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 RemoteLOCAL(RemoteBASE):\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.fspath\n if not os.path.exists(path):\n raise DvcException(\n \"can't unprotect non-existing data '{}'\".format(path)\n )\n\n if os.path.isdir(path):\n RemoteLOCAL._unprotect_dir(path)\n else:\n RemoteLOCAL._unprotect_file(path)\n\n @staticmethod\n def protect(path_info):\n os.chmod(\n fspath_py35(path_info), stat.S_IREAD | stat.S_IRGRP | stat.S_IROTH\n )\n\n def _get_unpacked_dir_path_info(self, checksum):\n info = self.checksum_to_path_info(checksum)\n return info.with_name(info.name + self.UNPACKED_DIR_SUFFIX)\n\n def _path_info_changed(self, path_info):\n if self.exists(path_info) and self.state.get(path_info):\n return False\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_RemoteLOCAL._update_unpacked_dir_RemoteLOCAL._update_unpacked_dir.try_.except_DvcException_.self_remove_unpacked_dir_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_RemoteLOCAL._update_unpacked_dir_RemoteLOCAL._update_unpacked_dir.try_.except_DvcException_.self_remove_unpacked_dir_", "embedding": null, "metadata": {"file_path": "dvc/remote/local/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 600, "end_line": 614, "span_ids": ["RemoteLOCAL._update_unpacked_dir"], "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 RemoteLOCAL(RemoteBASE):\n\n def _update_unpacked_dir(self, checksum):\n unpacked_dir_info = self._get_unpacked_dir_path_info(checksum)\n\n if not self._path_info_changed(unpacked_dir_info):\n return\n\n self.remove(unpacked_dir_info)\n\n try:\n dir_info = self.get_dir_cache(checksum)\n self._create_unpacked_dir(checksum, dir_info, unpacked_dir_info)\n except DvcException:\n logger.warning(\"Could not create '{}'\".format(unpacked_dir_info))\n\n self.remove(unpacked_dir_info)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_RemoteLOCAL._create_unpacked_dir_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_RemoteLOCAL._create_unpacked_dir_", "embedding": null, "metadata": {"file_path": "dvc/remote/local/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 529, "end_line": 554, "span_ids": ["RemoteLOCAL._changed_unpacked_dir", "RemoteLOCAL._create_unpacked_dir", "RemoteLOCAL._get_unpacked_dir_names"], "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 RemoteLOCAL(RemoteBASE):\n\n def _create_unpacked_dir(self, checksum, dir_info, unpacked_dir_info):\n self.makedirs(unpacked_dir_info)\n\n for entry in progress(dir_info, name=\"Created unpacked dir\"):\n entry_cache_info = self.checksum_to_path_info(\n entry[self.PARAM_CHECKSUM]\n )\n relative_path = entry[self.PARAM_RELPATH]\n self.link(\n entry_cache_info, unpacked_dir_info / relative_path, \"hardlink\"\n )\n\n self.state.save(unpacked_dir_info, checksum)\n\n def _changed_unpacked_dir(self, checksum):\n status_unpacked_dir_info = self._get_unpacked_dir_path_info(checksum)\n\n return not self.state.get(status_unpacked_dir_info)\n\n def _get_unpacked_dir_names(self, checksums):\n unpacked = set()\n for c in checksums:\n if self.is_dir_checksum(c):\n unpacked.add(c + self.UNPACKED_DIR_SUFFIX)\n return unpacked", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git._ignored_Git.ignore.self_ignored_paths_append": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git._ignored_Git.ignore.self_ignored_paths_append", "embedding": null, "metadata": {"file_path": "dvc/scm/git/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 107, "end_line": 135, "span_ids": ["Git._ignored", "Git.ignore"], "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 Git(Base):\n\n @staticmethod\n def _ignored(entry, gitignore_path):\n if os.path.exists(gitignore_path):\n with open(gitignore_path, \"r\") as fobj:\n ignore_list = fobj.readlines()\n return any(\n filter(lambda x: x.strip() == entry.strip(), ignore_list)\n )\n return False\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 if self._ignored(entry, gitignore):\n return\n\n msg = \"Adding '{}' to '{}'.\".format(relpath(path), relpath(gitignore))\n logger.info(msg)\n\n self._add_entry_to_gitignore(entry, gitignore)\n\n self.track_file(relpath(gitignore))\n\n self.ignored_paths.append(path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git._add_entry_to_gitignore_Git._add_entry_to_gitignore.with_open_gitignore_a_.fobj_write_n_forma": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git._add_entry_to_gitignore_Git._add_entry_to_gitignore.with_open_gitignore_a_.fobj_write_n_forma", "embedding": null, "metadata": {"file_path": "dvc/scm/git/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 139, "end_line": 150, "span_ids": ["Git._add_entry_to_gitignore"], "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 Git(Base):\n\n @staticmethod\n def _add_entry_to_gitignore(entry, gitignore):\n with open(gitignore, \"a+\", encoding=\"utf-8\") as fobj:\n fobj.seek(0, os.SEEK_END)\n if fobj.tell() == 0:\n # Empty file\n prefix = \"\"\n else:\n fobj.seek(fobj.tell() - 1, os.SEEK_SET)\n last = fobj.read(1)\n prefix = \"\" if last == \"\\n\" else \"\\n\"\n fobj.write(\"{}{}\\n\".format(prefix, entry))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.ignore_remove_Git.add.try_.except_AssertionError_.logger_exception_msg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/__init__.py_Git.ignore_remove_Git.add.try_.except_AssertionError_.logger_exception_msg_", "embedding": null, "metadata": {"file_path": "dvc/scm/git/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 150, "end_line": 179, "span_ids": ["Git.ignore_remove", "Git.add"], "tokens": 227}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Git(Base):\n\n def ignore_remove(self, path):\n entry, gitignore = self._get_gitignore(path)\n\n if not os.path.exists(gitignore):\n return\n\n with open(gitignore, \"r\") as fobj:\n lines = fobj.readlines()\n\n filtered = list(filter(lambda x: x.strip() != entry.strip(), lines))\n\n with open(gitignore, \"w\") as fobj:\n fobj.writelines(filtered)\n\n self.track_file(relpath(gitignore))\n\n def add(self, paths):\n # NOTE: GitPython is not currently able to handle index version >= 3.\n # See https://github.com/iterative/dvc/issues/610 for more details.\n try:\n self.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.exception(msg)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.remove_unused_links_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.remove_unused_links_", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 425, "end_line": 460, "span_ids": ["State.remove_unused_links"], "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 State(StateBase):\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 chunk_unused in to_chunks(\n unused, chunk_size=SQLITE_MAX_VARIABLES_NUMBER\n ):\n cmd = \"DELETE FROM {} WHERE path IN ({})\".format(\n self.LINK_STATE_TABLE, \",\".join([\"?\"] * len(chunk_unused))\n )\n self._execute(cmd, tuple(chunk_unused))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/setup.py_from_setuptools_import_se__Extra_dependecies_to_ru": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/setup.py_from_setuptools_import_se__Extra_dependecies_to_ru", "embedding": null, "metadata": {"file_path": "setup.py", "file_name": "setup.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 81, "span_ids": ["imports", "impl:7", "build_py.run", "build_py", "build_py.pin_version"], "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": "from setuptools import setup, find_packages\nfrom setuptools.command.build_py import build_py as _build_py\nimport os\nimport sys\n\n\n# https://packaging.python.org/guides/single-sourcing-package-version/\npkg_dir = os.path.dirname(__file__)\n\n# This will define __version__ implicitly\nwith open(os.path.join(pkg_dir, \"dvc\", \"version.py\")) as fobj:\n exec(fobj.read())\n\nversion = __version__ # noqa: F821\n\n\n# To achieve consistency between the build version and the one provided\n# by your package during runtime, you need to **pin** the build version.\n#\n# This custom class will replace the version.py module with a **static**\n# `__version__` that your package can read at runtime, assuring consistancy.\n#\n# References:\n# - https://docs.python.org/3.7/distutils/extending.html\n# - https://github.com/python/mypy\nclass build_py(_build_py):\n def pin_version(self):\n path = os.path.join(self.build_lib, \"dvc\")\n self.mkpath(path)\n with open(os.path.join(path, \"version.py\"), \"w\") as fobj:\n fobj.write(\"# AUTOGENERATED at build time by setup.py\\n\")\n fobj.write('__version__ = \"{}\"\\n'.format(version))\n\n def run(self):\n self.execute(self.pin_version, ())\n _build_py.run(self)\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 \"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-ng>=1.4.3\",\n \"requests>=2.22.0\",\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 \"inflect>=2.1.0\",\n \"humanize>=0.5.1\",\n \"ruamel.yaml>=0.15.91\",\n \"psutil==5.6.2\",\n \"funcy>=1.12\",\n \"pathspec>=0.5.9\",\n \"shortuuid>=0.5.0\",\n \"win-unicode-console>=0.5; sys_platform == 'win32'\",\n]\n\nif sys.version_info[0] == 2:\n install_requires.append(\"networkx>=2.1,<2.3\")\nelse:\n install_requires.append(\"networkx>=2.1\")\n\n# Extra dependencies for remote integrations\ngs = [\"google-cloud-storage==1.13.0\"]\ns3 = [\"boto3==1.9.115\"]\nazure = [\"azure-storage-blob==2.0.1\"]\noss = [\"oss2==2.6.1\"]\nssh = [\"paramiko>=2.5.0\"]\nall_remotes = gs + s3 + azure + ssh + oss\n\n# Extra dependecies to run tests", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/setup.py_tests_requirements_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/setup.py_tests_requirements_", "embedding": null, "metadata": {"file_path": "setup.py", "file_name": "setup.py", "file_type": "text/x-python", "category": "implementation", "start_line": 82, "end_line": 149, "span_ids": ["impl:27", "impl:7"], "tokens": 633}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "tests_requirements = [\n \"PyInstaller==3.4\",\n \"wheel>=0.31.1\",\n \"pydot>=1.2.4\",\n # Test requirements:\n \"pytest>=4.6.0\",\n \"pytest-timeout>=1.3.3\",\n \"pytest-cov>=2.6.1\",\n \"pytest-xdist>=1.26.1\",\n \"pytest-mock>=1.10.4\",\n \"flaky>=3.5.3\",\n \"mock>=3.0.0\",\n \"xmltodict>=0.11.0\",\n \"awscli>=1.16.125\",\n \"google-compute-engine\",\n \"pywin32; sys_platform == 'win32'\",\n \"Pygments\", # required by collective.checkdocs,\n \"collective.checkdocs\",\n \"flake8\",\n \"flake8-docstrings\",\n \"pydocstyle<4.0\",\n \"jaraco.windows==3.9.2\",\n \"mock-ssh-server>=0.5.0\",\n]\n\nif (sys.version_info) >= (3, 6):\n tests_requirements.append(\"black==19.3b0\")\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 \"oss\": oss,\n \"ssh\": ssh,\n # NOTE: https://github.com/inveniosoftware/troubleshooting/issues/1\n \":python_version=='2.7'\": [\"futures\", \"pathlib2\"],\n \"tests\": tests_requirements,\n },\n keywords=\"data science, data version control, machine learning\",\n python_requires=\">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*\",\n classifiers=[\n \"Development Status :: 4 - Beta\",\n \"Programming Language :: Python :: 2\",\n \"Programming Language :: Python :: 2.7\",\n \"Programming Language :: Python :: 3\",\n \"Programming Language :: Python :: 3.5\",\n \"Programming Language :: Python :: 3.6\",\n \"Programming Language :: Python :: 3.7\",\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 cmdclass={\"build_py\": build_py},\n zip_safe=False,\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_local.py_os_TestUnpackedDirStatusOptimization.test_should_not_fail_add_on_unpacked_dir_creation_exception.assert_unpacked_create_sp": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_local.py_os_TestUnpackedDirStatusOptimization.test_should_not_fail_add_on_unpacked_dir_creation_exception.assert_unpacked_create_sp", "embedding": null, "metadata": {"file_path": "tests/func/remote/test_local.py", "file_name": "test_local.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 33, "span_ids": ["imports", "TestUnpackedDirStatusOptimization", "TestUnpackedDirStatusOptimization.test_should_not_fail_add_on_unpacked_dir_creation_exception", "TestUnpackedDirStatusOptimization.setUp"], "tokens": 228}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nimport mock\nimport pytest\n\nimport dvc\nfrom dvc.exceptions import DvcException\nfrom dvc.remote.local import RemoteLOCAL\nfrom tests.utils import trees_equal\n\n\nclass TestUnpackedDirStatusOptimization(object):\n @pytest.fixture(autouse=True)\n def setUp(self, dvc_repo, repo_dir):\n stages = dvc_repo.add(repo_dir.DATA_DIR)\n assert len(stages) == 1\n self.dir_out = stages[0].outs[0]\n self.unpacked_dir = (\n self.dir_out.cache_path + RemoteLOCAL.UNPACKED_DIR_SUFFIX\n )\n\n def test_should_not_fail_add_on_unpacked_dir_creation_exception(\n self, dvc_repo\n ):\n with mock.patch.object(\n dvc.remote.local.RemoteLOCAL,\n \"_create_unpacked_dir\",\n side_effect=self._raise_dvc_exception,\n ) as unpacked_create_spy, dvc_repo.state:\n assert not dvc_repo.cache.local.changed_cache(\n self.dir_out.checksum\n )\n assert unpacked_create_spy.call_count == 1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_local.py_TestUnpackedDirStatusOptimization.test_should_remove_unpacked_dir_on_create_exception_TestUnpackedDirStatusOptimization.test_should_create_unpacked_dir_on_status_check.trees_equal_repo_dir_DATA": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_local.py_TestUnpackedDirStatusOptimization.test_should_remove_unpacked_dir_on_create_exception_TestUnpackedDirStatusOptimization.test_should_create_unpacked_dir_on_status_check.trees_equal_repo_dir_DATA", "embedding": null, "metadata": {"file_path": "tests/func/remote/test_local.py", "file_name": "test_local.py", "file_type": "text/x-python", "category": "test", "start_line": 35, "end_line": 63, "span_ids": ["TestUnpackedDirStatusOptimization.test_should_remove_unpacked_dir_on_create_exception", "TestUnpackedDirStatusOptimization.test_should_create_unpacked_dir_on_status_check"], "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 TestUnpackedDirStatusOptimization(object):\n\n def test_should_remove_unpacked_dir_on_create_exception(self, dvc_repo):\n # artificial unpacked dir for test purpose\n os.makedirs(self.unpacked_dir)\n assert os.path.exists(self.unpacked_dir)\n\n with mock.patch.object(\n dvc.remote.local.RemoteLOCAL,\n \"_create_unpacked_dir\",\n side_effect=self._raise_dvc_exception,\n ), dvc_repo.state:\n assert not dvc_repo.cache.local.changed_cache(\n self.dir_out.checksum\n )\n\n assert not os.path.exists(self.unpacked_dir)\n\n def test_should_create_unpacked_dir_on_status_check(\n self, dvc_repo, repo_dir\n ):\n assert not os.path.exists(self.unpacked_dir)\n\n with dvc_repo.state:\n assert not dvc_repo.cache.local.changed_cache(\n self.dir_out.checksum\n )\n\n assert os.path.exists(self.unpacked_dir)\n\n trees_equal(repo_dir.DATA_DIR, self.unpacked_dir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_local.py_TestUnpackedDirStatusOptimization.test_should_proceed_with_full_check_on_modified_cache_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/remote/test_local.py_TestUnpackedDirStatusOptimization.test_should_proceed_with_full_check_on_modified_cache_", "embedding": null, "metadata": {"file_path": "tests/func/remote/test_local.py", "file_name": "test_local.py", "file_type": "text/x-python", "category": "test", "start_line": 65, "end_line": 85, "span_ids": ["TestUnpackedDirStatusOptimization._raise_dvc_exception", "TestUnpackedDirStatusOptimization.test_should_proceed_with_full_check_on_modified_cache"], "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 TestUnpackedDirStatusOptimization(object):\n\n def test_should_proceed_with_full_check_on_modified_cache(self, dvc_repo):\n\n some_file_md5 = self.dir_out.dir_cache[0][\"md5\"]\n assert not os.path.exists(self.unpacked_dir)\n\n with dvc_repo.state:\n assert not dvc_repo.cache.local.changed_cache(\n self.dir_out.checksum\n )\n assert os.path.exists(self.unpacked_dir)\n\n with open(dvc_repo.cache.local.get(some_file_md5), \"a\") as fobj:\n fobj.write(\"string\")\n\n with dvc_repo.state:\n assert dvc_repo.cache.local.changed_cache(self.dir_out.checksum)\n\n @staticmethod\n def _raise_dvc_exception(*args):\n raise DvcException(\"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/tests/func/test_config.py_TestConfigCLI._do_test_TestConfigCLI._do_test.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_config.py_TestConfigCLI._do_test_TestConfigCLI._do_test.None_7", "embedding": null, "metadata": {"file_path": "tests/func/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 35, "end_line": 60, "span_ids": ["TestConfigCLI._do_test"], "tokens": 213}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_config.py_TestConfigCLI.test_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_config.py_TestConfigCLI.test_", "embedding": null, "metadata": {"file_path": "tests/func/test_config.py", "file_name": "test_config.py", "file_type": "text/x-python", "category": "test", "start_line": 62, "end_line": 86, "span_ids": ["TestConfigCLI.test_non_existing", "TestConfigCLI.test", "TestConfigCLI.test_local"], "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 TestConfigCLI(TestDvc):\n\n def test(self):\n self._do_test(False)\n\n def test_local(self):\n self._do_test(True)\n\n def test_non_existing(self):\n ret = main([\"config\", \"non_existing_section.field\"])\n self.assertEqual(ret, 251)\n\n ret = main([\"config\", \"global.non_existing_field\"])\n self.assertEqual(ret, 251)\n\n ret = main([\"config\", \"non_existing_section.field\", \"-u\"])\n self.assertEqual(ret, 251)\n\n ret = main([\"config\", \"global.non_existing_field\", \"-u\"])\n self.assertEqual(ret, 251)\n\n ret = main([\"config\", \"core.remote\", \"myremote\"])\n self.assertEqual(ret, 0)\n\n ret = main([\"config\", \"core.non_existing_field\", \"-u\"])\n self.assertEqual(ret, 251)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRemoteAZURE_TestRemoteSSH._get_cloud_class.return.RemoteSSH": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestRemoteAZURE_TestRemoteSSH._get_cloud_class.return.RemoteSSH", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 403, "end_line": 449, "span_ids": ["TestRemoteSSH._get_url", "TestRemoteLOCAL._get_url", "TestRemoteOSS._should_test", "TestRemoteLOCAL._get_cloud_class", "TestRemoteSSH", "TestRemoteLOCAL", "TestRemoteOSS._get_url", "TestRemoteSSH._should_test", "TestRemoteSSH._get_cloud_class", "TestRemoteAZURE._get_url", "TestRemoteLOCAL.test", "TestRemoteOSS._get_cloud_class", "TestRemoteLOCAL._should_test", "TestRemoteAZURE", "TestRemoteOSS", "TestRemoteAZURE._should_test", "TestRemoteAZURE._get_cloud_class"], "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 TestRemoteAZURE(TestDataCloudBase):\n def _should_test(self):\n return _should_test_azure()\n\n def _get_url(self):\n return get_azure_url()\n\n def _get_cloud_class(self):\n return RemoteAZURE\n\n\nclass TestRemoteOSS(TestDataCloudBase):\n def _should_test(self):\n return _should_test_oss()\n\n def _get_url(self):\n return get_oss_url()\n\n def _get_cloud_class(self):\n return RemoteOSS\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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestShouldWarnOnNoChecksumInLocalAndRemoteCache_TestShouldWarnOnNoChecksumInLocalAndRemoteCache.setUp.self.message_foo_part._name_md5_forma": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_data_cloud.py_TestShouldWarnOnNoChecksumInLocalAndRemoteCache_TestShouldWarnOnNoChecksumInLocalAndRemoteCache.setUp.self.message_foo_part._name_md5_forma", "embedding": null, "metadata": {"file_path": "tests/func/test_data_cloud.py", "file_name": "test_data_cloud.py", "file_type": "text/x-python", "category": "test", "start_line": 839, "end_line": 867, "span_ids": ["TestShouldWarnOnNoChecksumInLocalAndRemoteCache", "TestShouldWarnOnNoChecksumInLocalAndRemoteCache.setUp"], "tokens": 243}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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 self.message_bar_part = \"name: {}, md5: {}\".format(\n self.BAR, checksum_bar\n )\n self.message_foo_part = \"name: {}, md5: {}\".format(\n self.FOO, checksum_foo\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dependency.py_from___future___import_un_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_dependency.py_from___future___import_un_", "embedding": null, "metadata": {"file_path": "tests/func/test_dependency.py", "file_name": "test_dependency.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 23, "span_ids": ["_get_dep", "imports", "test_scheme"], "tokens": 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\nimport copy\nimport pytest\n\nfrom dvc.stage import Stage\nfrom dvc.dependency import _get, DEP_MAP\n\nfrom tests.func.test_output import TESTS as OUT_TESTS\n\n\nTESTS = copy.copy(OUT_TESTS)\nTESTS.append((\"http://example.com/path/to/file\", \"http\"))\nTESTS.append((\"https://example.com/path/to/file\", \"https\"))\n\n\ndef _get_dep(dvc, path):\n return _get(Stage(dvc), path, None)\n\n\n@pytest.mark.parametrize(\"url,scheme\", TESTS)\ndef test_scheme(dvc_repo, url, scheme):\n assert type(_get_dep(dvc_repo, url)) == DEP_MAP[scheme]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_TestRemote.test_relative_path_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/func/test_remote.py_TestRemote.test_relative_path_TestRemote.test_relative_path.self_assertEqual_config_", "embedding": null, "metadata": {"file_path": "tests/func/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 35, "end_line": 44, "span_ids": ["TestRemote.test_relative_path"], "tokens": 133}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRemote(TestDvc):\n\n def test_relative_path(self):\n dname = os.path.join(\"..\", \"path\", \"to\", \"dir\")\n ret = main([\"remote\", \"add\", \"mylocal\", dname])\n self.assertEqual(ret, 0)\n\n # NOTE: we are in the repo's root and config is in .dvc/, so\n # dir path written to config should be just one level above.\n rel = os.path.join(\"..\", dname)\n config = configobj.ConfigObj(self.dvc.config.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/func/test_repo.py_TestCollect._check_TestCollect.test.self_assertEqual_str_i_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repo.py_TestCollect._check_TestCollect.test.self_assertEqual_str_i_", "embedding": null, "metadata": {"file_path": "tests/func/test_repo.py", "file_name": "test_repo.py", "file_type": "text/x-python", "category": "test", "start_line": 30, "end_line": 46, "span_ids": ["TestCollect._check", "TestCollect.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 TestCollect(TestDvcGit):\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([[str(j) for j in i.outs] for i in result], expected)\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([str(i) 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/func/test_s3.py_boto3_test_copy_singlepart_preserve_etag.RemoteS3__copy_s3_from_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_s3.py_boto3_test_copy_singlepart_preserve_etag.RemoteS3__copy_s3_from_i", "embedding": null, "metadata": {"file_path": "tests/func/test_s3.py", "file_name": "test_s3.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 22, "span_ids": ["imports", "_get_src_dst", "test_copy_singlepart_preserve_etag"], "tokens": 154}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import boto3\nimport pytest\n\nfrom dvc.remote.s3 import RemoteS3\nfrom tests.func.test_data_cloud import _should_test_aws, get_aws_url\n\n\ndef _get_src_dst():\n base_info = RemoteS3.path_cls(get_aws_url())\n return base_info / \"from\", base_info / \"to\"\n\n\ndef test_copy_singlepart_preserve_etag():\n from_info, to_info = _get_src_dst()\n\n if not _should_test_aws():\n pytest.skip()\n\n s3 = boto3.client(\"s3\")\n s3.put_object(Bucket=from_info.bucket, Key=from_info.path, Body=\"data\")\n\n RemoteS3._copy(s3, from_info, to_info, {})", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_TestSCMGitSubmodule_TestIgnore.test_ignore.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_TestSCMGitSubmodule_TestIgnore.test_ignore.None_4", "embedding": null, "metadata": {"file_path": "tests/func/test_scm.py", "file_name": "test_scm.py", "file_type": "text/x-python", "category": "test", "start_line": 51, "end_line": 86, "span_ids": ["TestSCMGitSubmodule.test_git_submodule", "TestSCMGitSubmodule.test_commit_in_submodule", "TestIgnore._count_gitignore_entries", "TestIgnore.test_ignore", "TestIgnore", "TestSCMGitSubmodule", "TestSCMGitSubmodule.test_is_submodule"], "tokens": 261}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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(object):\n @staticmethod\n def _count_gitignore_entries(string):\n lines = get_gitignore_content()\n return len([i for i in lines if i == string])\n\n def test_ignore(self, git, repo_dir):\n git = Git(repo_dir._root_dir)\n foo = os.path.join(repo_dir._root_dir, repo_dir.FOO)\n\n target = \"/\" + repo_dir.FOO\n\n git.ignore(foo)\n assert os.path.isfile(Git.GITIGNORE)\n assert self._count_gitignore_entries(target) == 1\n\n git.ignore(foo)\n assert os.path.isfile(Git.GITIGNORE)\n assert self._count_gitignore_entries(target) == 1\n\n git.ignore_remove(foo)\n assert self._count_gitignore_entries(target) == 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_TestIgnore.test_get_gitignore_TestIgnore.test_get_gitignore.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_TestIgnore.test_get_gitignore_TestIgnore.test_get_gitignore.None_5", "embedding": null, "metadata": {"file_path": "tests/func/test_scm.py", "file_name": "test_scm.py", "file_type": "text/x-python", "category": "test", "start_line": 88, "end_line": 98, "span_ids": ["TestIgnore.test_get_gitignore"], "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 TestIgnore(object):\n\n def test_get_gitignore(self, git, repo_dir):\n data_dir = os.path.join(repo_dir._root_dir, \"file1\")\n entry, gitignore = Git(repo_dir._root_dir)._get_gitignore(data_dir)\n assert entry == \"/file1\"\n assert gitignore == os.path.join(repo_dir._root_dir, Git.GITIGNORE)\n\n data_dir = os.path.join(repo_dir._root_dir, \"dir\")\n entry, gitignore = Git(repo_dir._root_dir)._get_gitignore(data_dir)\n\n assert entry == \"/dir\"\n assert gitignore == os.path.join(repo_dir._root_dir, Git.GITIGNORE)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_TestIgnore.test_get_gitignore_subdir_TestIgnore.test_get_gitignore_subdir.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_TestIgnore.test_get_gitignore_subdir_TestIgnore.test_get_gitignore_subdir.None_5", "embedding": null, "metadata": {"file_path": "tests/func/test_scm.py", "file_name": "test_scm.py", "file_type": "text/x-python", "category": "test", "start_line": 100, "end_line": 117, "span_ids": ["TestIgnore.test_get_gitignore_subdir"], "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 TestIgnore(object):\n\n def test_get_gitignore_subdir(self, git, repo_dir):\n data_dir = os.path.join(\n repo_dir._root_dir, os.path.join(\"dir1\", \"file1\")\n )\n entry, gitignore = Git(repo_dir._root_dir)._get_gitignore(data_dir)\n assert entry == \"/file1\"\n assert gitignore == os.path.join(\n repo_dir._root_dir, \"dir1\", Git.GITIGNORE\n )\n\n data_dir = os.path.join(\n repo_dir._root_dir, os.path.join(\"dir1\", \"dir2\")\n )\n entry, gitignore = Git(repo_dir._root_dir)._get_gitignore(data_dir)\n assert entry == \"/dir2\"\n assert gitignore == os.path.join(\n repo_dir._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/func/test_scm.py_TestIgnore.test_get_gitignore_ignorefile_dir_TestIgnore.test_get_gitignore_ignorefile_dir.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_TestIgnore.test_get_gitignore_ignorefile_dir_TestIgnore.test_get_gitignore_ignorefile_dir.None_5", "embedding": null, "metadata": {"file_path": "tests/func/test_scm.py", "file_name": "test_scm.py", "file_type": "text/x-python", "category": "test", "start_line": 119, "end_line": 136, "span_ids": ["TestIgnore.test_get_gitignore_ignorefile_dir"], "tokens": 254}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestIgnore(object):\n\n def test_get_gitignore_ignorefile_dir(self, git, repo_dir):\n git = Git(repo_dir._root_dir)\n\n file_double_dir = os.path.join(\"dir1\", \"dir2\", \"file1\")\n data_dir1 = os.path.join(repo_dir._root_dir, file_double_dir)\n dir1_real1 = os.path.realpath(\"dir1\")\n entry, gitignore = git._get_gitignore(data_dir1, dir1_real1)\n assert entry == \"/dir2/file1\"\n gitignore1 = os.path.join(repo_dir._root_dir, \"dir1\", Git.GITIGNORE)\n assert gitignore == gitignore1\n\n triple_dir = os.path.join(\"dir1\", \"dir2\", \"dir3\")\n data_dir2 = os.path.join(repo_dir._root_dir, triple_dir)\n dir1_real2 = os.path.realpath(\"dir1\")\n entry, gitignore = git._get_gitignore(data_dir2, dir1_real2)\n assert entry == \"/dir2/dir3\"\n gitignore2 = os.path.join(repo_dir._root_dir, \"dir1\", Git.GITIGNORE)\n assert gitignore == gitignore2", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_TestIgnore.test_get_gitignore_ignorefile_dir_upper_level_TestIgnore.test_get_gitignore_ignorefile_dir_upper_level.with_pytest_raises_FileNo.git__get_gitignore_data_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_TestIgnore.test_get_gitignore_ignorefile_dir_upper_level_TestIgnore.test_get_gitignore_ignorefile_dir_upper_level.with_pytest_raises_FileNo.git__get_gitignore_data_d", "embedding": null, "metadata": {"file_path": "tests/func/test_scm.py", "file_name": "test_scm.py", "file_type": "text/x-python", "category": "test", "start_line": 138, "end_line": 146, "span_ids": ["TestIgnore.test_get_gitignore_ignorefile_dir_upper_level"], "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 TestIgnore(object):\n\n def test_get_gitignore_ignorefile_dir_upper_level(self, git, repo_dir):\n git = Git(repo_dir._root_dir)\n\n file_double_dir = os.path.join(\"dir1\", \"dir2\", \"file1\")\n data_dir1 = os.path.join(repo_dir._root_dir, file_double_dir)\n ignore_file_dir = os.path.realpath(os.path.join(\"aa\", \"bb\"))\n\n with pytest.raises(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/func/test_scm.py_TestIgnore.test_gitignore_should_end_with_newline_TestIgnore.test_gitignore_should_end_with_newline.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_TestIgnore.test_gitignore_should_end_with_newline_TestIgnore.test_gitignore_should_end_with_newline.None_1", "embedding": null, "metadata": {"file_path": "tests/func/test_scm.py", "file_name": "test_scm.py", "file_type": "text/x-python", "category": "test", "start_line": 148, "end_line": 167, "span_ids": ["TestIgnore.test_gitignore_should_end_with_newline"], "tokens": 156}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestIgnore(object):\n\n def test_gitignore_should_end_with_newline(self, git, repo_dir):\n git = Git(repo_dir._root_dir)\n\n foo = os.path.join(repo_dir._root_dir, repo_dir.FOO)\n bar = os.path.join(repo_dir._root_dir, repo_dir.BAR)\n gitignore = os.path.join(repo_dir._root_dir, Git.GITIGNORE)\n\n git.ignore(foo)\n\n with open(gitignore, \"r\") as fobj:\n last = fobj.readlines()[-1]\n\n assert last.endswith(\"\\n\")\n\n git.ignore(bar)\n\n with open(gitignore, \"r\") as fobj:\n last = fobj.readlines()[-1]\n\n assert last.endswith(\"\\n\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_TestIgnore.test_gitignore_should_append_newline_to_gitignore_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_scm.py_TestIgnore.test_gitignore_should_append_newline_to_gitignore_", "embedding": null, "metadata": {"file_path": "tests/func/test_scm.py", "file_name": "test_scm.py", "file_type": "text/x-python", "category": "test", "start_line": 169, "end_line": 195, "span_ids": ["TestIgnore.test_gitignore_should_append_newline_to_gitignore"], "tokens": 215}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestIgnore(object):\n\n def test_gitignore_should_append_newline_to_gitignore(self, git, repo_dir):\n git = Git(repo_dir._root_dir)\n\n foo_ignore_pattern = \"/foo\"\n bar_ignore_pattern = \"/bar\"\n bar_path = os.path.join(repo_dir._root_dir, repo_dir.BAR)\n gitignore = os.path.join(repo_dir._root_dir, Git.GITIGNORE)\n\n with open(gitignore, \"w\") as fobj:\n fobj.write(foo_ignore_pattern)\n\n with open(gitignore, \"r\") as fobj:\n last = fobj.readlines()[-1]\n assert not last.endswith(\"\\n\")\n\n git.ignore(bar_path)\n\n with open(gitignore, \"r\") as fobj:\n lines = list(fobj.readlines())\n\n assert len(lines) == 2\n for l in lines:\n assert l.endswith(\"\\n\")\n\n assert lines[0].strip() == foo_ignore_pattern\n assert lines[1].strip() == bar_ignore_pattern", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_version.py_test_info_outside_of_repo_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_version.py_test_info_outside_of_repo_", "embedding": null, "metadata": {"file_path": "tests/func/test_version.py", "file_name": "test_version.py", "file_type": "text/x-python", "category": "test", "start_line": 24, "end_line": 40, "span_ids": ["test_info_outside_of_repo"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_info_outside_of_repo(repo_dir, caplog):\n assert main([\"version\"]) == 0\n\n assert re.search(re.compile(r\"DVC version: \\d+\\.\\d+\\.\\d+\"), caplog.text)\n assert re.search(re.compile(r\"Python version: \\d\\.\\d\\.\\d\"), caplog.text)\n assert re.search(re.compile(r\"Platform: .*\"), caplog.text)\n assert re.search(re.compile(r\"Binary: (True|False)\"), caplog.text)\n assert re.search(\n re.compile(r\"Filesystem type \\(workspace\\): .*\"), caplog.text\n )\n assert not re.search(\n re.compile(r\"Filesystem type \\(cache directory\\): .*\"), caplog.text\n )\n assert not re.search(\n re.compile(r\"(Cache: (.*link - (True|False)(,\\s)?){3})\"), caplog.text\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_mock_ssh_config_test_ssh_host_override_from_config.assert_remote_path_info_h": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_mock_ssh_config_test_ssh_host_override_from_config.assert_remote_path_info_h", "embedding": null, "metadata": {"file_path": "tests/unit/remote/ssh/test_ssh.py", "file_name": "test_ssh.py", "file_type": "text/x-python", "category": "test", "start_line": 40, "end_line": 74, "span_ids": ["test_ssh_host_override_from_config", "impl"], "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": "mock_ssh_config = \"\"\"\nHost example.com\n User ubuntu\n HostName 1.2.3.4\n Port 1234\n IdentityFile ~/.ssh/not_default.key\n\"\"\"\n\nif sys.version_info.major == 3:\n builtin_module_name = \"builtins\"\nelse:\n builtin_module_name = \"__builtin__\"\n\n\n@pytest.mark.parametrize(\n \"config,expected_host\",\n [\n ({\"url\": \"ssh://example.com\"}, \"1.2.3.4\"),\n ({\"url\": \"ssh://not_in_ssh_config.com\"}, \"not_in_ssh_config.com\"),\n ],\n)\n@patch(\"os.path.exists\", return_value=True)\n@patch(\n \"{}.open\".format(builtin_module_name),\n new_callable=mock_open,\n read_data=mock_ssh_config,\n)\ndef test_ssh_host_override_from_config(\n mock_file, mock_exists, config, expected_host\n):\n remote = RemoteSSH(None, config)\n\n mock_exists.assert_called_with(RemoteSSH.ssh_config_filename())\n mock_file.assert_called_with(RemoteSSH.ssh_config_filename())\n assert remote.path_info.host == expected_host", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_test_ssh_user_test_ssh_user.assert_remote_path_info_u": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_test_ssh_user_test_ssh_user.assert_remote_path_info_u", "embedding": null, "metadata": {"file_path": "tests/unit/remote/ssh/test_ssh.py", "file_name": "test_ssh.py", "file_type": "text/x-python", "category": "test", "start_line": 77, "end_line": 102, "span_ids": ["test_ssh_user"], "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": "@pytest.mark.parametrize(\n \"config,expected_user\",\n [\n ({\"url\": \"ssh://test1@example.com\"}, \"test1\"),\n ({\"url\": \"ssh://example.com\", \"user\": \"test2\"}, \"test2\"),\n ({\"url\": \"ssh://example.com\"}, \"ubuntu\"),\n ({\"url\": \"ssh://test1@not_in_ssh_config.com\"}, \"test1\"),\n (\n {\"url\": \"ssh://test1@not_in_ssh_config.com\", \"user\": \"test2\"},\n \"test2\",\n ),\n ({\"url\": \"ssh://not_in_ssh_config.com\"}, getpass.getuser()),\n ],\n)\n@patch(\"os.path.exists\", return_value=True)\n@patch(\n \"{}.open\".format(builtin_module_name),\n new_callable=mock_open,\n read_data=mock_ssh_config,\n)\ndef test_ssh_user(mock_file, mock_exists, config, expected_user):\n remote = RemoteSSH(None, config)\n\n mock_exists.assert_called_with(RemoteSSH.ssh_config_filename())\n mock_file.assert_called_with(RemoteSSH.ssh_config_filename())\n assert remote.path_info.user == expected_user", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_test_ssh_port_test_ssh_port.assert_remote_path_info_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/remote/ssh/test_ssh.py_test_ssh_port_test_ssh_port.assert_remote_path_info_p", "embedding": null, "metadata": {"file_path": "tests/unit/remote/ssh/test_ssh.py", "file_name": "test_ssh.py", "file_type": "text/x-python", "category": "test", "start_line": 105, "end_line": 127, "span_ids": ["test_ssh_port"], "tokens": 243}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"config,expected_port\",\n [\n ({\"url\": \"ssh://example.com:2222\"}, 2222),\n ({\"url\": \"ssh://example.com\"}, 1234),\n ({\"url\": \"ssh://example.com\", \"port\": 4321}, 4321),\n ({\"url\": \"ssh://not_in_ssh_config.com\"}, RemoteSSH.DEFAULT_PORT),\n ({\"url\": \"ssh://not_in_ssh_config.com:2222\"}, 2222),\n ({\"url\": \"ssh://not_in_ssh_config.com:2222\", \"port\": 4321}, 4321),\n ],\n)\n@patch(\"os.path.exists\", return_value=True)\n@patch(\n \"{}.open\".format(builtin_module_name),\n new_callable=mock_open,\n read_data=mock_ssh_config,\n)\ndef test_ssh_port(mock_file, mock_exists, config, expected_port):\n remote = RemoteSSH(None, config)\n\n mock_exists.assert_called_with(RemoteSSH.ssh_config_filename())\n mock_file.assert_called_with(RemoteSSH.ssh_config_filename())\n assert remote.path_info.port == expected_port", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_progress.py_logging_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_progress.py_logging_", "embedding": null, "metadata": {"file_path": "tests/unit/test_progress.py", "file_name": "test_progress.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 20, "span_ids": ["TestProgressCallback.test_should_init_reset_progress", "imports", "test_quiet", "TestProgressCallback"], "tokens": 114}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import logging\nimport mock\nfrom dvc.progress import progress, ProgressCallback\n\n\ndef test_quiet(caplog, capsys):\n with caplog.at_level(logging.CRITICAL, logger=\"dvc\"):\n progress._print(\"something\")\n assert capsys.readouterr().out == \"\"\n\n\nclass TestProgressCallback:\n @mock.patch(\"dvc.progress.progress\")\n def test_should_init_reset_progress(self, progress_mock):\n total_files_num = 1\n\n ProgressCallback(total_files_num)\n\n assert [mock.call.reset()] == progress_mock.method_calls", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_stage.py_from_dvc_path_info_import_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_from_dvc_path_info_import_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": 20, "span_ids": ["imports", "TestStageChecksum.test", "TestStageChecksum"], "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 dvc.path_info import PathInfo\nfrom dvc.stage import Stage, StageUpdateError\nfrom dvc.dependency.repo import DependencyREPO\n\nimport mock\nimport pytest\nfrom unittest import TestCase\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/dvc/dependency/__init__.py_from___future___import_un_SCHEMA_schema_Optional_De": {"__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_SCHEMA_schema_Optional_De", "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": 49, "span_ids": ["imports"], "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 schema\n\nfrom dvc.scheme import Schemes\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\nfrom dvc.dependency.https import DependencyHTTPS\nfrom .repo import DependencyREPO\n\nfrom dvc.remote import Remote\n\n\nDEPS = [\n DependencyGS,\n DependencyHDFS,\n DependencyHTTP,\n DependencyHTTPS,\n DependencyS3,\n DependencySSH,\n # NOTE: DependencyLOCAL is the default choice\n]\n\nDEP_MAP = {\n Schemes.LOCAL: DependencyLOCAL,\n Schemes.SSH: DependencySSH,\n Schemes.S3: DependencyS3,\n Schemes.GS: DependencyGS,\n Schemes.HDFS: DependencyHDFS,\n Schemes.HTTP: DependencyHTTP,\n Schemes.HTTPS: DependencyHTTPS,\n}\n\n\n# NOTE: schema for dependencies is basically the same as for outputs, but\n# without output-specific entries like 'cache' (whether or not output is\n# cached, see -o and -O flags for `dvc run`) and 'metric' (whether or not\n# output is a metric file and how to parse it, see `-M` flag for `dvc run`).\nSCHEMA = output.SCHEMA.copy()\ndel SCHEMA[schema.Optional(OutputBase.PARAM_CACHE)]\ndel SCHEMA[schema.Optional(OutputBase.PARAM_METRIC)]\nSCHEMA[schema.Optional(DependencyREPO.PARAM_REPO)] = DependencyREPO.REPO_SCHEMA", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/__init__.py__get_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/__init__.py__get_", "embedding": null, "metadata": {"file_path": "dvc/dependency/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 53, "end_line": 86, "span_ids": ["loadd_from", "loads_from", "_get"], "tokens": 235}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _get(stage, p, info):\n from dvc.utils.compat import urlparse\n\n parsed = urlparse(p)\n\n if parsed.scheme == \"remote\":\n remote = Remote(stage.repo, name=parsed.netloc)\n return DEP_MAP[remote.scheme](stage, p, info, remote=remote)\n\n if info and info.get(DependencyREPO.PARAM_REPO):\n repo = info.pop(DependencyREPO.PARAM_REPO)\n return DependencyREPO(repo, stage, p, info)\n\n 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, erepo=None):\n ret = []\n for s in s_list:\n info = {DependencyREPO.PARAM_REPO: erepo} if erepo else {}\n ret.append(_get(stage, s, info))\n return ret", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_from___future___import_un_DvcIgnore.__call__.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/ignore.py_from___future___import_un_DvcIgnore.__call__.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "dvc/ignore.py", "file_name": "ignore.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 27, "span_ids": ["imports", "DvcIgnore", "DvcIgnoreFileHandler.read_patterns", "DvcIgnoreFileHandler.__init__", "DvcIgnore.__call__", "DvcIgnoreFileHandler.get_repo_root", "DvcIgnoreFileHandler"], "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": "from __future__ import unicode_literals\n\nimport os\nfrom pathspec import PathSpec\nfrom pathspec.patterns import GitWildMatchPattern\n\nfrom dvc.utils import relpath\nfrom dvc.utils.fs import get_parent_dirs_up_to\n\n\nclass DvcIgnoreFileHandler(object):\n def __init__(self, tree):\n self.tree = tree\n\n def read_patterns(self, path):\n with self.tree.open(path) as fobj:\n return PathSpec.from_lines(GitWildMatchPattern, fobj)\n\n def get_repo_root(self):\n return self.tree.tree_root\n\n\nclass DvcIgnore(object):\n DVCIGNORE_FILE = \".dvcignore\"\n\n def __call__(self, root, dirs, files):\n raise NotImplementedError", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.verify_metric_OutputBase.unprotect.if_self_exists_.self_remote_unprotect_sel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.verify_metric_OutputBase.unprotect.if_self_exists_.self_remote_unprotect_sel", "embedding": null, "metadata": {"file_path": "dvc/output/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 270, "end_line": 326, "span_ids": ["OutputBase.download", "OutputBase.checkout", "OutputBase.remove", "OutputBase.unprotect", "OutputBase.get_files_number", "OutputBase.verify_metric", "OutputBase.move"], "tokens": 351}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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, resume=False):\n self.remote.download([self.path_info], [to.path_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 self.cache.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_in_repo:\n self.repo.scm.ignore_remove(self.fspath)\n\n def move(self, out):\n if self.scheme == \"local\" and self.use_cache and self.is_in_repo:\n self.repo.scm.ignore_remove(self.fspath)\n\n self.remote.move(self.path_info, out.path_info)\n self.def_path = out.def_path\n self.path_info = out.path_info\n self.save()\n self.commit()\n\n if self.scheme == \"local\" and self.use_cache and self.is_in_repo:\n self.repo.scm.ignore(self.fspath)\n\n def get_files_number(self):\n if not self.use_cache or not self.checksum:\n return 0\n\n if self.is_dir_checksum:\n return len(self.dir_cache)\n\n return 1\n\n def unprotect(self):\n if self.exists:\n self.remote.unprotect(self.path_info)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase._collect_used_dir_cache_OutputBase._collect_used_dir_cache.return.ret": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase._collect_used_dir_cache_OutputBase._collect_used_dir_cache.return.ret", "embedding": null, "metadata": {"file_path": "dvc/output/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 328, "end_line": 387, "span_ids": ["OutputBase._collect_used_dir_cache"], "tokens": 392}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class OutputBase(object):\n\n def _collect_used_dir_cache(self, remote=None, force=False, jobs=None):\n \"\"\"Get a list of `info`s retaled to the given directory.\n\n - Pull the directory entry from the remote cache if it was changed.\n\n Example:\n\n Given the following commands:\n\n $ echo \"foo\" > directory/foo\n $ echo \"bar\" > directory/bar\n $ dvc add directory\n\n It will return something similar to the following list:\n\n [\n { 'path': 'directory/foo', 'md5': 'c157a79031e1', ... },\n { 'path': 'directory/bar', 'md5': 'd3b07384d113', ... },\n ]\n \"\"\"\n\n ret = []\n\n if self.cache.changed_cache_file(self.checksum):\n try:\n self.repo.cloud.pull(\n [\n {\n self.remote.PARAM_CHECKSUM: self.checksum,\n \"name\": str(self),\n }\n ],\n jobs=jobs,\n remote=remote,\n show_checksums=False,\n )\n except DvcException:\n logger.debug(\"failed to pull cache for '{}'\".format(self))\n\n if self.cache.changed_cache_file(self.checksum):\n msg = (\n \"Missing cache for directory '{}'. \"\n \"Cache for files inside will be lost. \"\n \"Would you like to continue? Use '-f' to force.\"\n )\n if not force and not prompt.confirm(msg.format(self.path_info)):\n raise DvcException(\n \"unable to fully collect used cache\"\n \" without cache for directory '{}'\".format(self)\n )\n else:\n return ret\n\n for entry in self.dir_cache:\n info = copy(entry)\n path_info = self.path_info / entry[self.remote.PARAM_RELPATH]\n info[\"name\"] = str(path_info)\n ret.append(info)\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_OutputBase.get_used_cache_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/output/base.py_OutputBase.get_used_cache_", "embedding": null, "metadata": {"file_path": "dvc/output/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 389, "end_line": 420, "span_ids": ["OutputBase.get_used_cache"], "tokens": 205}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class OutputBase(object):\n\n def get_used_cache(self, **kwargs):\n \"\"\"Get a dumpd of the given `out`, with an entry including the branch.\n\n The `used_cache` of an output is no more than its `info`.\n\n In case that the given output is a directory, it will also\n include the `info` of its files.\n \"\"\"\n\n if self.stage.is_repo_import:\n return []\n\n if not self.use_cache:\n return []\n\n if not self.info:\n logger.warning(\n \"Output '{}'({}) is missing version info. Cache for it will \"\n \"not be collected. Use dvc repro to get your pipeline up to \"\n \"date.\".format(self, self.stage)\n )\n return []\n\n ret = [{self.remote.PARAM_CHECKSUM: self.checksum, \"name\": str(self)}]\n\n if not self.is_dir_checksum:\n return ret\n\n ret.extend(self._collect_used_dir_cache(**kwargs))\n\n return ret", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_RemoteAZURE.remove_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/azure.py_RemoteAZURE.remove_", "embedding": null, "metadata": {"file_path": "dvc/remote/azure.py", "file_name": "azure.py", "file_type": "text/x-python", "category": "implementation", "start_line": 96, "end_line": 137, "span_ids": ["RemoteAZURE._upload", "RemoteAZURE.list_cache_paths", "RemoteAZURE.remove", "RemoteAZURE._list_paths", "RemoteAZURE._download"], "tokens": 294}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteAZURE(RemoteBASE):\n\n def remove(self, path_info):\n if path_info.scheme != self.scheme:\n raise NotImplementedError\n\n logger.debug(\"Removing {}\".format(path_info))\n self.blob_service.delete_blob(path_info.bucket, path_info.path)\n\n def _list_paths(self, bucket, prefix):\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.path_info.bucket, self.path_info.path)\n\n def _upload(\n self, from_file, to_info, name=None, no_progress_bar=False, **_kwargs\n ):\n cb = None if no_progress_bar else Callback(name)\n self.blob_service.create_blob_from_path(\n to_info.bucket, to_info.path, from_file, progress_callback=cb\n )\n\n def _download(\n self, from_info, to_file, name=None, no_progress_bar=False, **_kwargs\n ):\n cb = None if no_progress_bar else Callback(name)\n self.blob_service.get_blob_to_path(\n from_info.bucket, from_info.path, to_file, progress_callback=cb\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._save_dir_RemoteBASE.transfer_context.yield_None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._save_dir_RemoteBASE.transfer_context.yield_None", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 333, "end_line": 386, "span_ids": ["RemoteBASE._save_dir", "RemoteBASE.protect", "RemoteBASE.isdir", "RemoteBASE.is_empty", "RemoteBASE.walk", "RemoteBASE._save", "RemoteBASE.transfer_context", "RemoteBASE.isfile", "RemoteBASE.save"], "tokens": 348}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def _save_dir(self, path_info, checksum):\n cache_info = self.checksum_to_path_info(checksum)\n dir_info = self.get_dir_cache(checksum)\n\n for entry in dir_info:\n entry_info = path_info / entry[self.PARAM_RELPATH]\n entry_checksum = entry[self.PARAM_CHECKSUM]\n self._save_file(entry_info, entry_checksum, save_link=False)\n\n self.state.save_link(path_info)\n self.state.save(cache_info, checksum)\n self.state.save(path_info, checksum)\n\n def is_empty(self, path_info):\n return False\n\n def isfile(self, path_info):\n raise NotImplementedError\n\n def isdir(self, path_info):\n return False\n\n def walk(self, path_info):\n raise NotImplementedError\n\n @staticmethod\n def protect(path_info):\n pass\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 self._checkout(path_info, checksum)\n return\n\n self._save(path_info, checksum)\n\n def _save(self, path_info, checksum):\n to_info = self.checksum_to_path_info(checksum)\n logger.info(\"Saving '{}' to '{}'.\".format(path_info, to_info))\n if self.isdir(path_info):\n self._save_dir(path_info, checksum)\n return\n self._save_file(path_info, checksum)\n\n @contextmanager\n def transfer_context(self):\n yield None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.upload_RemoteBASE.upload.return.fails": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.upload_RemoteBASE.upload.return.fails", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 388, "end_line": 428, "span_ids": ["RemoteBASE.upload"], "tokens": 260}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def upload(self, from_infos, to_infos, names=None, no_progress_bar=False):\n if not hasattr(self, \"_upload\"):\n raise RemoteActionNotImplemented(\"upload\", self.scheme)\n names = self._verify_path_args(to_infos, from_infos, names)\n fails = 0\n\n with self.transfer_context() as ctx:\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 msg = \"Uploading '{}' to '{}'\"\n logger.debug(msg.format(from_info, to_info))\n\n if not name:\n name = from_info.name\n\n if not no_progress_bar:\n progress.update_target(name, 0, None)\n\n try:\n self._upload(\n from_info.fspath,\n to_info,\n name=name,\n ctx=ctx,\n no_progress_bar=no_progress_bar,\n )\n except Exception:\n fails += 1\n msg = \"failed to upload '{}' to '{}'\"\n logger.exception(msg.format(from_info, to_info))\n continue\n\n if not no_progress_bar:\n progress.finish_target(name)\n\n return fails", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.download_RemoteBASE.download.return.fails": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.download_RemoteBASE.download.return.fails", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 430, "end_line": 490, "span_ids": ["RemoteBASE.download"], "tokens": 358}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def download(\n self,\n from_infos,\n to_infos,\n names=None,\n no_progress_bar=False,\n resume=False,\n ):\n if not hasattr(self, \"_download\"):\n raise RemoteActionNotImplemented(\"download\", self.scheme)\n\n names = self._verify_path_args(from_infos, to_infos, names)\n fails = 0\n\n with self.transfer_context() as ctx:\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 != \"local\":\n self.copy(from_info, to_info, ctx=ctx)\n continue\n\n if to_info.scheme != \"local\":\n raise NotImplementedError\n\n msg = \"Downloading '{}' to '{}'\".format(from_info, to_info)\n logger.debug(msg)\n\n tmp_file = tmp_fname(to_info)\n if not name:\n name = to_info.name\n\n if not no_progress_bar:\n # real progress is not always available,\n # lets at least show start and finish\n progress.update_target(name, 0, None)\n\n makedirs(fspath_py35(to_info.parent), exist_ok=True)\n\n try:\n self._download(\n from_info,\n tmp_file,\n name=name,\n ctx=ctx,\n resume=resume,\n no_progress_bar=no_progress_bar,\n )\n except Exception:\n fails += 1\n msg = \"failed to download '{}' to '{}'\"\n logger.exception(msg.format(from_info, to_info))\n continue\n\n move(tmp_file, fspath_py35(to_info))\n\n if not no_progress_bar:\n progress.finish_target(name)\n\n return fails", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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.remove_RemoteBASE.gc.return.removed": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE.remove_RemoteBASE.gc.return.removed", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 492, "end_line": 553, "span_ids": ["RemoteBASE.copy", "RemoteBASE._verify_path_args", "RemoteBASE.list_cache_paths", "RemoteBASE.remove", "RemoteBASE.gc", "RemoteBASE.checksum_to_path_info", "RemoteBASE.move", "RemoteBASE.path_to_checksum", "RemoteBASE.all", "RemoteBASE.exists"], "tokens": 441}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def remove(self, path_info):\n raise RemoteActionNotImplemented(\"remove\", self.scheme)\n\n def move(self, from_info, to_info):\n self.copy(from_info, to_info)\n self.remove(from_info)\n\n def copy(self, from_info, to_info, ctx=None):\n raise RemoteActionNotImplemented(\"copy\", self.scheme)\n\n def exists(self, path_info):\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 def path_to_checksum(self, path):\n return \"\".join(self.path_cls(path).parts[-2:])\n\n def checksum_to_path_info(self, checksum):\n return self.path_info / checksum[0:2] / checksum[2:]\n\n def list_cache_paths(self):\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 used = self.extract_used_local_checksums(cinfos)\n\n if self.scheme != \"\":\n used |= {\n info[self.PARAM_CHECKSUM]\n for info in cinfos.get(self.scheme, [])\n }\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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/config.py_RemoteConfig.resolve_path_RemoteConfig.resolve_path.return.relpath_path_os_path_dir": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/config.py_RemoteConfig.resolve_path_RemoteConfig.resolve_path.return.relpath_path_os_path_dir", "embedding": null, "metadata": {"file_path": "dvc/remote/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 73, "end_line": 89, "span_ids": ["RemoteConfig.resolve_path"], "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 RemoteConfig(object):\n\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 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/remote/gs.py_from___future___import_un_": {"__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_", "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": 130, "span_ids": ["RemoteGS.list_cache_paths", "RemoteGS.batch_exists", "imports", "RemoteGS.compat_config", "RemoteGS._list_paths", "RemoteGS.copy", "RemoteGS.remove", "RemoteGS._upload", "RemoteGS.__init__", "RemoteGS.gs", "RemoteGS._download", "RemoteGS.get_file_checksum", "RemoteGS", "RemoteGS.exists", "RemoteGS.transfer_context"], "tokens": 882}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 logging\nimport itertools\nfrom contextlib import contextmanager\n\ntry:\n from google.cloud import storage\nexcept ImportError:\n storage = None\n\nfrom dvc.remote.base import RemoteBASE\nfrom dvc.config import Config\nfrom dvc.exceptions import DvcException\nfrom dvc.path_info import CloudURLInfo\nfrom dvc.scheme import Schemes\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass RemoteGS(RemoteBASE):\n scheme = Schemes.GS\n path_cls = CloudURLInfo\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\n storagepath = \"gs://\" + config.get(Config.SECTION_GCP_STORAGEPATH, \"/\")\n url = config.get(Config.SECTION_REMOTE_URL, storagepath)\n self.path_info = self.path_cls(url)\n\n self.projectname = config.get(Config.SECTION_GCP_PROJECTNAME, None)\n self.credentialpath = config.get(Config.SECTION_GCP_CREDENTIALPATH)\n\n @staticmethod\n def compat_config(config):\n ret = config.copy()\n url = \"gs://\" + ret.pop(Config.SECTION_GCP_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_file_checksum(self, path_info):\n import base64\n import codecs\n\n bucket = path_info.bucket\n path = path_info.path\n blob = self.gs.bucket(bucket).get_blob(path)\n if not blob:\n return None\n\n b64_md5 = blob.md5_hash\n md5 = base64.b64decode(b64_md5)\n return codecs.getencoder(\"hex\")(md5)[0].decode(\"utf-8\")\n\n def copy(self, from_info, to_info, ctx=None):\n gs = ctx or self.gs\n\n from_bucket = gs.bucket(from_info.bucket)\n blob = from_bucket.get_blob(from_info.path)\n if not blob:\n msg = \"'{}' doesn't exist in the cloud\".format(from_info.path)\n raise DvcException(msg)\n\n to_bucket = gs.bucket(to_info.bucket)\n from_bucket.copy_blob(blob, to_bucket, new_name=to_info.path)\n\n def remove(self, path_info):\n if path_info.scheme != \"gs\":\n raise NotImplementedError\n\n logger.debug(\"Removing gs://{}\".format(path_info))\n blob = self.gs.bucket(path_info.bucket).get_blob(path_info.path)\n if not blob:\n return\n\n blob.delete()\n\n def _list_paths(self, bucket, prefix, gs=None):\n gs = gs or self.gs\n\n for blob in gs.bucket(bucket).list_blobs(prefix=prefix):\n yield blob.name\n\n def list_cache_paths(self):\n return self._list_paths(self.path_info.bucket, self.path_info.path)\n\n def exists(self, path_info):\n paths = set(self._list_paths(path_info.bucket, path_info.path))\n return any(path_info.path == path for path in paths)\n\n def batch_exists(self, path_infos, callback):\n paths = []\n gs = self.gs\n\n for path_info in path_infos:\n paths.append(\n self._list_paths(path_info.bucket, path_info.path, gs)\n )\n callback.update(str(path_info))\n\n paths = set(itertools.chain.from_iterable(paths))\n\n return [path_info.path in paths for path_info in path_infos]\n\n @contextmanager\n def transfer_context(self):\n yield self.gs\n\n def _upload(self, from_file, to_info, ctx=None, **_kwargs):\n bucket = ctx.bucket(to_info.bucket)\n blob = bucket.blob(to_info.path)\n blob.upload_from_filename(from_file)\n\n def _download(self, from_info, to_file, ctx=None, **_kwargs):\n bucket = ctx.bucket(from_info.bucket)\n blob = bucket.get_blob(from_info.path)\n blob.download_to_filename(to_file)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_RemoteHDFS._group_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/hdfs.py_RemoteHDFS._group_", "embedding": null, "metadata": {"file_path": "dvc/remote/hdfs.py", "file_name": "hdfs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 61, "end_line": 141, "span_ids": ["RemoteHDFS.remove", "RemoteHDFS.rm", "RemoteHDFS.get_file_checksum", "RemoteHDFS.exists", "RemoteHDFS._upload", "RemoteHDFS.list_cache_paths", "RemoteHDFS._group", "RemoteHDFS.copy", "RemoteHDFS._download"], "tokens": 557}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteHDFS(RemoteBASE):\n\n @staticmethod\n def _group(regex, s, gname):\n match = re.match(regex, s)\n assert match is not None\n return match.group(gname)\n\n def get_file_checksum(self, path_info):\n 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, **_kwargs):\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(\"rm -f {}\".format(path_info.path), user=path_info.user)\n\n def remove(self, path_info):\n if path_info.scheme != \"hdfs\":\n raise NotImplementedError\n\n assert path_info.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\n\n def _upload(self, from_file, to_info, **_kwargs):\n self.hadoop_fs(\n \"mkdir -p {}\".format(to_info.parent.url), user=to_info.user\n )\n\n tmp_file = tmp_fname(to_info.url)\n\n self.hadoop_fs(\n \"copyFromLocal {} {}\".format(from_file, tmp_file),\n user=to_info.user,\n )\n\n self.hadoop_fs(\n \"mv {} {}\".format(tmp_file, to_info.url), user=to_info.user\n )\n\n def _download(self, from_info, to_file, **_kwargs):\n self.hadoop_fs(\n \"copyToLocal {} {}\".format(from_info.url, to_file),\n user=from_info.user,\n )\n\n def list_cache_paths(self):\n try:\n self.hadoop_fs(\"test -e {}\".format(self.path_info.url))\n except RemoteCmdError:\n return []\n\n stdout = self.hadoop_fs(\"ls -R {}\".format(self.path_info.url))\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_RemoteHTTP_RemoteHTTP.download.return.fails": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP_RemoteHTTP.download.return.fails", "embedding": null, "metadata": {"file_path": "dvc/remote/http.py", "file_name": "http.py", "file_type": "text/x-python", "category": "implementation", "start_line": 35, "end_line": 94, "span_ids": ["RemoteHTTP.download", "RemoteHTTP.__init__", "RemoteHTTP"], "tokens": 351}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteHTTP(RemoteBASE):\n scheme = Schemes.HTTP\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\n url = config.get(Config.SECTION_REMOTE_URL)\n self.path_info = self.path_cls(url) if url else None\n\n def download(\n self,\n from_infos,\n to_infos,\n names=None,\n no_progress_bar=False,\n resume=False,\n ):\n names = self._verify_path_args(to_infos, from_infos, names)\n fails = 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 != \"local\":\n raise NotImplementedError\n\n msg = \"Downloading '{}' to '{}'\".format(from_info, to_info)\n logger.debug(msg)\n\n if not name:\n name = to_info.name\n\n makedirs(fspath_py35(to_info.parent), exist_ok=True)\n\n total = self._content_length(from_info.url)\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.url, to_info.fspath, callback=cb, resume=resume\n )\n\n except Exception:\n fails += 1\n msg = \"failed to download '{}'\".format(from_info)\n logger.exception(msg)\n continue\n\n if not no_progress_bar:\n progress.finish_target(name)\n\n return fails", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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/__init__.py_RemoteLOCAL.already_cached_RemoteLOCAL._download.copyfile_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_RemoteLOCAL.already_cached_RemoteLOCAL._download.copyfile_", "embedding": null, "metadata": {"file_path": "dvc/remote/local/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 197, "end_line": 277, "span_ids": ["RemoteLOCAL._upload", "RemoteLOCAL.cache_exists", "RemoteLOCAL.move", "RemoteLOCAL._download", "RemoteLOCAL.walk", "RemoteLOCAL.isdir", "RemoteLOCAL.isfile", "RemoteLOCAL.get_file_checksum", "RemoteLOCAL.already_cached", "RemoteLOCAL.is_empty", "RemoteLOCAL.remove"], "tokens": 540}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteLOCAL(RemoteBASE):\n\n def already_cached(self, path_info):\n assert path_info.scheme in [\"\", \"local\"]\n\n current_md5 = self.get_checksum(path_info)\n\n if not current_md5:\n return False\n\n return not self.changed_cache(current_md5)\n\n def is_empty(self, path_info):\n path = path_info.fspath\n\n if self.isfile(path_info) and os.path.getsize(path) == 0:\n return True\n\n if self.isdir(path_info) and len(os.listdir(path)) == 0:\n return True\n\n return False\n\n def isfile(self, path_info):\n return os.path.isfile(fspath_py35(path_info))\n\n def isdir(self, path_info):\n return os.path.isdir(fspath_py35(path_info))\n\n def walk(self, path_info):\n return os.walk(fspath_py35(path_info))\n\n def get_file_checksum(self, path_info):\n return file_md5(fspath_py35(path_info))[0]\n\n def remove(self, path_info):\n if path_info.scheme != \"local\":\n raise NotImplementedError\n\n if self.exists(path_info):\n remove(path_info.fspath)\n\n def move(self, from_info, to_info):\n if from_info.scheme != \"local\" or to_info.scheme != \"local\":\n raise NotImplementedError\n\n inp = from_info.fspath\n outp = to_info.fspath\n\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()))\n move(inp, tmp)\n move(tmp, outp)\n\n def cache_exists(self, md5s):\n return [\n checksum\n for checksum in progress(md5s)\n if not self.changed_cache_file(checksum)\n ]\n\n def _upload(\n self, from_file, to_info, name=None, no_progress_bar=False, **_kwargs\n ):\n makedirs(fspath_py35(to_info.parent), exist_ok=True)\n\n tmp_file = tmp_fname(to_info)\n copyfile(\n from_file, tmp_file, name=name, no_progress_bar=no_progress_bar\n )\n os.rename(tmp_file, fspath_py35(to_info))\n\n def _download(\n self, from_info, to_file, name=None, no_progress_bar=False, **_kwargs\n ):\n copyfile(\n fspath_py35(from_info),\n to_file,\n no_progress_bar=no_progress_bar,\n name=name,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_RemoteLOCAL._fill_statuses_RemoteLOCAL._get_chunks.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_RemoteLOCAL._fill_statuses_RemoteLOCAL._get_chunks.return._", "embedding": null, "metadata": {"file_path": "dvc/remote/local/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 334, "end_line": 366, "span_ids": ["RemoteLOCAL._fill_statuses", "RemoteLOCAL._get_chunks"], "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 RemoteLOCAL(RemoteBASE):\n\n def _fill_statuses(self, checksum_info_dir, local_exists, remote_exists):\n # Using sets because they are way faster for lookups\n local = set(local_exists)\n remote = set(remote_exists)\n\n for md5, info in checksum_info_dir.items():\n status = STATUS_MAP[(md5 in local, md5 in remote)]\n info[\"status\"] = status\n\n def _get_chunks(self, download, remote, status_info, status, jobs):\n cache = []\n path_infos = []\n names = []\n for md5, info in progress(\n status_info.items(), name=\"Analysing status\"\n ):\n if info[\"status\"] == status:\n cache.append(self.checksum_to_path_info(md5))\n path_infos.append(remote.checksum_to_path_info(md5))\n names.append(info[\"name\"])\n\n if download:\n to_infos = cache\n from_infos = path_infos\n else:\n to_infos = path_infos\n from_infos = cache\n\n return (\n to_chunks(from_infos, num_chunks=jobs),\n to_chunks(to_infos, num_chunks=jobs),\n to_chunks(names, num_chunks=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/remote/local/__init__.py_RemoteLOCAL._process_RemoteLOCAL._process.return.len_chunks_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/local/__init__.py_RemoteLOCAL._process_RemoteLOCAL._process.return.len_chunks_0_", "embedding": null, "metadata": {"file_path": "dvc/remote/local/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 368, "end_line": 418, "span_ids": ["RemoteLOCAL._process"], "tokens": 280}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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 logger.info(\n \"Preparing to {} '{}'\".format(\n \"download data from\" if download else \"upload data to\",\n remote.path_info,\n )\n )\n\n if download:\n func = 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,\n remote,\n jobs=jobs,\n show_checksums=show_checksums,\n download=download,\n )\n\n chunks = self._get_chunks(download, remote, status_info, status, jobs)\n\n if len(chunks[0]) == 0:\n return 0\n\n if jobs > 1:\n with ThreadPoolExecutor(max_workers=jobs) as executor:\n fails = sum(executor.map(func, *chunks))\n else:\n fails = sum(map(func, *chunks))\n\n if fails:\n msg = \"{} file(s) failed to {}\"\n raise DvcException(\n msg.format(fails, \"download\" if download else \"upload\")\n )\n\n return len(chunks[0])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/oss.py_from___future___import_ab_RemoteOSS.__init__.self._bucket.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/oss.py_from___future___import_ab_RemoteOSS.__init__.self._bucket.None", "embedding": null, "metadata": {"file_path": "dvc/remote/oss.py", "file_name": "oss.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 70, "span_ids": ["imports", "RemoteOSS", "RemoteOSS.__init__"], "tokens": 433}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import absolute_import\nfrom __future__ import unicode_literals\n\nimport os\nimport logging\n\nfrom dvc.scheme import Schemes\n\ntry:\n import oss2\nexcept ImportError:\n oss2 = None\n\nfrom dvc.config import Config\nfrom dvc.remote.base import RemoteBASE\nfrom dvc.remote.azure import Callback\nfrom dvc.path_info import CloudURLInfo\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass RemoteOSS(RemoteBASE):\n \"\"\"\n oss2 document:\n https://www.alibabacloud.com/help/doc-detail/32026.htm\n\n\n Examples\n ----------\n $ dvc remote add myremote oss://my-bucket/path\n Set key id, key secret and endpoint using modify command\n $ dvc remote modify myremote oss_key_id my-key-id\n $ dvc remote modify myremote oss_key_secret my-key-secret\n $ dvc remote modify myremote oss_endpoint endpoint\n or environment variables\n $ export OSS_ACCESS_KEY_ID=\"my-key-id\"\n $ export OSS_ACCESS_KEY_SECRET=\"my-key-secret\"\n $ export OSS_ENDPOINT=\"endpoint\"\n \"\"\"\n\n scheme = Schemes.OSS\n path_cls = CloudURLInfo\n REQUIRES = {\"oss2\": oss2}\n PARAM_CHECKSUM = \"etag\"\n COPY_POLL_SECONDS = 5\n\n def __init__(self, repo, config):\n super(RemoteOSS, self).__init__(repo, config)\n\n url = config.get(Config.SECTION_REMOTE_URL)\n self.path_info = self.path_cls(url) if url else None\n\n self.endpoint = config.get(Config.SECTION_OSS_ENDPOINT) or os.getenv(\n \"OSS_ENDPOINT\"\n )\n\n self.key_id = (\n config.get(Config.SECTION_OSS_ACCESS_KEY_ID)\n or os.getenv(\"OSS_ACCESS_KEY_ID\")\n or \"defaultId\"\n )\n\n self.key_secret = (\n config.get(Config.SECTION_OSS_ACCESS_KEY_SECRET)\n or os.getenv(\"OSS_ACCESS_KEY_SECRET\")\n or \"defaultSecret\"\n )\n\n self._bucket = None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/oss.py_RemoteOSS.oss_service_RemoteOSS.oss_service.return.self__bucket": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/oss.py_RemoteOSS.oss_service_RemoteOSS.oss_service.return.self__bucket", "embedding": null, "metadata": {"file_path": "dvc/remote/oss.py", "file_name": "oss.py", "file_type": "text/x-python", "category": "implementation", "start_line": 72, "end_line": 91, "span_ids": ["RemoteOSS.oss_service"], "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 RemoteOSS(RemoteBASE):\n\n @property\n def oss_service(self):\n if self._bucket is None:\n logger.debug(\"URL {}\".format(self.path_info))\n logger.debug(\"key id {}\".format(self.key_id))\n logger.debug(\"key secret {}\".format(self.key_secret))\n auth = oss2.Auth(self.key_id, self.key_secret)\n self._bucket = oss2.Bucket(\n auth, self.endpoint, self.path_info.bucket\n )\n try: # verify that bucket exists\n self._bucket.get_bucket_info()\n except oss2.exceptions.NoSuchBucket:\n self._bucket.create_bucket(\n oss2.BUCKET_ACL_PUBLIC_READ,\n oss2.models.BucketCreateConfig(\n oss2.BUCKET_STORAGE_CLASS_STANDARD\n ),\n )\n return self._bucket", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/oss.py_RemoteOSS.remove_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/oss.py_RemoteOSS.remove_", "embedding": null, "metadata": {"file_path": "dvc/remote/oss.py", "file_name": "oss.py", "file_type": "text/x-python", "category": "implementation", "start_line": 93, "end_line": 122, "span_ids": ["RemoteOSS._list_paths", "RemoteOSS.list_cache_paths", "RemoteOSS.remove", "RemoteOSS._download", "RemoteOSS._upload"], "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 RemoteOSS(RemoteBASE):\n\n def remove(self, path_info):\n if path_info.scheme != self.scheme:\n raise NotImplementedError\n\n logger.debug(\"Removing oss://{}\".format(path_info))\n self.oss_service.delete_object(path_info.path)\n\n def _list_paths(self, prefix):\n for blob in oss2.ObjectIterator(self.oss_service, prefix=prefix):\n yield blob.key\n\n def list_cache_paths(self):\n return self._list_paths(self.path_info.path)\n\n def _upload(\n self, from_file, to_info, name=None, no_progress_bar=False, **_kwargs\n ):\n cb = None if no_progress_bar else Callback(name)\n self.oss_service.put_object_from_file(\n to_info.path, from_file, progress_callback=cb\n )\n\n def _download(\n self, from_info, to_file, name=None, no_progress_bar=False, **_kwargs\n ):\n cb = None if no_progress_bar else Callback(name)\n self.oss_service.get_object_to_file(\n from_info.path, to_file, progress_callback=cb\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_cache_paths_RemoteS3._upload.ctx_upload_file_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_RemoteS3.list_cache_paths_RemoteS3._upload.ctx_upload_file_", "embedding": null, "metadata": {"file_path": "dvc/remote/s3.py", "file_name": "s3.py", "file_type": "text/x-python", "category": "implementation", "start_line": 224, "end_line": 259, "span_ids": ["RemoteS3.transfer_context", "RemoteS3._upload", "RemoteS3.batch_exists", "RemoteS3.list_cache_paths", "RemoteS3.exists"], "tokens": 256}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteS3(RemoteBASE):\n\n def list_cache_paths(self):\n return self._list_paths(self.path_info.bucket, self.path_info.path)\n\n def exists(self, path_info):\n paths = self._list_paths(path_info.bucket, path_info.path)\n return any(path_info.path == path for path in paths)\n\n def batch_exists(self, path_infos, callback):\n paths = []\n s3 = self.s3\n\n for path_info in path_infos:\n paths.append(\n self._list_paths(path_info.bucket, path_info.path, s3)\n )\n callback.update(str(path_info))\n\n paths = set(itertools.chain.from_iterable(paths))\n return [path_info.path in paths for path_info in path_infos]\n\n @contextmanager\n def transfer_context(self):\n yield self.s3\n\n def _upload(\n self, from_file, to_info, name=None, ctx=None, no_progress_bar=False\n ):\n total = os.path.getsize(from_file)\n cb = None if no_progress_bar else Callback(name, total)\n ctx.upload_file(\n from_file,\n to_info.bucket,\n to_info.path,\n Callback=cb,\n ExtraArgs=self.extra_args,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/s3.py_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": 261, "end_line": 283, "span_ids": ["RemoteS3._download"], "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 RemoteS3(RemoteBASE):\n\n def _download(\n self,\n from_info,\n to_file,\n name=None,\n ctx=None,\n no_progress_bar=False,\n resume=False,\n ):\n s3 = ctx\n\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, from_info.path, to_file, Callback=cb\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.walk_files_SSHConnection.upload.self__sftp_rename_tmp_fil": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.walk_files_SSHConnection.upload.self__sftp_rename_tmp_fil", "embedding": null, "metadata": {"file_path": "dvc/remote/ssh/connection.py", "file_name": "connection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 163, "end_line": 227, "span_ids": ["SSHConnection.download", "SSHConnection.walk_files", "SSHConnection.upload", "SSHConnection._remove_dir", "SSHConnection.move", "SSHConnection._remove_file", "SSHConnection.remove"], "tokens": 435}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SSHConnection:\n\n def walk_files(self, directory):\n for root, dirs, files in self.walk(directory):\n for fname in files:\n yield posixpath.join(root, fname)\n\n def _remove_file(self, path):\n with ignore_file_not_found():\n self._sftp.remove(path)\n\n def _remove_dir(self, path):\n for root, dirs, files in self.walk(path, topdown=False):\n for fname in files:\n path = posixpath.join(root, fname)\n with ignore_file_not_found():\n self._remove_file(path)\n\n for dname in dirs:\n path = posixpath.join(root, dname)\n with ignore_file_not_found():\n self._sftp.rmdir(dname)\n\n with ignore_file_not_found():\n self._sftp.rmdir(path)\n\n def remove(self, path):\n self._sftp_connect()\n\n if self.isdir(path):\n self._remove_dir(path)\n else:\n self._remove_file(path)\n\n def download(self, src, dest, no_progress_bar=False, progress_title=None):\n self._sftp_connect()\n\n if no_progress_bar:\n self._sftp.get(src, dest)\n else:\n if not progress_title:\n progress_title = os.path.basename(src)\n\n self._sftp.get(src, dest, callback=create_cb(progress_title))\n progress.finish_target(progress_title)\n\n def move(self, src, dst):\n self.makedirs(posixpath.dirname(dst))\n self._sftp_connect()\n self._sftp.rename(src, dst)\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/scm/git/tree.py_GitTree.exists_GitTree._is_tree_and_contains.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_GitTree.exists_GitTree._is_tree_and_contains.return.False", "embedding": null, "metadata": {"file_path": "dvc/scm/git/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 54, "end_line": 79, "span_ids": ["GitTree.isfile", "GitTree._is_tree_and_contains", "GitTree.exists", "GitTree.isdir"], "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 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", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_GitTree.git_object_by_path_GitTree.git_object_by_path.return.tree": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/scm/git/tree.py_GitTree.git_object_by_path_GitTree.git_object_by_path.return.tree", "embedding": null, "metadata": {"file_path": "dvc/scm/git/tree.py", "file_name": "tree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 81, "end_line": 104, "span_ids": ["GitTree.git_object_by_path"], "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 GitTree(BaseTree):\n\n def git_object_by_path(self, path):\n import git\n\n path = relpath(os.path.realpath(path), self.git.working_dir)\n assert path.split(os.sep, 1)[0] != \"..\"\n\n try:\n tree = self.git.tree(self.rev)\n except git.exc.BadName as exc:\n raise DvcException(\n \"revision '{}' not found in git '{}'\".format(\n self.rev, os.path.relpath(self.git.working_dir)\n ),\n cause=exc,\n )\n\n if not path or path == \".\":\n return tree\n for i in path.split(os.sep):\n if not self._is_tree_and_contains(tree, i):\n # there is no tree for specified path\n return None\n tree = tree[i]\n return tree", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_from___future___import_un_MissingDep.__init__.super_MissingDep_self__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_from___future___import_un_MissingDep.__init__.super_MissingDep_self__", "embedding": null, "metadata": {"file_path": "dvc/stage.py", "file_name": "stage.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 115, "span_ids": ["StagePathOutsideError", "StagePathNotFoundError", "StagePathNotDirectoryError.__init__", "StageFileDoesNotExistError.__init__", "MissingDep.__init__", "StageFileAlreadyExistsError", "StagePathNotDirectoryError", "StageFileIsNotDvcFileError", "StagePathOutsideError.__init__", "imports", "StageFileFormatError.__init__", "StageFileDoesNotExistError", "StageCommitError", "StageFileBadNameError", "StageFileFormatError", "StagePathNotFoundError.__init__", "StageCmdFailedError", "StageFileAlreadyExistsError.__init__", "StageUpdateError.__init__", "StageCmdFailedError.__init__", "StageFileIsNotDvcFileError.__init__", "StageUpdateError", "MissingDep", "StageFileBadNameError.__init__"], "tokens": 798}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 copy\nimport re\nimport os\nimport subprocess\nimport logging\nimport signal\nimport threading\n\nfrom dvc.utils import relpath\nfrom dvc.utils.compat import pathlib\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.dependency as dependency\nimport dvc.output as output\nfrom dvc.exceptions import DvcException\nfrom dvc.utils import dict_md5, fix_env\nfrom dvc.utils.collections import apply_diff\nfrom dvc.utils.stage import load_stage_fd, dump_stage_file\n\n\nlogger = logging.getLogger(__name__)\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 = \"DVC-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 StageUpdateError(DvcException):\n def __init__(self, path):\n super(StageUpdateError, self).__init__(\n \"update is not supported for '{}' that is not an \"\n \"import.\".format(path)\n )\n\n\nclass MissingDep(DvcException):\n def __init__(self, deps):\n assert len(deps) > 0\n\n 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)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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": 142, "end_line": 159, "span_ids": ["System._getdirinfo"], "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 _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 from win32file import (\n FILE_FLAG_BACKUP_SEMANTICS,\n FILE_FLAG_OPEN_REPARSE_POINT,\n FILE_SHARE_READ,\n OPEN_EXISTING,\n )\n\n # NOTE: use FILE_FLAG_OPEN_REPARSE_POINT to open symlink itself and not\n # the target See https://docs.microsoft.com/en-us/windows/desktop/api/\n # fileapi/nf-fileapi-createfilew#symbolic-link-behavior\n\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": 161, "end_line": 173, "span_ids": ["System._getdirinfo"], "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 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": 175, "end_line": 211, "span_ids": ["System._getdirinfo"], "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 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/utils/compat.py_try__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/compat.py_try__", "embedding": null, "metadata": {"file_path": "dvc/utils/compat.py", "file_name": "compat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 171, "end_line": 210, "span_ids": ["impl:9"], "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": "try:\n from os import fspath # noqa: F821\n\n fspath_py35 = lambda s: s # noqa: E731\nexcept ImportError:\n\n def fspath(path):\n \"\"\"Return the path representation of a path-like object.\n\n If str or bytes is passed in, it is returned unchanged. Otherwise the\n os.PathLike interface is used to get the path representation. If the\n path representation is not str or bytes, TypeError is raised. If the\n provided path is not str, bytes, or os.PathLike, TypeError is raised.\n \"\"\"\n if isinstance(path, (str, bytes)):\n return path\n\n # Work from the object's type to match method resolution of other magic\n # methods.\n path_type = type(path)\n try:\n path_repr = path_type.__fspath__(path)\n except AttributeError:\n if hasattr(path_type, \"__fspath__\"):\n raise\n else:\n raise TypeError(\n \"expected str, bytes or os.PathLike object, \"\n \"not \" + path_type.__name__\n )\n if isinstance(path_repr, (str, bytes)):\n return path_repr\n else:\n raise TypeError(\n \"expected {}.__fspath__() to return str or bytes, \"\n \"not {}\".format(path_type.__name__, type(path_repr).__name__)\n )\n\n fspath_py35 = fspath", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/conftest.py_temporary_windows_drive_temporary_windows_drive.if_tear_down_result_0_.raise_RuntimeError_Could": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/conftest.py_temporary_windows_drive_temporary_windows_drive.if_tear_down_result_0_.raise_RuntimeError_Could", "embedding": null, "metadata": {"file_path": "tests/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 105, "end_line": 137, "span_ids": ["temporary_windows_drive"], "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": "@pytest.fixture\ndef temporary_windows_drive(repo_dir):\n import string\n import win32api\n from ctypes import windll\n from win32con import DDD_REMOVE_DEFINITION\n\n drives = [\n s[0].upper()\n for s in win32api.GetLogicalDriveStrings().split(\"\\000\")\n if len(s) > 0\n ]\n\n new_drive_name = [\n letter for letter in string.ascii_uppercase if letter not in drives\n ][0]\n new_drive = \"{}:\".format(new_drive_name)\n\n target_path = repo_dir.mkdtemp()\n\n set_up_result = windll.kernel32.DefineDosDeviceW(0, new_drive, target_path)\n if set_up_result == 0:\n raise RuntimeError(\"Failed to mount windows drive!\")\n\n # NOTE: new_drive has form of `A:` and joining it with some relative\n # path might result in non-existing path (A:path\\\\to)\n yield os.path.join(new_drive, os.sep)\n\n tear_down_result = windll.kernel32.DefineDosDeviceW(\n DDD_REMOVE_DEFINITION, new_drive, target_path\n )\n if tear_down_result == 0:\n raise RuntimeError(\"Could not unmount windows drive!\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_TestDiffRepo_TestDiffCmdMessage.test.self_assertEqual_test_msg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_diff.py_TestDiffRepo_TestDiffCmdMessage.test.self_assertEqual_test_msg", "embedding": null, "metadata": {"file_path": "tests/func/test_diff.py", "file_name": "test_diff.py", "file_type": "text/x-python", "category": "test", "start_line": 59, "end_line": 88, "span_ids": ["TestDiffCmdMessage", "TestDiffRepo.test", "TestDiffCmdLine.test", "TestDiffCmdMessage.test", "TestDiffCmdLine", "TestDiffRepo"], "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 TestDiffRepo(TestDiff):\n def test(self):\n result = self.dvc.diff(self.a_ref, target=self.new_file)\n self.assertEqual(self.test_dct, result)\n\n\nclass TestDiffCmdLine(TestDiff):\n def test(self):\n ret = main([\"diff\", \"-t\", self.new_file, self.a_ref])\n self.assertEqual(ret, 0)\n\n\nclass TestDiffCmdMessage(TestDiff):\n maxDiff = None\n\n def test(self):\n msg = CmdDiff._show(self.test_dct)\n test_msg = (\n \"dvc diff from {0} to {1}\\n\\n\"\n \"diff for '{2}'\\n\"\n \"+{2} with md5 {3}\\n\\n\"\n \"added file with size 13 Bytes\"\n )\n test_msg = test_msg.format(\n self.test_dct[diff.DIFF_A_REF],\n self.test_dct[diff.DIFF_B_REF],\n self.test_dct[diff.DIFF_LIST][0][diff.DIFF_TARGET],\n self.test_dct[diff.DIFF_LIST][0][diff.DIFF_NEW_CHECKSUM],\n )\n self.assertEqual(test_msg, 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/tests/func/test_remote.py_test_dir_checksum_should_be_key_order_agnostic_test_dir_checksum_should_be_key_order_agnostic.assert_checksum1_check": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_dir_checksum_should_be_key_order_agnostic_test_dir_checksum_should_be_key_order_agnostic.assert_checksum1_check", "embedding": null, "metadata": {"file_path": "tests/func/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 176, "end_line": 210, "span_ids": ["test_dir_checksum_should_be_key_order_agnostic"], "tokens": 259}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_dir_checksum_should_be_key_order_agnostic(dvc_repo):\n data_dir = os.path.join(dvc_repo.root_dir, \"data\")\n file1 = os.path.join(data_dir, \"1\")\n file2 = os.path.join(data_dir, \"2\")\n\n os.mkdir(data_dir)\n with open(file1, \"w\") as fobj:\n fobj.write(\"1\")\n\n with open(file2, \"w\") as fobj:\n fobj.write(\"2\")\n\n path_info = PathInfo(data_dir)\n with dvc_repo.state:\n with patch.object(\n RemoteBASE,\n \"_collect_dir\",\n return_value=[\n {\"relpath\": \"1\", \"md5\": \"1\"},\n {\"relpath\": \"2\", \"md5\": \"2\"},\n ],\n ):\n checksum1 = dvc_repo.cache.local.get_dir_checksum(path_info)\n\n with patch.object(\n RemoteBASE,\n \"_collect_dir\",\n return_value=[\n {\"md5\": \"1\", \"relpath\": \"1\"},\n {\"md5\": \"2\", \"relpath\": \"2\"},\n ],\n ):\n checksum2 = dvc_repo.cache.local.get_dir_checksum(path_info)\n\n assert checksum1 == checksum2", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_partial_push_n_pull_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_remote.py_test_partial_push_n_pull_", "embedding": null, "metadata": {"file_path": "tests/func/test_remote.py", "file_name": "test_remote.py", "file_type": "text/x-python", "category": "test", "start_line": 213, "end_line": 249, "span_ids": ["get_last_exc", "test_partial_push_n_pull"], "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": "def test_partial_push_n_pull(dvc_repo, repo_dir, caplog):\n assert main([\"remote\", \"add\", \"-d\", \"upstream\", get_local_url()]) == 0\n # Recreate the repo to reread config\n repo = dvc_repo.__class__(dvc_repo.root_dir)\n remote = repo.cloud.get_remote(\"upstream\")\n\n foo = repo.add(repo_dir.FOO)[0].outs[0]\n bar = repo.add(repo_dir.BAR)[0].outs[0]\n\n # Faulty upload version, failing on foo\n original = RemoteLOCAL._upload\n\n def unreliable_upload(self, from_file, to_info, name=None, **kwargs):\n if name == \"foo\":\n raise Exception(\"stop foo\")\n return original(self, from_file, to_info, name, **kwargs)\n\n with patch.object(RemoteLOCAL, \"_upload\", unreliable_upload):\n assert main([\"push\"]) == 1\n assert str(get_last_exc(caplog)) == \"1 file(s) failed to upload\"\n\n assert not remote.exists(remote.checksum_to_path_info(foo.checksum))\n assert remote.exists(remote.checksum_to_path_info(bar.checksum))\n\n # Push everything and delete local cache\n assert main([\"push\"]) == 0\n shutil.rmtree(repo.cache.local.cache_dir)\n\n with patch.object(RemoteLOCAL, \"_download\", side_effect=Exception):\n assert main([\"pull\"]) == 1\n assert str(get_last_exc(caplog)) == \"2 file(s) failed to download\"\n\n\ndef get_last_exc(caplog):\n _, exc, _ = caplog.records[-1].exc_info\n return 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/tests/func/test_updater.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_updater.py_os_", "embedding": null, "metadata": {"file_path": "tests/func/test_updater.py", "file_name": "test_updater.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 52, "span_ids": ["test_check_version_newer", "test_updater", "imports", "test_check_version_outdated", "updater", "test_check_version_equal"], "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 os\nimport mock\nimport pytest\n\nfrom dvc.updater import Updater\n\n\n@pytest.fixture\ndef updater(dvc_repo):\n return Updater(dvc_repo.dvc_dir)\n\n\ndef test_updater(updater):\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 env.get(\"CI\"):\n del env[\"CI\"]\n\n with mock.patch.dict(os.environ, env):\n updater.check()\n updater.check()\n updater.check()\n\n\ndef test_check_version_newer(updater):\n updater.latest = \"0.20.8\"\n updater.current = \"0.21.0\"\n\n assert not updater._is_outdated()\n\n\ndef test_check_version_equal(updater):\n updater.latest = \"0.20.8\"\n updater.current = \"0.20.8\"\n\n assert not updater._is_outdated()\n\n\ndef test_check_version_outdated(updater):\n updater.latest = \"0.21.0\"\n updater.current = \"0.20.8\"\n\n assert 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/func/test_version.py_re_test_info_in_repo.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_version.py_re_test_info_in_repo.None_7", "embedding": null, "metadata": {"file_path": "tests/func/test_version.py", "file_name": "test_version.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 21, "span_ids": ["imports", "test_info_in_repo"], "tokens": 202}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import re\n\nfrom dvc.main import main\n\n\ndef test_info_in_repo(dvc_repo, caplog):\n assert main([\"version\"]) == 0\n\n assert re.search(re.compile(r\"DVC version: \\d+\\.\\d+\\.\\d+\"), caplog.text)\n assert re.search(re.compile(r\"Python version: \\d\\.\\d\\.\\d\"), caplog.text)\n assert re.search(re.compile(r\"Platform: .*\"), caplog.text)\n assert re.search(re.compile(r\"Binary: (True|False)\"), caplog.text)\n assert re.search(\n re.compile(r\"Filesystem type \\(cache directory\\): .*\"), caplog.text\n )\n assert re.search(\n re.compile(r\"Filesystem type \\(workspace\\): .*\"), caplog.text\n )\n assert re.search(\n re.compile(r\"(Cache: (.*link - (True|False)(,\\s)?){3})\"), caplog.text\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_updater.py_test_fetch_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_updater.py_test_fetch_", "embedding": null, "metadata": {"file_path": "tests/unit/test_updater.py", "file_name": "test_updater.py", "file_type": "text/x-python", "category": "test", "start_line": 29, "end_line": 41, "span_ids": ["test_fetch"], "tokens": 121}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_fetch(dvc_repo, mocker):\n updater = Updater(dvc_repo.dvc_dir)\n assert not os.path.exists(updater.updater_file)\n\n mock_get = mocker.patch(\"requests.get\", side_effect=mocked_requests_get)\n updater.fetch(detach=False)\n mock_get.assert_called_once_with(Updater.URL, timeout=Updater.TIMEOUT_GET)\n\n assert os.path.isfile(updater.updater_file)\n with open(updater.updater_file, \"r\") as fobj:\n info = json.load(fobj)\n assert info[\"version\"] == __version__", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/api.py_from_contextlib_import_co_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/api.py_from_contextlib_import_co_", "embedding": null, "metadata": {"file_path": "dvc/api.py", "file_name": "api.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 72, "span_ids": ["_OpenContextManager", "read", "imports", "_open", "_make_repo", "_OpenContextManager.__getattr__", "open", "get_url", "_OpenContextManager.__init__"], "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": "from contextlib import contextmanager\nimport os\n\ntry:\n from contextlib import _GeneratorContextManager as GCM\nexcept ImportError:\n from contextlib import GeneratorContextManager as GCM\n\nfrom dvc.utils.compat import urlparse\nfrom dvc.repo import Repo\nfrom dvc.external_repo import external_repo\n\n\ndef get_url(path, repo=None, rev=None, remote=None):\n \"\"\"Returns an url of a resource specified by path in repo\"\"\"\n with _make_repo(repo, rev=rev) as _repo:\n abspath = os.path.join(_repo.root_dir, path)\n out, = _repo.find_outs_by_path(abspath)\n remote_obj = _repo.cloud.get_remote(remote)\n return str(remote_obj.checksum_to_path_info(out.checksum))\n\n\ndef open(path, repo=None, rev=None, remote=None, mode=\"r\", encoding=None):\n \"\"\"Opens a specified resource as a file descriptor\"\"\"\n args = (path,)\n kwargs = {\n \"repo\": repo,\n \"remote\": remote,\n \"rev\": rev,\n \"mode\": mode,\n \"encoding\": encoding,\n }\n return _OpenContextManager(_open, args, kwargs)\n\n\nclass _OpenContextManager(GCM):\n def __init__(self, func, args, kwds):\n self.gen = func(*args, **kwds)\n self.func, self.args, self.kwds = func, args, kwds\n\n def __getattr__(self, name):\n raise AttributeError(\n \"dvc.api.open() should be used in a with statement\"\n )\n\n\ndef _open(path, repo=None, rev=None, remote=None, mode=\"r\", encoding=None):\n with _make_repo(repo, rev=rev) as _repo:\n abspath = os.path.join(_repo.root_dir, path)\n with _repo.open(\n abspath, remote=remote, mode=mode, encoding=encoding\n ) as fd:\n yield fd\n\n\ndef read(path, repo=None, rev=None, remote=None, mode=\"r\", encoding=None):\n \"\"\"Read a specified resource into string\"\"\"\n with open(\n path, repo=repo, rev=rev, remote=remote, mode=mode, encoding=encoding\n ) as fd:\n return fd.read()\n\n\n@contextmanager\ndef _make_repo(repo_url, rev=None):\n if not repo_url or urlparse(repo_url).scheme == \"\":\n assert rev is None, \"Custom revision is not supported for local repo\"\n yield Repo(repo_url)\n else:\n with external_repo(url=repo_url, rev=rev) as repo:\n yield repo", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/get.py_from___future___import_un_CmdGet.run.try_.except_DvcException_.return.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/get.py_from___future___import_un_CmdGet.run.try_.except_DvcException_.return.1", "embedding": null, "metadata": {"file_path": "dvc/command/get.py", "file_name": "get.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 30, "span_ids": ["imports", "CmdGet", "CmdGet.run"], "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\nimport argparse\nimport logging\n\nfrom dvc.repo import Repo\nfrom dvc.exceptions import DvcException\nfrom .base import CmdBaseNoRepo, append_doc_link\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdGet(CmdBaseNoRepo):\n def run(self):\n try:\n Repo.get(\n self.args.url,\n path=self.args.path,\n out=self.args.out,\n rev=self.args.rev,\n )\n return 0\n except DvcException:\n logger.exception(\n \"failed to get '{}' from '{}'\".format(\n self.args.path, self.args.url\n )\n )\n return 1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/get.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/get.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/get.py", "file_name": "get.py", "file_type": "text/x-python", "category": "implementation", "start_line": 33, "end_line": 53, "span_ids": ["add_parser"], "tokens": 172}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n GET_HELP = \"Download data from DVC repository.\"\n get_parser = subparsers.add_parser(\n \"get\",\n parents=[parent_parser],\n description=append_doc_link(GET_HELP, \"get\"),\n help=GET_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n get_parser.add_argument(\n \"url\", help=\"DVC repository URL to download data from.\"\n )\n get_parser.add_argument(\"path\", help=\"Path to data within DVC repository.\")\n get_parser.add_argument(\n \"-o\", \"--out\", nargs=\"?\", help=\"Destination path to put data to.\"\n )\n get_parser.add_argument(\n \"--rev\", nargs=\"?\", help=\"DVC repository git revision.\"\n )\n get_parser.set_defaults(func=CmdGet)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/get_url.py_from___future___import_un_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/get_url.py_from___future___import_un_", "embedding": null, "metadata": {"file_path": "dvc/command/get_url.py", "file_name": "get_url.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 40, "span_ids": ["imports", "CmdGetUrl.run", "CmdGetUrl", "add_parser"], "tokens": 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": "from __future__ import unicode_literals\n\nimport argparse\nimport logging\n\nfrom dvc.repo import Repo\nfrom dvc.exceptions import DvcException\nfrom .base import CmdBaseNoRepo, append_doc_link\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdGetUrl(CmdBaseNoRepo):\n def run(self):\n try:\n Repo.get_url(self.args.url, out=self.args.out)\n return 0\n except DvcException:\n logger.exception(\"failed to get '{}'\".format(self.args.url))\n return 1\n\n\ndef add_parser(subparsers, parent_parser):\n GET_HELP = \"Download or copy files from URL.\"\n get_parser = subparsers.add_parser(\n \"get-url\",\n parents=[parent_parser],\n description=append_doc_link(GET_HELP, \"get-url\"),\n help=GET_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n get_parser.add_argument(\n \"url\", help=\"See `dvc import-url -h` for full list of supported URLs.\"\n )\n get_parser.add_argument(\n \"out\", nargs=\"?\", help=\"Destination path to put data to.\"\n )\n get_parser.set_defaults(func=CmdGetUrl)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/imp_url.py_from___future___import_un_CmdImportUrl.run.return.0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/imp_url.py_from___future___import_un_CmdImportUrl.run.return.0", "embedding": null, "metadata": {"file_path": "dvc/command/imp_url.py", "file_name": "imp_url.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 30, "span_ids": ["imports", "CmdImportUrl", "CmdImportUrl.run"], "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": "from __future__ import unicode_literals\n\nimport argparse\nimport logging\n\nfrom dvc.exceptions import DvcException\nfrom dvc.command.base import CmdBase, append_doc_link\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdImportUrl(CmdBase):\n def run(self):\n try:\n self.repo.imp_url(\n self.args.url,\n out=self.args.out,\n resume=self.args.resume,\n fname=self.args.file,\n )\n except DvcException:\n logger.exception(\n \"failed to import {}. You could also try downloading \"\n \"it manually and adding it with `dvc add` 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_url.py_add_parser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/imp_url.py_add_parser_", "embedding": null, "metadata": {"file_path": "dvc/command/imp_url.py", "file_name": "imp_url.py", "file_type": "text/x-python", "category": "implementation", "start_line": 33, "end_line": 70, "span_ids": ["add_parser"], "tokens": 289}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_parser(subparsers, parent_parser):\n IMPORT_HELP = (\n \"Download or copy file from URL and take it under DVC control.\"\n )\n\n import_parser = subparsers.add_parser(\n \"import-url\",\n parents=[parent_parser],\n description=append_doc_link(IMPORT_HELP, \"import-url\"),\n help=IMPORT_HELP,\n formatter_class=argparse.RawTextHelpFormatter,\n )\n import_parser.add_argument(\n \"url\",\n help=\"Supported urls:\\n\"\n \"/path/to/file\\n\"\n \"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.add_argument(\n \"-f\", \"--file\", help=\"Specify name of the DVC-file it generates.\"\n )\n import_parser.set_defaults(func=CmdImportUrl)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config_Config.SECTION_CORE_STORAGEPATH._storagepath_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config_Config.SECTION_CORE_STORAGEPATH._storagepath_", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 113, "end_line": 191, "span_ids": ["Config"], "tokens": 664}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "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 LEVEL_LOCAL = 0\n LEVEL_REPO = 1\n LEVEL_GLOBAL = 2\n LEVEL_SYSTEM = 3\n\n BOOL_SCHEMA = And(str, is_bool, Use(to_bool))\n\n SECTION_CORE = \"core\"\n SECTION_CORE_LOGLEVEL = \"loglevel\"\n SECTION_CORE_LOGLEVEL_SCHEMA = And(\n Use(str.lower), Choices(\"info\", \"debug\", \"warning\", \"error\")\n )\n SECTION_CORE_REMOTE = \"remote\"\n SECTION_CORE_INTERACTIVE_SCHEMA = BOOL_SCHEMA\n SECTION_CORE_INTERACTIVE = \"interactive\"\n SECTION_CORE_ANALYTICS = \"analytics\"\n SECTION_CORE_ANALYTICS_SCHEMA = BOOL_SCHEMA\n SECTION_CORE_CHECKSUM_JOBS = \"checksum_jobs\"\n SECTION_CORE_CHECKSUM_JOBS_SCHEMA = And(Use(int), lambda x: x > 0)\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_SLOW_LINK_WARNING = \"slow_link_warning\"\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): BOOL_SCHEMA,\n Optional(PRIVATE_CWD): str,\n Optional(SECTION_CACHE_SLOW_LINK_WARNING, default=True): BOOL_SCHEMA,\n }\n\n # backward compatibility\n SECTION_CORE_CLOUD = \"cloud\"\n SECTION_CORE_CLOUD_SCHEMA = And(\n Use(str.lower),\n # only the clouds which were supported by obsoleted cloud config\n Choices(\"aws\", \"gcp\", \"local\", \"\"),\n )\n SECTION_CORE_STORAGEPATH = \"storagepath\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config.SECTION_CORE_SCHEMA_Config.SECTION_REMOTE_NO_TRAVERSE._no_traverse_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config.SECTION_CORE_SCHEMA_Config.SECTION_REMOTE_NO_TRAVERSE._no_traverse_", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 193, "end_line": 263, "span_ids": ["Config"], "tokens": 636}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Config(object):\n\n SECTION_CORE_SCHEMA = {\n Optional(SECTION_CORE_LOGLEVEL): 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 Optional(\n SECTION_CORE_CHECKSUM_JOBS, default=None\n ): SECTION_CORE_CHECKSUM_JOBS_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\"\n SECTION_AWS_SSE = \"sse\"\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): BOOL_SCHEMA,\n Optional(SECTION_AWS_USE_SSL, default=True): BOOL_SCHEMA,\n Optional(SECTION_AWS_SSE): str,\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 # Alibabacloud oss options\n SECTION_OSS_ACCESS_KEY_ID = \"oss_key_id\"\n SECTION_OSS_ACCESS_KEY_SECRET = \"oss_key_secret\"\n SECTION_OSS_ENDPOINT = \"oss_endpoint\"\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_NO_TRAVERSE = \"no_traverse\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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_REMOTE_SCHEMA_Config.get_system_config_dir.return.site_config_dir_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config.SECTION_REMOTE_SCHEMA_Config.get_system_config_dir.return.site_config_dir_", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 264, "end_line": 349, "span_ids": ["Config", "Config.get_global_config_dir", "Config.__init__", "Config.get_system_config_dir"], "tokens": 707}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Config(object):\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): BOOL_SCHEMA,\n Optional(SECTION_AWS_USE_SSL, default=True): BOOL_SCHEMA,\n Optional(SECTION_AWS_SSE): str,\n Optional(SECTION_GCP_PROJECTNAME): str,\n Optional(SECTION_CACHE_TYPE): SECTION_CACHE_TYPE_SCHEMA,\n Optional(SECTION_CACHE_PROTECTED, default=False): BOOL_SCHEMA,\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): BOOL_SCHEMA,\n Optional(SECTION_AZURE_CONNECTION_STRING): str,\n Optional(SECTION_OSS_ACCESS_KEY_ID): str,\n Optional(SECTION_OSS_ACCESS_KEY_SECRET): str,\n Optional(SECTION_OSS_ENDPOINT): str,\n Optional(PRIVATE_CWD): str,\n Optional(SECTION_REMOTE_NO_TRAVERSE, default=True): BOOL_SCHEMA,\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 }\n\n def __init__(self, dvc_dir=None, validate=True):\n self.dvc_dir = dvc_dir\n self.validate = validate\n\n if not dvc_dir:\n try:\n from dvc.repo import Repo\n\n self.dvc_dir = os.path.join(Repo.find_dvc_dir())\n except NotDvcRepoError:\n self.dvc_dir = None\n else:\n self.dvc_dir = os.path.abspath(os.path.realpath(dvc_dir))\n\n self.load()\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 )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "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._resolve_paths.return.ret": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/config.py_Config.init_Config._resolve_paths.return.ret", "embedding": null, "metadata": {"file_path": "dvc/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "implementation", "start_line": 351, "end_line": 389, "span_ids": ["Config._resolve_paths", "Config.init", "Config._resolve_cache_path"], "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 Config(object):\n\n @staticmethod\n def init(dvc_dir):\n \"\"\"Initializes dvc config.\n\n Args:\n dvc_dir (str): path to .dvc directory.\n\n Returns:\n dvc.config.Config: config object.\n \"\"\"\n config_file = os.path.join(dvc_dir, Config.CONFIG)\n open(config_file, \"w+\").close()\n return Config(dvc_dir)\n\n def _resolve_cache_path(self, config):\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(config.filename)\n\n def _resolve_paths(self, config):\n if config.filename is None:\n return config\n\n ret = copy.deepcopy(config)\n self._resolve_cache_path(ret)\n\n for section in ret.values():\n if self.SECTION_REMOTE_URL not in section.keys():\n continue\n\n section[self.PRIVATE_CWD] = os.path.dirname(ret.filename)\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/dependency/repo.py_from___future___import_un_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/dependency/repo.py_from___future___import_un_", "embedding": null, "metadata": {"file_path": "dvc/dependency/repo.py", "file_name": "repo.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 78, "span_ids": ["DependencyREPO.update", "DependencyREPO", "DependencyREPO._parse_path", "DependencyREPO.dumpd", "imports", "DependencyREPO.download", "DependencyREPO.save", "DependencyREPO.is_in_repo", "DependencyREPO._make_repo", "DependencyREPO.__str__", "DependencyREPO.status", "DependencyREPO.__init__"], "tokens": 483}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import unicode_literals\n\nimport copy\n\nfrom funcy import merge\nfrom schema import Optional\nfrom contextlib import contextmanager\n\nfrom dvc.external_repo import external_repo\nfrom dvc.utils.compat import str\n\nfrom .local import DependencyLOCAL\n\n\nclass DependencyREPO(DependencyLOCAL):\n PARAM_REPO = \"repo\"\n PARAM_URL = \"url\"\n PARAM_REV = \"rev\"\n PARAM_REV_LOCK = \"rev_lock\"\n\n REPO_SCHEMA = {\n Optional(PARAM_URL): str,\n Optional(PARAM_REV): str,\n Optional(PARAM_REV_LOCK): str,\n }\n\n def __init__(self, def_repo, stage, *args, **kwargs):\n self.def_repo = def_repo\n super(DependencyREPO, self).__init__(stage, *args, **kwargs)\n\n def _parse_path(self, remote, path):\n return None\n\n @property\n def is_in_repo(self):\n return False\n\n def __str__(self):\n return \"{} ({})\".format(self.def_path, self.def_repo[self.PARAM_URL])\n\n @contextmanager\n def _make_repo(self, **overrides):\n with external_repo(**merge(self.def_repo, overrides)) as repo:\n yield repo\n\n def status(self):\n with self._make_repo() as repo:\n current = repo.find_out_by_relpath(self.def_path).info\n\n with self._make_repo(rev_lock=None) as repo:\n updated = repo.find_out_by_relpath(self.def_path).info\n\n if current != updated:\n return {str(self): \"update available\"}\n\n return {}\n\n def save(self):\n pass\n\n def dumpd(self):\n return {self.PARAM_PATH: self.def_path, self.PARAM_REPO: self.def_repo}\n\n def download(self, to, resume=False):\n with self._make_repo(\n cache_dir=self.repo.cache.local.cache_dir\n ) as repo:\n self.def_repo[self.PARAM_REV_LOCK] = repo.scm.get_rev()\n\n out = repo.find_out_by_relpath(self.def_path)\n repo.fetch(out.stage.path)\n to.info = copy.copy(out.info)\n to.checkout()\n\n def update(self):\n with self._make_repo(rev_lock=None) as repo:\n self.def_repo[self.PARAM_REV_LOCK] = repo.scm.get_rev()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py_from___future___import_un_RevError.__init__.super_RevError_self___i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py_from___future___import_un_RevError.__init__.super_RevError_self___i", "embedding": null, "metadata": {"file_path": "dvc/external_repo.py", "file_name": "external_repo.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 35, "span_ids": ["RevError", "ExternalRepoError", "imports", "CloneError.__init__", "RevError.__init__", "CloneError"], "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": "from __future__ import unicode_literals\n\nimport os\nimport logging\nimport tempfile\n\nfrom funcy import retry\nfrom contextlib import contextmanager\n\nfrom dvc.config import Config\nfrom dvc.cache import CacheConfig\nfrom dvc.exceptions import DvcException\nfrom dvc.utils import remove\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass ExternalRepoError(DvcException):\n pass\n\n\nclass CloneError(ExternalRepoError):\n def __init__(self, url, path, cause):\n super(CloneError, self).__init__(\n \"Failed to clone repo '{}' to '{}'\".format(url, path), cause=cause\n )\n\n\nclass RevError(ExternalRepoError):\n def __init__(self, url, rev, cause):\n super(RevError, self).__init__(\n \"Failed to access revision '{}' for repo '{}'\".format(rev, url),\n 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/logger.py_ColorFormatter._parse_exc_LoggerHandler.handleError.raise_LoggingException_re": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/logger.py_ColorFormatter._parse_exc_LoggerHandler.handleError.raise_LoggingException_re", "embedding": null, "metadata": {"file_path": "dvc/logger.py", "file_name": "logger.py", "file_type": "text/x-python", "category": "implementation", "start_line": 127, "end_line": 161, "span_ids": ["ColorFormatter._parse_exc", "LoggerHandler", "ColorFormatter._progress_aware", "LoggerHandler.handleError"], "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 ColorFormatter(logging.Formatter):\n\n def _parse_exc(self, exc_info):\n if not exc_info:\n return (None, \"\")\n\n exc_list, tb_list = self._walk_exc(exc_info)\n\n exception = \": \".join(exc_list)\n\n if self._current_level() == logging.DEBUG:\n stack_trace = (\n \"\\n\" \"{red}{line}{nc}\\n\" \"{stack_trace}\" \"{red}{line}{nc}\"\n ).format(\n red=colorama.Fore.RED,\n nc=colorama.Fore.RESET,\n line=\"-\" * 60,\n stack_trace=\"\\n\".join(tb_list),\n )\n else:\n stack_trace = \"\"\n\n return (exception, stack_trace)\n\n def _progress_aware(self):\n \"\"\"Add a new line if progress bar hasn't finished\"\"\"\n from dvc.progress import progress\n\n if not progress.is_finished:\n progress._print()\n progress.clearln()\n\n\nclass LoggerHandler(logging.StreamHandler):\n def handleError(self, record):\n super(LoggerHandler, self).handleError(record)\n raise LoggingException(record)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP.exists_RemoteHTTP.get_file_checksum.return.etag": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/http.py_RemoteHTTP.exists_RemoteHTTP.get_file_checksum.return.etag", "embedding": null, "metadata": {"file_path": "dvc/remote/http.py", "file_name": "http.py", "file_type": "text/x-python", "category": "implementation", "start_line": 96, "end_line": 129, "span_ids": ["RemoteHTTP.get_file_checksum", "RemoteHTTP.batch_exists", "RemoteHTTP.exists", "RemoteHTTP._content_length"], "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": "class RemoteHTTP(RemoteBASE):\n\n def exists(self, path_info):\n return bool(self._request(\"HEAD\", path_info.url))\n\n def batch_exists(self, path_infos, callback):\n results = []\n\n for path_info in path_infos:\n results.append(self.exists(path_info))\n callback.update(str(path_info))\n\n return results\n\n def _content_length(self, url):\n return self._request(\"HEAD\", url).headers.get(\"Content-Length\")\n\n def get_file_checksum(self, path_info):\n url = path_info.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/ssh/__init__.py_RemoteSSH.ssh_RemoteSSH.exists.with_self_ssh_path_info_.return.ssh_exists_path_info_path": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.ssh_RemoteSSH.exists.with_self_ssh_path_info_.return.ssh_exists_path_info_path", "embedding": null, "metadata": {"file_path": "dvc/remote/ssh/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 108, "end_line": 137, "span_ids": ["RemoteSSH.ssh", "RemoteSSH.exists"], "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 RemoteSSH(RemoteBASE):\n\n def ssh(self, path_info):\n host, user, port = path_info.host, path_info.user, path_info.port\n\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 )\n\n def exists(self, path_info):\n with self.ssh(path_info) as ssh:\n return ssh.exists(path_info.path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.batch_exists_RemoteSSH.batch_exists.with_self_ssh_path_infos_.return.results": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.batch_exists_RemoteSSH.batch_exists.with_self_ssh_path_infos_.return.results", "embedding": null, "metadata": {"file_path": "dvc/remote/ssh/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 139, "end_line": 165, "span_ids": ["RemoteSSH.batch_exists"], "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 RemoteSSH(RemoteBASE):\n\n def batch_exists(self, path_infos, callback):\n def _exists(chunk_and_channel):\n chunk, channel = chunk_and_channel\n ret = []\n for path in chunk:\n try:\n channel.stat(path)\n ret.append(True)\n except IOError as exc:\n if exc.errno != errno.ENOENT:\n raise\n ret.append(False)\n callback.update(path)\n return ret\n\n with self.ssh(path_infos[0]) as ssh:\n with ssh.open_max_sftp_channels() as channels:\n max_workers = len(channels)\n\n with ThreadPoolExecutor(max_workers=max_workers) as executor:\n paths = [path_info.path for path_info in path_infos]\n chunks = to_chunks(paths, num_chunks=max_workers)\n chunks_and_channels = zip(chunks, channels)\n outcome = executor.map(_exists, chunks_and_channels)\n results = list(itertools.chain.from_iterable(outcome))\n\n return results", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.get_file_checksum_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/__init__.py_RemoteSSH.get_file_checksum_", "embedding": null, "metadata": {"file_path": "dvc/remote/ssh/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 167, "end_line": 245, "span_ids": ["RemoteSSH.get_file_checksum", "RemoteSSH.copy", "RemoteSSH.transfer_context", "RemoteSSH.walk", "RemoteSSH._upload", "RemoteSSH.move", "RemoteSSH.makedirs", "RemoteSSH.remove", "RemoteSSH.isdir", "RemoteSSH._download", "RemoteSSH.list_cache_paths"], "tokens": 490}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteSSH(RemoteBASE):\n\n def get_file_checksum(self, path_info):\n if path_info.scheme != self.scheme:\n raise NotImplementedError\n\n with self.ssh(path_info) as ssh:\n return ssh.md5(path_info.path)\n\n def isdir(self, path_info):\n with self.ssh(path_info) as ssh:\n return ssh.isdir(path_info.path)\n\n def copy(self, from_info, to_info, ctx=None):\n if from_info.scheme != self.scheme or to_info.scheme != self.scheme:\n raise NotImplementedError\n\n if ctx:\n ctx.cp(from_info.path, to_info.path)\n else:\n with self.ssh(from_info) as ssh:\n ssh.cp(from_info.path, to_info.path)\n\n def remove(self, path_info):\n if path_info.scheme != self.scheme:\n raise NotImplementedError\n\n with self.ssh(path_info) as ssh:\n ssh.remove(path_info.path)\n\n def move(self, from_info, to_info):\n if from_info.scheme != self.scheme or to_info.scheme != self.scheme:\n raise NotImplementedError\n\n with self.ssh(from_info) as ssh:\n ssh.move(from_info.path, to_info.path)\n\n def transfer_context(self):\n return self.ssh(self.path_info)\n\n def _download(\n self,\n from_info,\n to_file,\n name=None,\n ctx=None,\n no_progress_bar=False,\n resume=False,\n ):\n assert from_info.isin(self.path_info)\n ctx.download(\n from_info.path,\n to_file,\n progress_title=name,\n no_progress_bar=no_progress_bar,\n )\n\n def _upload(\n self, from_file, to_info, name=None, ctx=None, no_progress_bar=False\n ):\n assert to_info.isin(self.path_info)\n ctx.upload(\n from_file,\n to_info.path,\n progress_title=name,\n no_progress_bar=no_progress_bar,\n )\n\n def list_cache_paths(self):\n with self.ssh(self.path_info) as ssh:\n return list(ssh.walk_files(self.path_info.path))\n\n def walk(self, path_info):\n with self.ssh(path_info) as ssh:\n for entry in ssh.walk(path_info.path):\n yield entry\n\n def makedirs(self, path_info):\n with self.ssh(path_info) as ssh:\n ssh.makedirs(path_info.path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_os_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_os_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": 44, "span_ids": ["percent_cb", "imports", "create_cb", "sizeof_fmt"], "tokens": 280}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport posixpath\nimport logging\nimport errno\nimport stat\nfrom contextlib import contextmanager\n\ntry:\n import paramiko\nexcept ImportError:\n paramiko = None\n\nfrom dvc.utils import tmp_fname\nfrom dvc.utils.compat import ignore_file_not_found\nfrom dvc.progress import progress\nfrom dvc.exceptions import DvcException\nfrom dvc.remote.base import RemoteCmdError\n\n\nlogger = logging.getLogger(__name__)\n\n\ndef sizeof_fmt(num, suffix=\"B\"):\n \"\"\" Convert number of bytes to human-readable string \"\"\"\n for unit in [\"\", \"K\", \"M\", \"G\", \"T\", \"P\", \"E\", \"Z\"]:\n if abs(num) < 1024.0:\n return \"%3.1f%s%s\" % (num, unit, suffix)\n num /= 1024.0\n return \"%.1f%s%s\" % (num, \"Y\", suffix)\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_SSHConnection.islink.return.stat_S_ISLNK_self_st_mode": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection_SSHConnection.islink.return.stat_S_ISLNK_self_st_mode", "embedding": null, "metadata": {"file_path": "dvc/remote/ssh/connection.py", "file_name": "connection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 47, "end_line": 95, "span_ids": ["SSHConnection.__enter__", "SSHConnection.isfile", "SSHConnection", "SSHConnection.islink", "SSHConnection.close", "SSHConnection.exists", "SSHConnection.__init__", "SSHConnection.isdir", "SSHConnection.st_mode", "SSHConnection.__exit__", "SSHConnection._sftp_connect"], "tokens": 318}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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 st_mode(self, path):\n self._sftp_connect()\n\n with ignore_file_not_found():\n return self._sftp.stat(path).st_mode\n\n return 0\n\n def exists(self, path, sftp=None):\n return bool(self.st_mode(path))\n\n def isdir(self, path):\n return stat.S_ISDIR(self.st_mode(path))\n\n def isfile(self, path):\n return stat.S_ISREG(self.st_mode(path))\n\n def islink(self, path):\n return stat.S_ISLNK(self.st_mode(path))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.makedirs_SSHConnection.makedirs.if_tail_.try_.except_IOError_as_e_.if_e_errno_errno_EACCE.raise": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/ssh/connection.py_SSHConnection.makedirs_SSHConnection.makedirs.if_tail_.try_.except_IOError_as_e_.if_e_errno_errno_EACCE.raise", "embedding": null, "metadata": {"file_path": "dvc/remote/ssh/connection.py", "file_name": "connection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 97, "end_line": 123, "span_ids": ["SSHConnection.makedirs"], "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 SSHConnection:\n\n def makedirs(self, path):\n self._sftp_connect()\n\n # Single stat call will say whether this is a dir, a file or a link\n st_mode = self.st_mode(path)\n\n if stat.S_ISDIR(st_mode):\n return\n\n if stat.S_ISREG(st_mode) or stat.S_ISLNK(st_mode):\n raise DvcException(\n \"a file with the same name '{}' already exists\".format(path)\n )\n\n head, tail = posixpath.split(path)\n\n if head:\n self.makedirs(head)\n\n if tail:\n try:\n self._sftp.mkdir(path)\n except IOError as e:\n # Since paramiko errors are very vague we need to recheck\n # whether it's because path already exists or something else\n if e.errno == errno.EACCES or not self.exists(path):\n raise", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/brancher.py_from_dvc_scm_tree_import__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/brancher.py_from_dvc_scm_tree_import__", "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": 55, "span_ids": ["brancher", "imports"], "tokens": 381}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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.scm.tree import WorkingTree\n\n\ndef 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 self.tree = WorkingTree(self.root_dir)\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 not None:\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/get.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/get.py_os_", "embedding": null, "metadata": {"file_path": "dvc/repo/get.py", "file_name": "get.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 45, "span_ids": ["imports", "get"], "tokens": 384}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport shortuuid\n\nfrom dvc.config import Config\nfrom dvc.path_info import PathInfo\nfrom dvc.external_repo import external_repo\nfrom dvc.utils import remove\nfrom dvc.utils.compat import urlparse\n\n\n@staticmethod\ndef get(url, path, out=None, rev=None):\n out = out or os.path.basename(urlparse(path).path)\n\n # Creating a directory right beside the output to make sure that they\n # are on the same filesystem, so we could take the advantage of\n # reflink and/or hardlink. Not using tempfile.TemporaryDirectory\n # because it will create a symlink to tmpfs, which defeats the purpose\n # and won't work with reflink/hardlink.\n dpath = os.path.dirname(os.path.abspath(out))\n tmp_dir = os.path.join(dpath, \".\" + str(shortuuid.uuid()))\n try:\n with external_repo(cache_dir=tmp_dir, url=url, rev=rev) as repo:\n # Try any links possible to avoid data duplication.\n #\n # Not using symlink, because we need to remove cache after we are\n # done, and to make that work we would have to copy data over\n # anyway before removing the cache, so we might just copy it\n # right away.\n #\n # Also, we can't use theoretical \"move\" link type here, because\n # the same cache file might be used a few times in a directory.\n repo.config.set(\n Config.SECTION_CACHE,\n Config.SECTION_CACHE_TYPE,\n \"reflink,hardlink,copy\",\n )\n o = repo.find_out_by_relpath(path)\n repo.fetch(o.stage.path)\n o.path_info = PathInfo(os.path.abspath(out))\n with o.repo.state:\n o.checkout()\n finally:\n remove(tmp_dir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/get_url.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/get_url.py__", "embedding": null, "metadata": {"file_path": "dvc/repo/get_url.py", "file_name": "get_url.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 20, "span_ids": ["imports", "get_url"], "tokens": 107}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nimport dvc.output as output\nimport dvc.dependency as dependency\n\nfrom dvc.utils.compat import urlparse\n\n\n@staticmethod\ndef get_url(url, out=None):\n out = out or os.path.basename(urlparse(url).path)\n\n if os.path.exists(url):\n url = os.path.abspath(url)\n out = os.path.abspath(out)\n\n dep, = dependency.loads_from(None, [url])\n out, = output.loads_from(None, [out], use_cache=False)\n dep.download(out)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/imp.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/imp.py__", "embedding": null, "metadata": {"file_path": "dvc/repo/imp.py", "file_name": "imp.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 7, "span_ids": ["imp"], "tokens": 58}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def imp(self, url, path, out=None, rev=None):\n erepo = {\"url\": url}\n if rev is not None:\n erepo[\"rev\"] = rev\n\n return self.imp_url(path, out=out, erepo=erepo, locked=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_MissingDataSource_Stage.is_repo_import.return.isinstance_self_deps_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_MissingDataSource_Stage.is_repo_import.return.isinstance_self_deps_0_", "embedding": null, "metadata": {"file_path": "dvc/stage.py", "file_name": "stage.py", "file_type": "text/x-python", "category": "implementation", "start_line": 110, "end_line": 224, "span_ids": ["Stage.__init__", "Stage.is_stage_file", "Stage.changed_md5", "Stage.is_callback", "Stage.is_valid_filename", "Stage.is_data_source", "MissingDataSource.__init__", "MissingDataSource", "Stage", "Stage.relpath", "Stage.__repr__", "Stage.is_repo_import", "Stage.is_import"], "tokens": 786}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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)\n\n\nclass 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 PARAM_META = \"meta\"\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 Optional(PARAM_META): object,\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 state=None,\n ):\n if deps is None:\n deps = []\n if outs is None:\n outs = []\n\n self.repo = repo\n self.path = path\n self.cmd = cmd\n self.wdir = wdir\n self.outs = outs\n self.deps = deps\n self.md5 = md5\n self.locked = locked\n self.tag = tag\n self._state = state or {}\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 relpath(self.path)\n\n @property\n def is_data_source(self):\n \"\"\"Whether the DVC-file was created with `dvc add` or `dvc import`\"\"\"\n return self.cmd is None\n\n @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 DVC-file was created with `dvc import`.\"\"\"\n return not self.cmd and len(self.deps) == 1 and len(self.outs) == 1\n\n @property\n def is_repo_import(self):\n if not self.is_import:\n return False\n\n return isinstance(self.deps[0], dependency.DependencyREPO)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage._check_circular_dependency_Stage._check_duplicated_arguments.for_path_occurrence_in_p.if_occurrence_1_.raise_ArgumentDuplication": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage._check_circular_dependency_Stage._check_duplicated_arguments.for_path_occurrence_in_p.if_occurrence_1_.raise_ArgumentDuplication", "embedding": null, "metadata": {"file_path": "dvc/stage.py", "file_name": "stage.py", "file_type": "text/x-python", "category": "implementation", "start_line": 752, "end_line": 770, "span_ids": ["Stage._check_circular_dependency", "Stage._check_duplicated_arguments"], "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 Stage(object):\n\n def _check_circular_dependency(self):\n from dvc.exceptions import CircularDependencyError\n\n circular_dependencies = set(d.path_info for d in self.deps) & set(\n o.path_info for o in self.outs\n )\n\n if circular_dependencies:\n raise CircularDependencyError(str(circular_dependencies.pop()))\n\n def _check_duplicated_arguments(self):\n from dvc.exceptions import ArgumentDuplicationError\n from collections import Counter\n\n path_counts = Counter(edge.path_info for edge in self.deps + self.outs)\n\n for path, occurrence in path_counts.items():\n if occurrence > 1:\n raise ArgumentDuplicationError(str(path))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage._run_Stage._run.if_p_is_None_or_p_retu.raise_StageCmdFailedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/stage.py_Stage._run_Stage._run.if_p_is_None_or_p_retu.raise_StageCmdFailedError", "embedding": null, "metadata": {"file_path": "dvc/stage.py", "file_name": "stage.py", "file_type": "text/x-python", "category": "implementation", "start_line": 772, "end_line": 800, "span_ids": ["Stage._run"], "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 Stage(object):\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 main_thread = isinstance(\n threading.current_thread(), threading._MainThread\n )\n if main_thread:\n old_handler = signal.signal(signal.SIGINT, signal.SIG_IGN)\n\n p = None\n\n try:\n p = subprocess.Popen(\n self.cmd,\n cwd=self.wdir,\n shell=True,\n env=fix_env(os.environ),\n executable=executable,\n close_fds=True,\n )\n p.communicate()\n finally:\n if main_thread:\n signal.signal(signal.SIGINT, old_handler)\n\n if (p is None) or (p.returncode != 0):\n raise StageCmdFailedError(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.save_link_State.save_link.self__execute_cmd_relat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/state.py_State.save_link_State.save_link.self__execute_cmd_relat", "embedding": null, "metadata": {"file_path": "dvc/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 403, "end_line": 423, "span_ids": ["State.save_link"], "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 State(StateBase):\n\n def save_link(self, path_info):\n \"\"\"Adds the specified path to the list of links created by dvc. This\n list is later used on `dvc checkout` to cleanup old links.\n\n Args:\n path_info (dict): path info to add to the list of links.\n \"\"\"\n assert path_info.scheme == \"local\"\n path = fspath_py35(path_info)\n\n if not os.path.exists(path):\n return\n\n mtime, _ = get_mtime_and_size(path)\n inode = get_inode(path)\n relative_path = relpath(path, self.root_dir)\n\n cmd = \"REPLACE INTO {}(path, inode, mtime) \" \"VALUES (?, ?, ?)\".format(\n self.LINK_STATE_TABLE\n )\n self._execute(cmd, (relative_path, self._to_sqlite(inode), mtime))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/compat.py_ignore_file_not_found__Backport_os_fspath_fr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/utils/compat.py_ignore_file_not_found__Backport_os_fspath_fr", "embedding": null, "metadata": {"file_path": "dvc/utils/compat.py", "file_name": "compat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 94, "end_line": 170, "span_ids": ["impl:9", "ignore_file_not_found"], "tokens": 646}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@contextmanager\ndef ignore_file_not_found():\n try:\n yield\n except IOError as exc:\n if exc.errno != errno.ENOENT:\n raise\n\n\nif is_py2:\n from urlparse import urlparse, urljoin, urlsplit, urlunsplit # 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 import pathlib2 as pathlib # noqa: F401\n from collections import Mapping # 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 range = xrange # noqa: F821\n\n import StringIO\n import io\n\n class StringIO(StringIO.StringIO):\n def __enter__(self):\n return self\n\n def __exit__(self, *args):\n self.close()\n\n class BytesIO(io.BytesIO):\n def __enter__(self):\n return self\n\n def __exit__(self, *args):\n self.close()\n\n\nelif is_py3:\n import pathlib # noqa: F401\n from os import makedirs # noqa: F401\n from urllib.parse import ( # noqa: F401\n urlparse, # noqa: F401\n urljoin, # noqa: F401\n urlsplit, # noqa: F401\n urlunsplit, # noqa: F401\n )\n from io import StringIO, BytesIO # 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 from collections.abc import Mapping # 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\n range = range # noqa: F821\n\n\n# Backport os.fspath() from Python 3.6", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/__init__.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/__init__.py_os_", "embedding": null, "metadata": {"file_path": "tests/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 37, "span_ids": ["imports"], "tokens": 298}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\n# Increasing fd ulimit for tests\nif os.name == \"nt\":\n import win32file\n import subprocess\n\n win32file._setmaxstdio(2048)\n\n # Workaround for two bugs:\n #\n # 1) gitpython-developers/GitPython#546\n # GitPython leaves git cat-file --batch/--batch-check processes that are\n # not cleaned up correctly, so Popen._active list has their defunct\n # process handles, that it is not able to cleanup because of bug 2)\n #\n # 2) https://bugs.python.org/issue37380\n # subprocess.Popen._internal_poll on windows is getting\n #\n # \tOSError: [WinError 6] The handle is invalid\n #\n # exception, which it doesn't ignore and so Popen is not able to cleanup\n # old processes and that prevents it from creating any new processes at\n # all, which results in our tests failing whenever they try to use Popen.\n\n def noop():\n pass\n\n subprocess._cleanup = noop\nelse:\n import resource\n\n resource.setrlimit(resource.RLIMIT_NOFILE, (2048, 2048))\n\n nproc_soft, nproc_hard = resource.getrlimit(resource.RLIMIT_NPROC)\n resource.setrlimit(resource.RLIMIT_NPROC, (nproc_hard, nproc_hard))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py_TestGitFixture_TestGitFixture.tearDown.super_TestGitFixture_sel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py_TestGitFixture_TestGitFixture.tearDown.super_TestGitFixture_sel", "embedding": null, "metadata": {"file_path": "tests/basic_env.py", "file_name": "basic_env.py", "file_type": "text/x-python", "category": "implementation", "start_line": 119, "end_line": 144, "span_ids": ["TestGitFixture.setUp", "TestGitFixture", "TestGitFixture.tearDown"], "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 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 True:\n try:\n self.git = Repo.init()\n break\n except GitCommandNotFound:\n retries -= 1\n if not retries:\n raise\n\n self.git.index.add([self.CODE])\n self.git.index.commit(\"add code\")\n\n def tearDown(self):\n self.git.close()\n super(TestGitFixture, self).tearDown()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py_TestGitSubmoduleFixture_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/basic_env.py_TestGitSubmoduleFixture_", "embedding": null, "metadata": {"file_path": "tests/basic_env.py", "file_name": "basic_env.py", "file_type": "text/x-python", "category": "implementation", "start_line": 147, "end_line": 212, "span_ids": ["TestDvc", "TestGitSubmodule", "TestDvcFixture.setUp", "TestDvcGit.inject_fixtures", "TestDvcGit", "TestGit", "TestDvcGitFixture.tearDown", "TestGit.__init__", "TestDvcGitFixture", "TestDir.__init__", "TestGitSubmoduleFixture.setUp", "TestGitSubmoduleFixture", "TestDvc.inject_fixtures", "TestDvcFixture", "TestDvc.__init__", "TestDir", "TestDvcGit.__init__", "TestDvcGitFixture.setUp", "TestGitSubmodule.__init__"], "tokens": 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": "class TestGitSubmoduleFixture(TestGitFixture):\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(TestDirFixture):\n def setUp(self):\n super(TestDvcFixture, self).setUp()\n self.dvc = DvcRepo.init(self.root_dir, no_scm=True)\n\n\nclass TestDvcGitFixture(TestGitFixture):\n def setUp(self):\n super(TestDvcGitFixture, self).setUp()\n self.dvc = DvcRepo.init(self.root_dir)\n self.dvc.scm.commit(\"init dvc\")\n\n def tearDown(self):\n self.dvc.scm.git.close()\n super(TestDvcGitFixture, self).tearDown()\n\n\n# NOTE: Inheritance order in the classes below is important.\n\n\nclass TestDir(TestDirFixture, TestCase):\n def __init__(self, methodName):\n TestDirFixture.__init__(self)\n TestCase.__init__(self, methodName)\n\n\nclass TestGit(TestGitFixture, TestCase):\n def __init__(self, methodName):\n TestGitFixture.__init__(self)\n TestCase.__init__(self, methodName)\n\n\nclass TestGitSubmodule(TestGitSubmoduleFixture, TestCase):\n def __init__(self, methodName):\n TestGitSubmoduleFixture.__init__(self)\n TestCase.__init__(self, methodName)\n\n\nclass TestDvc(TestDvcFixture, TestCase):\n def __init__(self, methodName):\n TestDvcFixture.__init__(self)\n TestCase.__init__(self, methodName)\n\n @pytest.fixture(autouse=True)\n def inject_fixtures(self, caplog):\n self._caplog = caplog\n\n\nclass TestDvcGit(TestDvcGitFixture, TestCase):\n def __init__(self, methodName):\n TestDvcGitFixture.__init__(self)\n TestCase.__init__(self, methodName)\n\n @pytest.fixture(autouse=True)\n def inject_fixtures(self, caplog):\n self._caplog = caplog", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/conftest.py_erepo_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/conftest.py_erepo_", "embedding": null, "metadata": {"file_path": "tests/conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 134, "end_line": 171, "span_ids": ["erepo"], "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": "@pytest.fixture\ndef erepo(repo_dir):\n repo = TestDvcGitFixture()\n repo.setUp()\n try:\n stage_foo = repo.dvc.add(repo.FOO)[0]\n stage_bar = repo.dvc.add(repo.BAR)[0]\n stage_data_dir = repo.dvc.add(repo.DATA_DIR)[0]\n repo.dvc.scm.add([stage_foo.path, stage_bar.path, stage_data_dir.path])\n repo.dvc.scm.commit(\"init repo\")\n\n rconfig = RemoteConfig(repo.dvc.config)\n rconfig.add(\"upstream\", repo.dvc.cache.local.cache_dir, default=True)\n repo.dvc.scm.add([repo.dvc.config.config_file])\n repo.dvc.scm.commit(\"add remote\")\n\n repo.create(\"version\", \"master\")\n repo.dvc.add(\"version\")\n repo.dvc.scm.add([\".gitignore\", \"version.dvc\"])\n repo.dvc.scm.commit(\"master\")\n\n repo.dvc.scm.checkout(\"branch\", create_new=True)\n os.unlink(os.path.join(repo.root_dir, \"version\"))\n repo.create(\"version\", \"branch\")\n repo.dvc.add(\"version\")\n repo.dvc.scm.add([\".gitignore\", \"version.dvc\"])\n repo.dvc.scm.commit(\"branch\")\n\n repo.dvc.scm.checkout(\"master\")\n\n repo.dvc.scm.git.close()\n repo.git.close()\n\n os.chdir(repo._saved_dir)\n yield repo\n finally:\n repo.tearDown()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_api.py_pytest_test_get_url.assert_api_get_url_repo_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_api.py_pytest_test_get_url.assert_api_get_url_repo_d", "embedding": null, "metadata": {"file_path": "tests/func/test_api.py", "file_name": "test_api.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 80, "span_ids": ["HDFS", "OSS", "run_dvc", "impl", "imports", "Azure", "remote_url", "pytest_generate_tests", "S3", "GCP", "test_get_url", "SSH"], "tokens": 486}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\nimport shutil\n\nfrom dvc import api\nfrom dvc.exceptions import OutputFileMissingError\nfrom dvc.main import main\nfrom dvc.path_info import URLInfo\nfrom dvc.remote.config import RemoteConfig\nfrom .test_data_cloud import (\n _should_test_aws,\n get_aws_url,\n _should_test_gcp,\n get_gcp_url,\n _should_test_azure,\n get_azure_url,\n _should_test_oss,\n get_oss_url,\n _should_test_ssh,\n get_ssh_url,\n _should_test_hdfs,\n get_hdfs_url,\n)\n\n\n# NOTE: staticmethod is only needed in Python 2\nclass S3:\n should_test = staticmethod(_should_test_aws)\n get_url = staticmethod(get_aws_url)\n\n\nclass GCP:\n should_test = staticmethod(_should_test_gcp)\n get_url = staticmethod(get_gcp_url)\n\n\nclass Azure:\n should_test = staticmethod(_should_test_azure)\n get_url = staticmethod(get_azure_url)\n\n\nclass OSS:\n should_test = staticmethod(_should_test_oss)\n get_url = staticmethod(get_oss_url)\n\n\nclass SSH:\n should_test = staticmethod(_should_test_ssh)\n get_url = staticmethod(get_ssh_url)\n\n\nclass HDFS:\n should_test = staticmethod(_should_test_hdfs)\n get_url = staticmethod(get_hdfs_url)\n\n\nremote_params = [S3, GCP, Azure, OSS, SSH, HDFS]\n\n\n@pytest.fixture\ndef remote_url(request):\n if not request.param.should_test():\n raise pytest.skip()\n return request.param.get_url()\n\n\ndef pytest_generate_tests(metafunc):\n if \"remote_url\" in metafunc.fixturenames:\n metafunc.parametrize(\"remote_url\", remote_params, indirect=True)\n\n\ndef run_dvc(*argv):\n assert main(argv) == 0\n\n\ndef test_get_url(repo_dir, dvc_repo, remote_url):\n run_dvc(\"remote\", \"add\", \"-d\", \"upstream\", remote_url)\n dvc_repo.add(repo_dir.FOO)\n\n expected_url = URLInfo(remote_url) / \"ac/bd18db4cc2f85cedef654fccc4a4d8\"\n assert api.get_url(repo_dir.FOO) == expected_url", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_api.py_test_get_url_external_test_open.with_api_open_repo_dir_FO.assert_fd_read_repo_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_api.py_test_get_url_external_test_open.with_api_open_repo_dir_FO.assert_fd_read_repo_", "embedding": null, "metadata": {"file_path": "tests/func/test_api.py", "file_name": "test_api.py", "file_type": "text/x-python", "category": "test", "start_line": 83, "end_line": 101, "span_ids": ["test_open", "test_get_url_external"], "tokens": 205}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_get_url_external(repo_dir, dvc_repo, erepo, remote_url):\n _set_remote_url_and_commit(erepo.dvc, remote_url)\n\n # Using file url to force clone to tmp repo\n repo_url = \"file://\" + erepo.dvc.root_dir\n expected_url = URLInfo(remote_url) / \"ac/bd18db4cc2f85cedef654fccc4a4d8\"\n assert api.get_url(repo_dir.FOO, repo=repo_url) == expected_url\n\n\ndef test_open(repo_dir, dvc_repo, remote_url):\n run_dvc(\"remote\", \"add\", \"-d\", \"upstream\", remote_url)\n dvc_repo.add(repo_dir.FOO)\n run_dvc(\"push\")\n\n # Remove cache to force download\n shutil.rmtree(dvc_repo.cache.local.cache_dir)\n\n with api.open(repo_dir.FOO) as fd:\n assert fd.read() == repo_dir.FOO_CONTENTS", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_api.py_test_open_external_test_open_external.assert_api_read_version_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_api.py_test_open_external_test_open_external.assert_api_read_version_", "embedding": null, "metadata": {"file_path": "tests/func/test_api.py", "file_name": "test_api.py", "file_type": "text/x-python", "category": "test", "start_line": 104, "end_line": 120, "span_ids": ["test_open_external"], "tokens": 176}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_open_external(repo_dir, dvc_repo, erepo, remote_url):\n erepo.dvc.scm.checkout(\"branch\")\n _set_remote_url_and_commit(erepo.dvc, remote_url)\n erepo.dvc.scm.checkout(\"master\")\n _set_remote_url_and_commit(erepo.dvc, remote_url)\n\n erepo.dvc.push(all_branches=True)\n\n # Remove cache to force download\n shutil.rmtree(erepo.dvc.cache.local.cache_dir)\n\n # Using file url to force clone to tmp repo\n repo_url = \"file://\" + erepo.dvc.root_dir\n with api.open(\"version\", repo=repo_url) as fd:\n assert fd.read() == \"master\"\n\n assert api.read(\"version\", repo=repo_url, rev=\"branch\") == \"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/func/test_api.py_test_open_missing_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_api.py_test_open_missing_", "embedding": null, "metadata": {"file_path": "tests/func/test_api.py", "file_name": "test_api.py", "file_type": "text/x-python", "category": "test", "start_line": 123, "end_line": 137, "span_ids": ["test_open_missing", "_set_remote_url_and_commit"], "tokens": 123}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_open_missing(erepo):\n # Remove cache to make foo missing\n shutil.rmtree(erepo.dvc.cache.local.cache_dir)\n\n repo_url = \"file://\" + erepo.dvc.root_dir\n with pytest.raises(OutputFileMissingError):\n api.read(erepo.FOO, repo=repo_url)\n\n\ndef _set_remote_url_and_commit(repo, remote_url):\n rconfig = RemoteConfig(repo.config)\n rconfig.modify(\"upstream\", \"url\", remote_url)\n repo.scm.add([repo.config.config_file])\n repo.scm.commit(\"modify remote\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get.py_os_", "embedding": null, "metadata": {"file_path": "tests/func/test_get.py", "file_name": "test_get.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 41, "span_ids": ["test_get_repo_file", "imports", "test_get_repo_rev", "test_get_repo_dir"], "tokens": 235}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport filecmp\n\nfrom dvc.repo import Repo\n\nfrom tests.utils import trees_equal\n\n\ndef test_get_repo_file(repo_dir, erepo):\n src = erepo.FOO\n dst = erepo.FOO + \"_imported\"\n\n Repo.get(erepo.root_dir, src, dst)\n\n assert os.path.exists(dst)\n assert os.path.isfile(dst)\n assert filecmp.cmp(repo_dir.FOO, dst, shallow=False)\n\n\ndef test_get_repo_dir(repo_dir, erepo):\n src = erepo.DATA_DIR\n dst = erepo.DATA_DIR + \"_imported\"\n\n Repo.get(erepo.root_dir, src, dst)\n\n assert os.path.exists(dst)\n assert os.path.isdir(dst)\n trees_equal(src, dst)\n\n\ndef test_get_repo_rev(repo_dir, erepo):\n src = \"version\"\n dst = src\n\n Repo.get(erepo.root_dir, src, dst, rev=\"branch\")\n\n assert os.path.exists(dst)\n assert os.path.isfile(dst)\n with open(dst, \"r+\") as fobj:\n assert fobj.read() == \"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/func/test_get_url.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_get_url.py__", "embedding": null, "metadata": {"file_path": "tests/func/test_get_url.py", "file_name": "test_get_url.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 16, "span_ids": ["imports", "test_get_file"], "tokens": 79}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport filecmp\n\nfrom dvc.repo import Repo\n\n\ndef test_get_file(repo_dir):\n src = repo_dir.FOO\n dst = repo_dir.FOO + \"_imported\"\n\n Repo.get_url(src, dst)\n\n assert os.path.exists(dst)\n assert os.path.isfile(dst)\n assert filecmp.cmp(repo_dir.FOO, dst, shallow=False)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import.py_os_", "embedding": null, "metadata": {"file_path": "tests/func/test_import.py", "file_name": "test_import.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 39, "span_ids": ["imports", "test_import", "test_import_rev", "test_import_dir"], "tokens": 242}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport filecmp\n\nfrom tests.utils import trees_equal\n\n\ndef test_import(repo_dir, dvc_repo, erepo):\n src = erepo.FOO\n dst = erepo.FOO + \"_imported\"\n\n dvc_repo.imp(erepo.root_dir, src, dst)\n\n assert os.path.exists(dst)\n assert os.path.isfile(dst)\n assert filecmp.cmp(repo_dir.FOO, dst, shallow=False)\n\n\ndef test_import_dir(repo_dir, dvc_repo, erepo):\n src = erepo.DATA_DIR\n dst = erepo.DATA_DIR + \"_imported\"\n\n dvc_repo.imp(erepo.root_dir, src, dst)\n\n assert os.path.exists(dst)\n assert os.path.isdir(dst)\n trees_equal(src, dst)\n\n\ndef test_import_rev(repo_dir, dvc_repo, erepo):\n src = \"version\"\n dst = src\n\n dvc_repo.imp(erepo.root_dir, src, dst, rev=\"branch\")\n\n assert os.path.exists(dst)\n assert os.path.isfile(dst)\n with open(dst, \"r+\") as fobj:\n assert fobj.read() == \"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/func/test_import_url.py_dvc_TestDefaultOutput.test.with_open_filename_as_fd.self_assertEqual_fd_read_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import_url.py_dvc_TestDefaultOutput.test.with_open_filename_as_fd.self_assertEqual_fd_read_", "embedding": null, "metadata": {"file_path": "tests/func/test_import_url.py", "file_name": "test_import_url.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 45, "span_ids": ["TestDefaultOutput.test", "TestCmdImport.test", "imports", "TestDefaultOutput", "TestCmdImport", "TestCmdImport.test_unsupported"], "tokens": 293}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import dvc\n\nfrom dvc.utils.compat import str\n\nimport os\nimport logging\nfrom uuid import uuid4\n\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 spy\nfrom tests.utils.httpd import StaticFileServer\n\n\nclass TestCmdImport(TestDvc):\n def test(self):\n ret = main([\"import-url\", self.FOO, \"import\"])\n self.assertEqual(ret, 0)\n self.assertTrue(os.path.exists(\"import.dvc\"))\n\n ret = main([\"import-url\", \"non-existing-file\", \"import\"])\n self.assertNotEqual(ret, 0)\n\n def test_unsupported(self):\n ret = main([\"import-url\", \"unsupported://path\", \"import_unsupported\"])\n self.assertNotEqual(ret, 0)\n\n\nclass TestDefaultOutput(TestDvc):\n def test(self):\n tmpdir = self.mkdtemp()\n filename = str(uuid4())\n tmpfile = os.path.join(tmpdir, filename)\n\n with open(tmpfile, \"w\") as fd:\n fd.write(\"content\")\n\n ret = main([\"import-url\", tmpfile])\n self.assertEqual(ret, 0)\n self.assertTrue(os.path.exists(filename))\n with open(filename) as fd:\n self.assertEqual(fd.read(), \"content\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import_url.py_TestFailedImportMessage_TestFailedImportMessage.test.with_self__caplog_at_leve.assert_expected_error_in_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import_url.py_TestFailedImportMessage_TestFailedImportMessage.test.with_self__caplog_at_leve.assert_expected_error_in_", "embedding": null, "metadata": {"file_path": "tests/func/test_import_url.py", "file_name": "test_import_url.py", "file_type": "text/x-python", "category": "test", "start_line": 48, "end_line": 64, "span_ids": ["TestFailedImportMessage.test", "TestFailedImportMessage"], "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 TestFailedImportMessage(TestDvc):\n @patch(\"dvc.repo.imp_url.imp_url\", side_effect=DvcException(\"message\"))\n def test(self, _):\n page_address = \"http://somesite.com/file_name\"\n\n self._caplog.clear()\n\n with self._caplog.at_level(logging.ERROR, logger=\"dvc\"):\n main([\"import-url\", page_address])\n\n expected_error = (\n \"failed to import http://somesite.com/file_name.\"\n \" You could also try downloading it manually and\"\n \" adding it with `dvc add` command.\"\n )\n\n assert expected_error in self._caplog.text", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import_url.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/func/test_import_url.py_TestInterruptedDownload_TestInterruptedDownload._import_with_interrupt.with_patch_.with_patch_.self_assertEqual_result_", "embedding": null, "metadata": {"file_path": "tests/func/test_import_url.py", "file_name": "test_import_url.py", "file_type": "text/x-python", "category": "test", "start_line": 72, "end_line": 102, "span_ids": ["TestInterruptedDownload._import_with_interrupt", "TestInterruptedDownload.remote", "TestInterruptedDownload._prepare_interrupted_download", "TestInterruptedDownload"], "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 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-url\", 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/func/test_import_url.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/func/test_import_url.py_TestShouldResumeDownload_TestShouldResumeDownload.test.m_handle_write_assert_has", "embedding": null, "metadata": {"file_path": "tests/func/test_import_url.py", "file_name": "test_import_url.py", "file_type": "text/x-python", "category": "test", "start_line": 105, "end_line": 122, "span_ids": ["TestShouldResumeDownload", "TestShouldResumeDownload.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 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-url\", \"--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/func/test_import_url.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/func/test_import_url.py_TestShouldNotResumeDownload_TestShouldNotResumeDownload.test.m_handle_write_assert_has", "embedding": null, "metadata": {"file_path": "tests/func/test_import_url.py", "file_name": "test_import_url.py", "file_type": "text/x-python", "category": "test", "start_line": 125, "end_line": 140, "span_ids": ["TestShouldNotResumeDownload.test", "TestShouldNotResumeDownload"], "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 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-url\", 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/func/test_import_url.py_TestShouldRemoveOutsBeforeImport_TestShouldRemoveOutsBeforeImport.test.self_assertEqual_1_remov": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import_url.py_TestShouldRemoveOutsBeforeImport_TestShouldRemoveOutsBeforeImport.test.self_assertEqual_1_remov", "embedding": null, "metadata": {"file_path": "tests/func/test_import_url.py", "file_name": "test_import_url.py", "file_type": "text/x-python", "category": "test", "start_line": 143, "end_line": 159, "span_ids": ["TestShouldRemoveOutsBeforeImport", "TestShouldRemoveOutsBeforeImport.test", "TestShouldRemoveOutsBeforeImport.setUp"], "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 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-url\", 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/func/test_import_url.py_TestImportFilename_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_import_url.py_TestImportFilename_", "embedding": null, "metadata": {"file_path": "tests/func/test_import_url.py", "file_name": "test_import_url.py", "file_type": "text/x-python", "category": "test", "start_line": 162, "end_line": 188, "span_ids": ["TestImportFilename.setUp", "TestImportFilename.test", "TestImportFilename"], "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 TestImportFilename(TestDvc):\n def setUp(self):\n super(TestImportFilename, 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 ret = main([\"import-url\", \"-f\", \"bar.dvc\", self.external_source])\n self.assertEqual(0, ret)\n self.assertTrue(os.path.exists(\"bar.dvc\"))\n\n os.remove(\"bar.dvc\")\n\n ret = main([\"import-url\", \"--file\", \"bar.dvc\", self.external_source])\n self.assertEqual(0, ret)\n self.assertTrue(os.path.exists(\"bar.dvc\"))\n\n os.remove(\"bar.dvc\")\n os.mkdir(\"sub\")\n\n path = os.path.join(\"sub\", \"bar.dvc\")\n ret = main([\"import-url\", \"--file\", path, self.external_source])\n self.assertEqual(0, ret)\n self.assertTrue(os.path.exists(path))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_install.py_os_TestInstall.test_should_create_hooks.for_fname_command_in_hoo.with_open_self__hook_fnam.assert_command_in_fobj_re": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_install.py_os_TestInstall.test_should_create_hooks.for_fname_command_in_hoo.with_open_self__hook_fnam.assert_command_in_fobj_re", "embedding": null, "metadata": {"file_path": "tests/func/test_install.py", "file_name": "test_install.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 31, "span_ids": ["TestInstall.test_should_create_hooks", "imports", "TestInstall", "TestInstall._hook"], "tokens": 191}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport sys\n\nimport pytest\nfrom dvc.utils import file_md5\n\nfrom dvc.main import main\nfrom dvc.stage import Stage\n\n\n@pytest.mark.skipif(\n sys.platform == \"win32\", reason=\"Git hooks aren't supported on Windows\"\n)\nclass TestInstall(object):\n def _hook(self, name):\n return os.path.join(\".git\", \"hooks\", name)\n\n def test_should_create_hooks(self, git, dvc_repo):\n assert main([\"install\"]) == 0\n\n hooks_with_commands = [\n (\"post-checkout\", \"exec dvc checkout\"),\n (\"pre-commit\", \"exec dvc status\"),\n (\"pre-push\", \"exec dvc push\"),\n ]\n\n for fname, command in hooks_with_commands:\n assert os.path.isfile(self._hook(fname))\n\n with open(self._hook(fname), \"r\") as fobj:\n assert command in fobj.read()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_install.py_TestInstall.test_should_append_hooks_if_file_already_exists_TestInstall.test_should_be_idempotent.with_open_self__hook_pos.assert_fobj_read_exp": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_install.py_TestInstall.test_should_append_hooks_if_file_already_exists_TestInstall.test_should_be_idempotent.with_open_self__hook_pos.assert_fobj_read_exp", "embedding": null, "metadata": {"file_path": "tests/func/test_install.py", "file_name": "test_install.py", "file_type": "text/x-python", "category": "test", "start_line": 33, "end_line": 51, "span_ids": ["TestInstall.test_should_be_idempotent", "TestInstall.test_should_append_hooks_if_file_already_exists"], "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": "@pytest.mark.skipif(\n sys.platform == \"win32\", reason=\"Git hooks aren't supported on Windows\"\n)\nclass TestInstall(object):\n\n def test_should_append_hooks_if_file_already_exists(self, git, dvc_repo):\n with open(self._hook(\"post-checkout\"), \"w\") as fobj:\n fobj.write(\"#!/bin/sh\\n\" \"echo hello\\n\")\n\n assert main([\"install\"]) == 0\n\n expected_script = \"#!/bin/sh\\n\" \"echo hello\\n\" \"exec dvc checkout\\n\"\n\n with open(self._hook(\"post-checkout\"), \"r\") as fobj:\n assert fobj.read() == expected_script\n\n def test_should_be_idempotent(self, git, dvc_repo):\n assert main([\"install\"]) == 0\n assert main([\"install\"]) == 0\n\n expected_script = \"#!/bin/sh\\n\" \"exec dvc checkout\\n\"\n\n with open(self._hook(\"post-checkout\"), \"r\") as fobj:\n assert fobj.read() == expected_script", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_test_single_ascii_TestPipelineShow.test_dot_commands.self_assertEqual_ret_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_test_single_ascii_TestPipelineShow.test_dot_commands.self_assertEqual_ret_0_", "embedding": null, "metadata": {"file_path": "tests/func/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 57, "end_line": 98, "span_ids": ["TestPipelineShow.test_ascii_commands", "TestPipelineShow.test_commands", "TestPipelineShow", "test_single_ascii_commands", "TestPipelineShow.test_dot_commands", "test_single_ascii", "TestPipelineShow.test_dot", "TestPipelineShow.test", "TestPipelineShow.test_ascii", "TestPipelineShow.test_ascii_outs"], "tokens": 337}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_single_ascii(repo_dir, dvc_repo):\n dvc_repo.add(repo_dir.FOO)\n assert main([\"pipeline\", \"show\", \"--ascii\", \"foo.dvc\"]) == 0\n\n\ndef test_single_ascii_commands(repo_dir, dvc_repo):\n dvc_repo.add(repo_dir.FOO)\n assert main([\"pipeline\", \"show\", \"--ascii\", \"foo.dvc\", \"--commands\"]) == 0\n\n\nclass TestPipelineShow(TestRepro):\n def test(self):\n ret = main([\"pipeline\", \"show\", self.file1_stage])\n self.assertEqual(ret, 0)\n\n def test_commands(self):\n ret = main([\"pipeline\", \"show\", self.file1_stage, \"--commands\"])\n self.assertEqual(ret, 0)\n\n def test_ascii(self):\n ret = main([\"pipeline\", \"show\", \"--ascii\", self.file1_stage])\n self.assertEqual(ret, 0)\n\n def test_dot(self):\n ret = main([\"pipeline\", \"show\", \"--dot\", self.file1_stage])\n self.assertEqual(ret, 0)\n\n def test_ascii_commands(self):\n ret = main(\n [\"pipeline\", \"show\", \"--ascii\", self.file1_stage, \"--commands\"]\n )\n self.assertEqual(ret, 0)\n\n def test_ascii_outs(self):\n ret = main([\"pipeline\", \"show\", \"--ascii\", self.file1_stage, \"--outs\"])\n self.assertEqual(ret, 0)\n\n def test_dot_commands(self):\n ret = main(\n [\"pipeline\", \"show\", \"--dot\", self.file1_stage, \"--commands\"]\n )\n self.assertEqual(ret, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_test_print_locked_stages_TestPipelineShowOuts.test_outs.self_assertEqual_ret_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_test_print_locked_stages_TestPipelineShowOuts.test_outs.self_assertEqual_ret_0_", "embedding": null, "metadata": {"file_path": "tests/func/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 101, "end_line": 130, "span_ids": ["TestPipelineShowOuts.setUp", "TestPipelineShowOuts", "test_print_locked_stages", "test_dot_outs", "TestPipelineShowOuts.test_outs"], "tokens": 259}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_print_locked_stages(repo_dir, dvc_repo, caplog):\n dvc_repo.add(\"foo\")\n dvc_repo.add(\"bar\")\n dvc_repo.lock_stage(\"foo.dvc\")\n\n caplog.clear()\n with caplog.at_level(logging.INFO, logger=\"dvc\"):\n assert main([\"pipeline\", \"show\", \"foo.dvc\", \"--locked\"]) == 0\n\n assert \"foo.dvc\" in caplog.text\n assert \"bar.dvc\" not in caplog.text\n\n\ndef test_dot_outs(repo_dir, dvc_repo):\n dvc_repo.add(repo_dir.FOO)\n dvc_repo.run(\n outs=[\"file\"],\n deps=[repo_dir.FOO, repo_dir.CODE],\n cmd=\"python {} {} {}\".format(repo_dir.CODE, repo_dir.FOO, \"file\"),\n )\n assert main([\"pipeline\", \"show\", \"--dot\", \"file.dvc\", \"--outs\"]) == 0\n\n\nclass TestPipelineShowOuts(TestRepro):\n def setUp(self):\n super(TestPipelineShowOuts, self).setUp()\n\n def test_outs(self):\n ret = main([\"pipeline\", \"show\", self.file1_stage, \"--outs\"])\n self.assertEqual(ret, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_TestPipelineShowDeep_TestPipelineShowDeep.test_dot_outs.self_assertEqual_ret_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_pipeline.py_TestPipelineShowDeep_TestPipelineShowDeep.test_dot_outs.self_assertEqual_ret_0_", "embedding": null, "metadata": {"file_path": "tests/func/test_pipeline.py", "file_name": "test_pipeline.py", "file_type": "text/x-python", "category": "test", "start_line": 133, "end_line": 172, "span_ids": ["TestPipelineShowDeep.test_dot", "TestPipelineShowDeep.test_dot_commands", "TestPipelineShowDeep.test_outs", "TestPipelineShowDeep.test_ascii_commands", "TestPipelineShowDeep.test_ascii_outs", "TestPipelineShowDeep.test_dot_outs", "TestPipelineShowDeep", "TestPipelineShowDeep.test_ascii", "TestPipelineShowDeep.test", "TestPipelineShowDeep.test_commands"], "tokens": 323}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestPipelineShowDeep(TestReproChangedDeepData):\n def test(self):\n ret = main([\"pipeline\", \"show\", self.file1_stage])\n self.assertEqual(ret, 0)\n\n def test_commands(self):\n ret = main([\"pipeline\", \"show\", self.file1_stage, \"--commands\"])\n self.assertEqual(ret, 0)\n\n def test_outs(self):\n ret = main([\"pipeline\", \"show\", self.file1_stage, \"--outs\"])\n self.assertEqual(ret, 0)\n\n def test_ascii(self):\n ret = main([\"pipeline\", \"show\", \"--ascii\", self.file1_stage])\n self.assertEqual(ret, 0)\n\n def test_dot(self):\n ret = main([\"pipeline\", \"show\", \"--dot\", self.file1_stage])\n self.assertEqual(ret, 0)\n\n def test_ascii_commands(self):\n ret = main(\n [\"pipeline\", \"show\", \"--ascii\", self.file1_stage, \"--commands\"]\n )\n self.assertEqual(ret, 0)\n\n def test_ascii_outs(self):\n ret = main([\"pipeline\", \"show\", \"--ascii\", self.file1_stage, \"--outs\"])\n self.assertEqual(ret, 0)\n\n def test_dot_commands(self):\n ret = main(\n [\"pipeline\", \"show\", \"--dot\", self.file1_stage, \"--commands\"]\n )\n self.assertEqual(ret, 0)\n\n def test_dot_outs(self):\n ret = main([\"pipeline\", \"show\", \"--dot\", self.file1_stage, \"--outs\"])\n self.assertEqual(ret, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproShell_TestReproShell.test.None_2.self_assertEqual_os_geten": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproShell_TestReproShell.test.None_2.self_assertEqual_os_geten", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1222, "end_line": 1242, "span_ids": ["TestReproShell.test", "TestReproShell"], "tokens": 132}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproShell(TestDvc):\n def test(self):\n if os.name == \"nt\":\n return\n\n fname = \"shell.txt\"\n stage = fname + \".dvc\"\n\n self.dvc.run(\n fname=stage, outs=[fname], cmd=\"echo $SHELL > {}\".format(fname)\n )\n\n with open(fname, \"r\") as fd:\n self.assertEqual(os.getenv(\"SHELL\"), fd.read().strip())\n\n os.unlink(fname)\n\n self.dvc.reproduce(stage)\n\n with open(fname, \"r\") as fd:\n self.assertEqual(os.getenv(\"SHELL\"), fd.read().strip())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestRunEmpty_TestRunNoExec.test.self_assertFalse_os_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestRunEmpty_TestRunNoExec.test.self_assertFalse_os_path_", "embedding": null, "metadata": {"file_path": "tests/func/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 73, "end_line": 117, "span_ids": ["TestRunMissingDep.test", "TestRunNoExec.test", "TestRunBadStageFilename.test", "TestRunMissingDep", "TestRunEmpty", "TestRunNoExec", "TestRunEmpty.test", "TestRunBadStageFilename"], "tokens": 243}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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 )\n\n\nclass 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=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/func/test_run.py_test_keyboard_interrupt_test_keyboard_interrupt.assert_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_test_keyboard_interrupt_test_keyboard_interrupt.assert_", "embedding": null, "metadata": {"file_path": "tests/func/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 275, "end_line": 300, "span_ids": ["test_keyboard_interrupt"], "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": "@pytest.mark.skipif(\n not isinstance(threading.current_thread(), threading._MainThread),\n reason=\"Not running in the main thread.\",\n)\n@mock.patch.object(subprocess.Popen, \"wait\", new=KeyboardInterrupt)\ndef test_keyboard_interrupt(repo_dir, dvc_repo):\n assert (\n main(\n [\n \"run\",\n \"-d\",\n repo_dir.FOO,\n \"-d\",\n repo_dir.CODE,\n \"-o\",\n \"out\",\n \"-f\",\n \"out.dvc\",\n \"python\",\n repo_dir.CODE,\n repo_dir.FOO,\n \"out\",\n ]\n )\n == 1\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_test_keyboard_interrupt_after_second_signal_call_test_keyboard_interrupt_after_second_signal_call.assert_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_test_keyboard_interrupt_after_second_signal_call_test_keyboard_interrupt_after_second_signal_call.assert_", "embedding": null, "metadata": {"file_path": "tests/func/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 303, "end_line": 332, "span_ids": ["test_keyboard_interrupt_after_second_signal_call"], "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": "@pytest.mark.skipif(\n not isinstance(threading.current_thread(), threading._MainThread),\n reason=\"Not running in the main thread.\",\n)\ndef test_keyboard_interrupt_after_second_signal_call(\n mocker, repo_dir, dvc_repo\n):\n mocker.patch.object(\n signal, \"signal\", side_effect=[None, KeyboardInterrupt]\n )\n assert (\n main(\n [\n \"run\",\n \"-d\",\n repo_dir.FOO,\n \"-d\",\n repo_dir.CODE,\n \"-o\",\n \"out\",\n \"-f\",\n \"out.dvc\",\n \"python\",\n repo_dir.CODE,\n repo_dir.FOO,\n \"out\",\n ]\n )\n == 252\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestPersistentOutput_TestPersistentOutput.test_ignore_build_cache.with_open_greetings_r.assert_hello_nhello_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_TestPersistentOutput_TestPersistentOutput.test_ignore_build_cache.with_open_greetings_r.assert_hello_nhello_n_", "embedding": null, "metadata": {"file_path": "tests/func/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 965, "end_line": 992, "span_ids": ["TestPersistentOutput", "TestPersistentOutput.test_ignore_build_cache"], "tokens": 206}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestPersistentOutput(TestDvc):\n def test_ignore_build_cache(self):\n warning = \"Build cache is ignored when persisting outputs.\"\n\n with open(\"immutable\", \"w\") as fobj:\n fobj.write(\"1\")\n\n cmd = [\n \"run\",\n \"--overwrite-dvcfile\",\n \"--deps\",\n \"immutable\",\n \"--outs-persist\",\n \"greetings\",\n \"echo hello>>greetings\",\n ]\n\n with self._caplog.at_level(logging.WARNING, logger=\"dvc\"):\n assert main(cmd) == 0\n assert warning not in self._caplog.text\n\n assert main(cmd) == 0\n assert warning in self._caplog.text\n\n # Even if the \"immutable\" dependency didn't change\n # it should run the command again, as it is \"ignoring build cache\"\n with open(\"greetings\", \"r\") as fobj:\n assert \"hello\\nhello\\n\" == fobj.read()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_test_bad_stage_fname_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_run.py_test_bad_stage_fname_", "embedding": null, "metadata": {"file_path": "tests/func/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 995, "end_line": 1007, "span_ids": ["test_bad_stage_fname"], "tokens": 115}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_bad_stage_fname(repo_dir, dvc_repo):\n dvc_repo.add(repo_dir.FOO)\n with pytest.raises(StageFileBadNameError):\n dvc_repo.run(\n cmd=\"python {} {} {}\".format(repo_dir.CODE, repo_dir.FOO, \"out\"),\n deps=[repo_dir.FOO, repo_dir.CODE],\n outs=[\"out\"],\n fname=\"out_stage\", # Bad name, should end with .dvc\n )\n\n # Check that command hasn't been run\n assert not os.path.exists(\"out\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_state.py_os_test_state.with_state_.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_state.py_os_test_state.with_state_.None_2", "embedding": null, "metadata": {"file_path": "tests/func/test_state.py", "file_name": "test_state.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 35, "span_ids": ["imports", "test_state"], "tokens": 216}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\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.path_info import PathInfo\n\n\ndef test_state(dvc_repo, repo_dir):\n path = os.path.join(dvc_repo.root_dir, repo_dir.FOO)\n path_info = PathInfo(path)\n md5 = file_md5(path)[0]\n\n state = State(dvc_repo, dvc_repo.config.config)\n\n with state:\n state.save(path_info, md5)\n entry_md5 = state.get(path_info)\n assert entry_md5 == md5\n\n os.unlink(path)\n with open(path, \"a\") as fd:\n fd.write(\"1\")\n\n entry_md5 = state.get(path_info)\n assert entry_md5 is None\n\n md5 = file_md5(path)[0]\n state.save(path_info, md5)\n\n entry_md5 = state.get(path_info)\n assert entry_md5 == md5", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_state.py_test_state_overflow_mock_get_inode.return.get_inode_mocked": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_state.py_test_state_overflow_mock_get_inode.return.get_inode_mocked", "embedding": null, "metadata": {"file_path": "tests/func/test_state.py", "file_name": "test_state.py", "file_type": "text/x-python", "category": "test", "start_line": 38, "end_line": 58, "span_ids": ["test_state_overflow", "mock_get_inode"], "tokens": 145}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_state_overflow(dvc_repo):\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 assert 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 assert ret == 0\n\n\ndef mock_get_inode(inode):\n def get_inode_mocked(path):\n return inode\n\n return get_inode_mocked", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_state.py_test_get_state_record_for_inode_test_get_state_record_for_inode.with_state_.assert_ret_is_not_None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_state.py_test_get_state_record_for_inode_test_get_state_record_for_inode.with_state_.assert_ret_is_not_None", "embedding": null, "metadata": {"file_path": "tests/func/test_state.py", "file_name": "test_state.py", "file_type": "text/x-python", "category": "test", "start_line": 61, "end_line": 74, "span_ids": ["test_get_state_record_for_inode"], "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": "@mock.patch(\"dvc.state.get_inode\", autospec=True)\ndef test_get_state_record_for_inode(get_inode_mock, dvc_repo, repo_dir):\n state = State(dvc_repo, dvc_repo.config.config)\n inode = state.MAX_INT + 2\n assert inode != state._to_sqlite(inode)\n\n path = os.path.join(dvc_repo.root_dir, repo_dir.FOO)\n md5 = file_md5(path)[0]\n get_inode_mock.side_effect = mock_get_inode(inode)\n\n with state:\n state.save(PathInfo(path), md5)\n ret = state.get_state_record_for_inode(inode)\n assert ret is not None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_state.py_test_remove_unused_links_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_state.py_test_remove_unused_links_", "embedding": null, "metadata": {"file_path": "tests/func/test_state.py", "file_name": "test_state.py", "file_type": "text/x-python", "category": "test", "start_line": 77, "end_line": 93, "span_ids": ["test_remove_unused_links"], "tokens": 140}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_remove_unused_links(repo_dir, dvc_repo):\n stages = dvc_repo.add(repo_dir.FOO)\n assert len(stages) == 1\n\n stages = dvc_repo.add(repo_dir.BAR)\n assert len(stages) == 1\n\n cmd_count_links = \"SELECT count(*) FROM {}\".format(State.LINK_STATE_TABLE)\n with dvc_repo.state:\n result = dvc_repo.state._execute(cmd_count_links).fetchone()[0]\n assert result == 2\n\n dvc_repo.state.remove_unused_links([])\n\n result = dvc_repo.state._execute(cmd_count_links).fetchone()[0]\n assert result == 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_get.py_from_dvc_cli_import_parse_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_get.py_from_dvc_cli_import_parse_", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_get.py", "file_name": "test_get.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 17, "span_ids": ["imports", "test_get"], "tokens": 117}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.cli import parse_args\nfrom dvc.command.get import CmdGet\n\n\ndef test_get(mocker):\n cli_args = parse_args(\n [\"get\", \"repo_url\", \"src\", \"--out\", \"out\", \"--rev\", \"version\"]\n )\n assert cli_args.func == CmdGet\n\n cmd = cli_args.func(cli_args)\n m = mocker.patch(\"dvc.repo.Repo.get\")\n\n assert cmd.run() == 0\n\n m.assert_called_once_with(\"repo_url\", path=\"src\", out=\"out\", rev=\"version\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_get_url.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_get_url.py__", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_get_url.py", "file_name": "test_get_url.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 15, "span_ids": ["imports", "test_get_url"], "tokens": 97}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.cli import parse_args\nfrom dvc.command.get_url import CmdGetUrl\n\n\ndef test_get_url(mocker):\n cli_args = parse_args([\"get-url\", \"src\", \"out\"])\n assert cli_args.func == CmdGetUrl\n\n cmd = cli_args.func(cli_args)\n m = mocker.patch(\"dvc.repo.Repo.get_url\")\n\n assert cmd.run() == 0\n\n m.assert_called_once_with(\"src\", out=\"out\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_imp.py_from_dvc_cli_import_parse_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_imp.py_from_dvc_cli_import_parse_", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_imp.py", "file_name": "test_imp.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 17, "span_ids": ["imports", "test_import"], "tokens": 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": "from dvc.cli import parse_args\nfrom dvc.command.imp import CmdImport\n\n\ndef test_import(mocker, dvc_repo):\n cli_args = parse_args(\n [\"import\", \"repo_url\", \"src\", \"--out\", \"out\", \"--rev\", \"version\"]\n )\n assert cli_args.func == CmdImport\n\n cmd = cli_args.func(cli_args)\n m = mocker.patch.object(cmd.repo, \"imp\", autospec=True)\n\n assert cmd.run() == 0\n\n m.assert_called_once_with(\"repo_url\", path=\"src\", out=\"out\", rev=\"version\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_imp_url.py_from_dvc_cli_import_parse_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_imp_url.py_from_dvc_cli_import_parse_", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_imp_url.py", "file_name": "test_imp_url.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 17, "span_ids": ["imports", "test_import_url"], "tokens": 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": "from dvc.cli import parse_args\nfrom dvc.command.imp_url import CmdImportUrl\n\n\ndef test_import_url(mocker, dvc_repo):\n cli_args = parse_args(\n [\"import-url\", \"src\", \"out\", \"--resume\", \"--file\", \"file\"]\n )\n assert cli_args.func == CmdImportUrl\n\n cmd = cli_args.func(cli_args)\n m = mocker.patch.object(cmd.repo, \"imp_url\", autospec=True)\n\n assert cmd.run() == 0\n\n m.assert_called_once_with(\"src\", out=\"out\", resume=True, fname=\"file\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_run.py_from_dvc_cli_import_parse_test_run.m_assert_called_once_with": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_run.py_from_dvc_cli_import_parse_test_run.m_assert_called_once_with", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 62, "span_ids": ["imports", "test_run"], "tokens": 337}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.cli import parse_args\nfrom dvc.command.run import CmdRun\n\n\ndef test_run(mocker, dvc_repo):\n cli_args = parse_args(\n [\n \"run\",\n \"--deps\",\n \"deps\",\n \"--outs\",\n \"outs\",\n \"--outs-no-cache\",\n \"outs-no-cache\",\n \"--metrics\",\n \"metrics\",\n \"--metrics-no-cache\",\n \"metrics-no-cache\",\n \"--file\",\n \"file\",\n \"--cwd\",\n \"cwd\",\n \"--wdir\",\n \"wdir\",\n \"--no-exec\",\n \"--yes\",\n \"--overwrite-dvcfile\",\n \"--ignore-build-cache\",\n \"--remove-outs\",\n \"--no-commit\",\n \"--outs-persist\",\n \"outs-persist\",\n \"--outs-persist-no-cache\",\n \"outs-persist-no-cache\",\n \"command\",\n ]\n )\n assert cli_args.func == CmdRun\n\n cmd = cli_args.func(cli_args)\n m = mocker.patch.object(cmd.repo, \"run\", autospec=True)\n\n assert cmd.run() == 0\n\n m.assert_called_once_with(\n deps=[\"deps\"],\n outs=[\"outs\"],\n outs_no_cache=[\"outs-no-cache\"],\n metrics=[\"metrics\"],\n metrics_no_cache=[\"metrics-no-cache\"],\n outs_persist=[\"outs-persist\"],\n outs_persist_no_cache=[\"outs-persist-no-cache\"],\n fname=\"file\",\n cwd=\"cwd\",\n wdir=\"wdir\",\n no_exec=True,\n overwrite=True,\n ignore_build_cache=True,\n remove_outs=True,\n no_commit=True,\n cmd=\"command\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_run.py_test_run_args_from_cli_test_run_args_from_cli.m_assert_called_once_with": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_run.py_test_run_args_from_cli_test_run_args_from_cli.m_assert_called_once_with", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 65, "end_line": 87, "span_ids": ["test_run_args_from_cli"], "tokens": 151}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_run_args_from_cli(mocker, dvc_repo):\n args = parse_args([\"run\", \"echo\", \"foo\"])\n cmd = args.func(args)\n m = mocker.patch.object(cmd.repo, \"run\", autospec=True)\n assert cmd.run() == 0\n m.assert_called_once_with(\n deps=[],\n outs=[],\n outs_no_cache=[],\n metrics=[],\n metrics_no_cache=[],\n outs_persist=[],\n outs_persist_no_cache=[],\n 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 cmd=\"echo 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/unit/command/test_run.py_test_run_args_with_spaces_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_run.py_test_run_args_with_spaces_", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 90, "end_line": 113, "span_ids": ["test_run_args_with_spaces"], "tokens": 154}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_run_args_with_spaces(mocker, dvc_repo):\n args = parse_args([\"run\", \"echo\", \"foo bar\"])\n cmd = args.func(args)\n m = mocker.patch.object(cmd.repo, \"run\", autospec=True)\n assert cmd.run() == 0\n m.assert_called_once_with(\n deps=[],\n outs=[],\n outs_no_cache=[],\n metrics=[],\n metrics_no_cache=[],\n outs_persist=[],\n outs_persist_no_cache=[],\n 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 cmd='echo \"foo bar\"',\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_test_get_parent_dirs_up_to_test_get_parent_dirs_up_to.assert_set_result_set": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_test_get_parent_dirs_up_to_test_get_parent_dirs_up_to.assert_set_result_set", "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": 117, "end_line": 139, "span_ids": ["test_get_parent_dirs_up_to"], "tokens": 168}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\n \"path1, path2, expected_dirs\",\n [\n (\n os.path.join(os.sep, \"non\", \"matching\", \"path\"),\n os.path.join(os.sep, \"other\", \"path\"),\n [],\n ),\n (\n os.path.join(os.sep, \"some\", \"long\", \"path\"),\n os.path.join(os.sep, \"some\"),\n [\n os.path.join(os.sep, \"some\"),\n os.path.join(os.sep, \"some\", \"long\"),\n os.path.join(os.sep, \"some\", \"long\", \"path\"),\n ],\n ),\n ],\n)\ndef test_get_parent_dirs_up_to(path1, path2, expected_dirs):\n result = get_parent_dirs_up_to(path1, path2)\n\n assert set(result) == set(expected_dirs)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_test_relpath_windows_different_drives_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_fs.py_test_relpath_windows_different_drives_", "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": 142, "end_line": 152, "span_ids": ["test_relpath_windows_different_drives"], "tokens": 120}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(os.name != \"nt\", reason=\"Windows specific\")\ndef test_relpath_windows_different_drives():\n path1 = os.path.join(\"A:\", os.sep, \"some\", \"path\")\n path2 = os.path.join(\"B:\", os.sep, \"other\", \"path\")\n assert relpath(path1, path2) == path1\n\n info1, info2 = PathInfo(path1), PathInfo(path2)\n rel_info = relpath(info1, info2)\n assert isinstance(rel_info, str)\n assert rel_info == path1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_utils.py_pytest_test_to_chunks_chunk_size.assert_result_expected": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_utils.py_pytest_test_to_chunks_chunk_size.assert_result_expected", "embedding": null, "metadata": {"file_path": "tests/unit/utils/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 13, "span_ids": ["imports", "test_to_chunks_chunk_size"], "tokens": 124}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\n\nfrom dvc.utils import to_chunks\n\n\n@pytest.mark.parametrize(\n \"chunk_size, expected_chunks\",\n [(1, [[1], [2], [3], [4]]), (2, [[1, 2], [3, 4]]), (3, [[1, 2, 3], [4]])],\n)\ndef test_to_chunks_chunk_size(chunk_size, expected_chunks):\n list_to_chunk = [1, 2, 3, 4]\n result = list(to_chunks(list_to_chunk, chunk_size=chunk_size))\n assert result == expected_chunks", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_utils.py_test_to_chunks_should_raise_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/utils/test_utils.py_test_to_chunks_should_raise_", "embedding": null, "metadata": {"file_path": "tests/unit/utils/test_utils.py", "file_name": "test_utils.py", "file_type": "text/x-python", "category": "test", "start_line": 16, "end_line": 31, "span_ids": ["test_to_chunks_num_chunks", "test_to_chunks_should_raise"], "tokens": 177}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.parametrize(\"num_chunks, chunk_size\", [(1, 2), (None, None)])\ndef test_to_chunks_should_raise(num_chunks, chunk_size):\n list_to_chunk = [1, 2, 3]\n with pytest.raises(ValueError):\n to_chunks(list_to_chunk, num_chunks, chunk_size)\n\n\n@pytest.mark.parametrize(\n \"num_chunks, expected_chunks\",\n [(4, [[1], [2], [3], [4]]), (3, [[1, 2], [3, 4]]), (2, [[1, 2], [3, 4]])],\n)\ndef test_to_chunks_num_chunks(num_chunks, expected_chunks):\n list_to_chunk = [1, 2, 3, 4]\n result = to_chunks(list_to_chunk, num_chunks=num_chunks)\n assert result == expected_chunks", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/update.py_from___future___import_un_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/command/update.py_from___future___import_un_", "embedding": null, "metadata": {"file_path": "dvc/command/update.py", "file_name": "update.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 38, "span_ids": ["imports", "CmdUpdate", "add_parser", "CmdUpdate.run"], "tokens": 213}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import unicode_literals\n\nimport argparse\nimport logging\n\nfrom dvc.exceptions import DvcException\nfrom dvc.command.base import CmdBase, append_doc_link\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdUpdate(CmdBase):\n def run(self):\n ret = 0\n for target in self.args.targets:\n try:\n self.repo.update(target)\n except DvcException:\n logger.exception(\"failed to update '{}'.\".format(target))\n ret = 1\n return ret\n\n\ndef add_parser(subparsers, parent_parser):\n UPDATE_HELP = \"Update dependencies and reproduce specified DVC-files.\"\n update_parser = subparsers.add_parser(\n \"update\",\n parents=[parent_parser],\n description=append_doc_link(UPDATE_HELP, \"update\"),\n help=UPDATE_HELP,\n formatter_class=argparse.RawDescriptionHelpFormatter,\n )\n update_parser.add_argument(\n \"targets\", nargs=\"+\", help=\"DVC-files to update.\"\n )\n update_parser.set_defaults(func=CmdUpdate)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py__clone_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/external_repo.py__clone_", "embedding": null, "metadata": {"file_path": "dvc/external_repo.py", "file_name": "external_repo.py", "file_type": "text/x-python", "category": "implementation", "start_line": 38, "end_line": 84, "span_ids": ["_clone", "external_repo", "_remove"], "tokens": 289}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _clone(url=None, rev=None, rev_lock=None, cache_dir=None):\n import git\n from dvc.repo import Repo\n\n _path = tempfile.mkdtemp(\"dvc-repo\")\n\n try:\n repo = git.Repo.clone_from(url, _path, no_single_branch=True)\n except git.exc.GitCommandError as exc:\n raise CloneError(url, _path, exc)\n\n try:\n revision = rev_lock or rev\n if revision:\n try:\n repo.git.checkout(revision)\n except git.exc.GitCommandError as exc:\n raise RevError(url, revision, exc)\n finally:\n repo.close()\n\n if cache_dir:\n repo = Repo(_path)\n cache_config = CacheConfig(repo.config)\n cache_config.set_dir(cache_dir, level=Config.LEVEL_LOCAL)\n repo.scm.git.close()\n\n return Repo(_path)\n\n\ndef _remove(repo):\n repo.scm.git.close()\n\n if os.name == \"nt\":\n # git.exe may hang for a while not permitting to remove temp dir\n os_retry = retry(5, errors=OSError, timeout=0.1)\n os_retry(remove)(repo.root_dir)\n else:\n remove(repo.root_dir)\n\n\n@contextmanager\ndef external_repo(**kwargs):\n repo = _clone(**kwargs)\n yield repo\n _remove(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/path_info.py_PathInfo_PathInfo.if_is_py2_.as_posix.return.str_self_replace_f_sep_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_PathInfo_PathInfo.if_is_py2_.as_posix.return.str_self_replace_f_sep_", "embedding": null, "metadata": {"file_path": "dvc/path_info.py", "file_name": "path_info.py", "file_type": "text/x-python", "category": "implementation", "start_line": 22, "end_line": 99, "span_ids": ["PathInfo:7", "PathInfo.from_posix", "PathInfo.__str__", "PathInfo.__repr__", "PathInfo.fspath", "PathInfo.isin", "PathInfo:9", "PathInfo.__fspath__", "PathInfo.__new__", "PathInfo", "PathInfo.relpath"], "tokens": 603}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PathInfo(pathlib.PurePath):\n # Use __slots__ in PathInfo objects following PurePath implementation.\n # This makes objects smaller and speeds up attribute access.\n # We don't add any fields so it's empty.\n __slots__ = ()\n scheme = \"local\"\n\n def __new__(cls, *args):\n # Construct a proper subclass depending on current os\n if cls is PathInfo:\n cls = WindowsPathInfo if os.name == \"nt\" else PosixPathInfo\n return cls._from_parts(args)\n\n @classmethod\n def from_posix(cls, s):\n return cls(PosixPathInfo(s))\n\n def __str__(self):\n path = self.__fspath__()\n return relpath(path)\n\n def __repr__(self):\n return builtin_str(\"{}: '{}'\").format(type(self).__name__, self)\n\n # This permits passing it to file utils directly in Python 3.6+\n # With Python 2.7, Python 3.5+ we are stuck with path_info.fspath for now\n def __fspath__(self):\n return pathlib.PurePath.__str__(self)\n\n @property\n def fspath(self):\n return self.__fspath__()\n\n url = fspath\n\n def relpath(self, other):\n return self.__class__(relpath(self, other))\n\n def isin(self, other):\n if isinstance(other, basestring):\n other = self.__class__(other)\n elif self.__class__ != other.__class__:\n return False\n # Use cached casefolded parts to compare paths\n n = len(other._cparts)\n return len(self._cparts) > n and self._cparts[:n] == other._cparts\n\n # pathlib2 uses bytes internally in Python 2, and we use unicode everywhere\n # for paths in both pythons, thus we need this glue.\n if is_py2:\n __unicode__ = __str__\n\n def __str__(self):\n return self.__unicode__().encode(sys.getfilesystemencoding())\n\n @classmethod\n def _parse_args(cls, args):\n args = [\n a.encode(fs_encoding)\n if isinstance(a, unicode) # noqa: F821\n else a\n for a in args\n ]\n return super(PathInfo, cls)._parse_args(args)\n\n @property\n def name(self):\n return super(PathInfo, self).name.decode(fs_encoding)\n\n def __fspath__(self): # noqa: F811\n return pathlib.PurePath.__str__(self).decode(fs_encoding)\n\n def with_name(self, name):\n return pathlib.PurePath.with_name(self, name.encode(fs_encoding))\n\n def as_posix(self):\n f = self._flavour\n return str(self).replace(f.sep, \"/\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_WindowsPathInfo__URLPathParents.__repr__.return._parents_format_sel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/path_info.py_WindowsPathInfo__URLPathParents.__repr__.return._parents_format_sel", "embedding": null, "metadata": {"file_path": "dvc/path_info.py", "file_name": "path_info.py", "file_type": "text/x-python", "category": "implementation", "start_line": 102, "end_line": 128, "span_ids": ["_URLPathParents.__getitem__", "_URLPathParents", "_URLPathParents.__repr__", "WindowsPathInfo", "PosixPathInfo", "_URLPathParents.__len__", "_URLPathParents.__init__"], "tokens": 170}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class WindowsPathInfo(PathInfo, pathlib.PureWindowsPath):\n pass\n\n\nclass PosixPathInfo(PathInfo, pathlib.PurePosixPath):\n pass\n\n\nclass _URLPathParents(object):\n def __init__(self, pathcls, scheme, netloc, path):\n self._scheme = scheme\n self._netloc = netloc\n self._parents = path.parents\n self._pathcls = pathcls\n\n def __len__(self):\n return len(self._parents)\n\n def __getitem__(self, idx):\n return self._pathcls.from_parts(\n scheme=self._scheme,\n netloc=self._netloc,\n path=self._parents[idx].fspath,\n )\n\n def __repr__(self):\n return \"<{}.parents>\".format(self._pathcls.__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_RemoteBASE._collect_dir_RemoteBASE._collect_dir.return.sorted_dir_info_values_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/remote/base.py_RemoteBASE._collect_dir_RemoteBASE._collect_dir.return.sorted_dir_info_values_", "embedding": null, "metadata": {"file_path": "dvc/remote/base.py", "file_name": "base.py", "file_type": "text/x-python", "category": "implementation", "start_line": 144, "end_line": 184, "span_ids": ["RemoteBASE._collect_dir"], "tokens": 344}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RemoteBASE(object):\n\n def _collect_dir(self, path_info):\n dir_info = {}\n\n with ThreadPoolExecutor(max_workers=self.checksum_jobs) as executor:\n for root, _dirs, files in self.walk(path_info):\n root_info = path_info / root\n\n for fname in files:\n file_info = root_info / fname\n relative_path = file_info.relative_to(path_info)\n checksum = executor.submit(\n self.get_file_checksum, file_info\n )\n dir_info[checksum] = {\n # NOTE: this is lossy transformation:\n # \"hey\\there\" -> \"hey/there\"\n # \"hey/there\" -> \"hey/there\"\n # The latter is fine filename on Windows, which\n # will transform to dir/file on back transform.\n #\n # Yes, this is a BUG, as long as we permit \"/\" in\n # filenames on Windows and \"\\\" on Unix\n self.PARAM_RELPATH: relative_path.as_posix()\n }\n\n checksums = as_completed(dir_info)\n if len(dir_info) > LARGE_DIR_SIZE:\n msg = (\n \"Computing md5 for a large number of files. \"\n \"This is only done once.\"\n )\n logger.info(msg)\n checksums = progress(checksums, total=len(dir_info))\n\n # NOTE: resolving futures\n for checksum in checksums:\n entry = dir_info[checksum]\n entry[self.PARAM_CHECKSUM] = checksum.result()\n\n # NOTE: sorting the list by path to ensure reproducibility\n return sorted(dir_info.values(), key=itemgetter(self.PARAM_RELPATH))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/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": 143, "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": 972}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_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 logging\n\nfrom itertools import chain\n\nfrom dvc.config import Config\nfrom dvc.exceptions import (\n NotDvcRepoError,\n OutputNotFoundError,\n TargetNotDirectoryError,\n OutputFileMissingError,\n)\nfrom dvc.ignore import DvcIgnoreFileHandler\nfrom dvc.path_info import PathInfo\nfrom dvc.utils.compat import open as _open, fspath_py35\nfrom dvc.utils import relpath\n\nlogger = logging.getLogger(__name__)\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.imp_url import imp_url\n from dvc.repo.reproduce import reproduce\n from dvc.repo.checkout import checkout\n from dvc.repo.push import push\n from dvc.repo.fetch import fetch\n from dvc.repo.pull import pull\n from dvc.repo.status import status\n from dvc.repo.gc import gc\n from dvc.repo.commit import commit\n from dvc.repo.diff import diff\n from dvc.repo.brancher import brancher\n from dvc.repo.get import get\n from dvc.repo.get_url import get_url\n from dvc.repo.update import update\n\n def __init__(self, root_dir=None):\n from dvc.state import State\n from dvc.lock import Lock\n from dvc.scm import SCM\n from dvc.cache import Cache\n from dvc.data_cloud import DataCloud\n from dvc.repo.metrics import Metrics\n from dvc.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.scm = SCM(self.root_dir, repo=self)\n\n self.tree = WorkingTree(self.root_dir)\n\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 level = core.get(Config.SECTION_CORE_LOGLEVEL)\n if level:\n logger.setLevel(level.upper())\n\n self.cache = Cache(self)\n self.cloud = DataCloud(self)\n\n self.metrics = Metrics(self)\n self.tag = Tag(self)\n\n self._ignore()\n\n def __repr__(self):\n return \"Repo: '{root_dir}'\".format(root_dir=self.root_dir)\n\n @classmethod\n def find_root(cls, 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, cls.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 @classmethod\n def find_dvc_dir(cls, root=None):\n root_dir = cls.find_root(root)\n return os.path.join(root_dir, cls.DVC_DIR)\n\n @staticmethod\n def init(root_dir=os.curdir, no_scm=False, force=False):\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 return self.cache.local.unprotect(PathInfo(target))\n\n def _ignore(self):\n from dvc.updater import Updater\n\n updater = Updater(self.dvc_dir)\n\n flist = [\n self.state.state_file,\n self.lock.lock_file,\n self.config.config_local_file,\n updater.updater_file,\n 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": 145, "end_line": 178, "span_ids": ["Repo._get_pipeline", "Repo._check_cyclic_graph", "Repo.collect"], "tokens": 223}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class 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 and os.path.isdir(target)):\n return self.active_stages(target)\n\n stage = Stage.load(self, target)\n if not with_deps:\n return [stage]\n\n node = 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.find_out_by_relpath_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/__init__.py_Repo.find_out_by_relpath_", "embedding": null, "metadata": {"file_path": "dvc/repo/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 443, "end_line": 470, "span_ids": ["Repo.is_dvc_internal", "Repo.open", "Repo.find_out_by_relpath"], "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": "class Repo(object):\n\n def find_out_by_relpath(self, relpath):\n path = os.path.join(self.root_dir, relpath)\n out, = self.find_outs_by_path(path)\n return out\n\n def is_dvc_internal(self, path):\n path_parts = os.path.normpath(path).split(os.path.sep)\n return self.DVC_DIR in path_parts\n\n def open(self, path, remote=None, mode=\"r\", encoding=None):\n \"\"\"Opens a specified resource as a file descriptor\"\"\"\n out, = self.find_outs_by_path(path)\n if out.isdir():\n raise ValueError(\"Can't open a dir\")\n\n cache_file = self.cache.local.checksum_to_path_info(out.checksum)\n cache_file = fspath_py35(cache_file)\n\n with self.state:\n cache_info = out.get_used_cache(remote=remote)\n self.cloud.pull(cache_info, remote=remote)\n\n # Since pull may just skip with a warning, we need to check it here\n if not os.path.exists(cache_file):\n raise OutputFileMissingError(relpath(path, self.root_dir))\n\n return _open(cache_file, mode=mode, encoding=encoding)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/imp_url.py_from_dvc_utils_compat_imp_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/imp_url.py_from_dvc_utils_compat_imp_", "embedding": null, "metadata": {"file_path": "dvc/repo/imp_url.py", "file_name": "imp_url.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 36, "span_ids": ["imports", "imp_url"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.utils.compat import pathlib\nfrom dvc.repo.scm_context import scm_context\n\n\n@scm_context\ndef imp_url(\n self, url, out=None, resume=False, fname=None, erepo=None, locked=False\n):\n from dvc.stage import Stage\n\n out = out or pathlib.PurePath(url).name\n\n with self.state:\n stage = Stage.create(\n repo=self,\n cmd=None,\n deps=[url],\n outs=[out],\n fname=fname,\n erepo=erepo,\n )\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.locked = locked\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/update.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/dvc/repo/update.py__", "embedding": null, "metadata": {"file_path": "dvc/repo/update.py", "file_name": "update.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 10, "span_ids": ["update"], "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": "def update(self, target):\n from dvc.stage import Stage\n\n stage = Stage.load(self, target)\n with self.state:\n stage.update()\n stage.save()\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/stage.py_Stage.update_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.update_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": 337, "end_line": 388, "span_ids": ["Stage._stage_fname", "Stage.validate", "Stage.update", "Stage._check_stage_path"], "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": "class Stage(object):\n\n def update(self):\n if not self.is_repo_import:\n raise StageUpdateError(self.relpath)\n\n self.deps[0].update()\n locked = self.locked\n self.locked = False\n try:\n self.reproduce()\n finally:\n self.locked = locked\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, outs, add):\n if not outs:\n return cls.STAGE_FILE\n\n out = outs[0]\n fname = out.path_info.name + cls.STAGE_FILE_SUFFIX\n\n if (\n add\n and out.is_in_repo\n and not contains_symlink_up_to(out.fspath, out.repo.root_dir)\n ):\n fname = out.path_info.with_name(fname).fspath\n\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/tests/func/test_repro.py_TestReproDownstream_TestReproDownstream.test.assert_evaluation_2_relp": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_TestReproDownstream_TestReproDownstream.test.assert_evaluation_2_relp", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1591, "end_line": 1624, "span_ids": ["TestReproDownstream.test", "TestReproDownstream"], "tokens": 372}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestReproDownstream(TestDvc):\n def test(self):\n # The dependency graph should look like this:\n #\n # E\n # / \\\n # D F\n # / \\ \\\n # B C G\n # \\ /\n # A\n #\n assert main([\"run\", \"-o\", \"A\", \"echo A>A\"]) == 0\n assert main([\"run\", \"-d\", \"A\", \"-o\", \"B\", \"echo B>B\"]) == 0\n assert main([\"run\", \"-d\", \"A\", \"-o\", \"C\", \"echo C>C\"]) == 0\n assert main([\"run\", \"-d\", \"B\", \"-d\", \"C\", \"-o\", \"D\", \"echo D>D\"]) == 0\n assert main([\"run\", \"-o\", \"G\", \"echo G>G\"]) == 0\n assert main([\"run\", \"-d\", \"G\", \"-o\", \"F\", \"echo F>F\"]) == 0\n assert main([\"run\", \"-d\", \"D\", \"-d\", \"F\", \"-o\", \"E\", \"echo E>E\"]) == 0\n\n # We want the evaluation to move from B to E\n #\n # E\n # /\n # D\n # /\n # B\n #\n evaluation = self.dvc.reproduce(\"B.dvc\", downstream=True, force=True)\n\n assert len(evaluation) == 3\n assert evaluation[0].relpath == \"B.dvc\"\n assert evaluation[1].relpath == \"D.dvc\"\n assert evaluation[2].relpath == \"E.dvc\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_ssh_dir_out_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_repro.py_test_ssh_dir_out_", "embedding": null, "metadata": {"file_path": "tests/func/test_repro.py", "file_name": "test_repro.py", "file_type": "text/x-python", "category": "test", "start_line": 1627, "end_line": 1654, "span_ids": ["test_ssh_dir_out"], "tokens": 263}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_ssh_dir_out(dvc_repo):\n if not _should_test_ssh():\n pytest.skip()\n\n # Set up remote and cache\n remote_url = get_ssh_url()\n assert main([\"remote\", \"add\", \"upstream\", remote_url]) == 0\n\n cache_url = get_ssh_url()\n assert main([\"remote\", \"add\", \"sshcache\", cache_url]) == 0\n assert main([\"config\", \"cache.ssh\", \"sshcache\"]) == 0\n\n # Recreating to reread configs\n repo = DvcRepo(dvc_repo.root_dir)\n\n url_info = URLInfo(remote_url)\n mkdir_cmd = \"mkdir dir-out;cd dir-out;echo 1 > 1.txt; echo 2 > 2.txt\"\n repo.run(\n cmd=\"ssh {netloc} 'cd {path};{cmd}'\".format(\n netloc=url_info.netloc, path=url_info.path, cmd=mkdir_cmd\n ),\n outs=[(url_info / \"dir-out\").url],\n deps=[\"foo\"], # add a fake dep to not consider this a callback\n )\n\n repo.reproduce(\"dir-out.dvc\")\n repo.reproduce(\"dir-out.dvc\", force=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_update.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/func/test_update.py_os_", "embedding": null, "metadata": {"file_path": "tests/func/test_update.py", "file_name": "test_update.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 43, "span_ids": ["imports", "test_update_import"], "tokens": 262}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nfrom dvc.repo import Repo\n\n\ndef test_update_import(dvc_repo, erepo):\n src = \"version\"\n dst = src\n\n stage = dvc_repo.imp(erepo.root_dir, src, dst, rev=\"branch\")\n\n assert os.path.exists(dst)\n assert os.path.isfile(dst)\n with open(dst, \"r+\") as fobj:\n assert fobj.read() == \"branch\"\n\n # update data\n repo = Repo(erepo.root_dir)\n\n saved_dir = os.getcwd()\n os.chdir(erepo.root_dir)\n\n repo.scm.checkout(\"branch\")\n os.unlink(\"version\")\n erepo.create(\"version\", \"updated\")\n repo.add(\"version\")\n repo.scm.add([\".gitignore\", \"version.dvc\"])\n repo.scm.commit(\"updated\")\n repo.scm.checkout(\"master\")\n\n repo.scm.git.close()\n\n os.chdir(saved_dir)\n\n assert dvc_repo.status(stage.path) == {}\n dvc_repo.update(stage.path)\n assert dvc_repo.status(stage.path) == {}\n\n assert os.path.exists(dst)\n assert os.path.isfile(dst)\n with open(dst, \"r+\") as fobj:\n assert fobj.read() == \"updated\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_update.py_from_dvc_cli_import_parse_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/command/test_update.py_from_dvc_cli_import_parse_", "embedding": null, "metadata": {"file_path": "tests/unit/command/test_update.py", "file_name": "test_update.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 16, "span_ids": ["imports", "test_update"], "tokens": 112}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from dvc.cli import parse_args\nfrom dvc.command.update import CmdUpdate\n\n\ndef test_update(mocker):\n targets = [\"target1\", \"target2\", \"target3\"]\n cli_args = parse_args([\"update\"] + targets)\n assert cli_args.func == CmdUpdate\n cmd = cli_args.func(cli_args)\n m = mocker.patch(\"dvc.repo.Repo.update\")\n\n assert cmd.run() == 0\n\n calls = [mocker.call(target) for target in targets]\n m.assert_has_calls(calls)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_path_info.py_pytest_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_path_info.py_pytest_", "embedding": null, "metadata": {"file_path": "tests/unit/test_path_info.py", "file_name": "test_path_info.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 37, "span_ids": ["test_url_info_parent", "imports", "test_url_info_str", "test_url_info_eq", "test_url_info_parents"], "tokens": 298}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pytest\n\nfrom dvc.path_info import URLInfo, CloudURLInfo\n\n\n@pytest.mark.parametrize(\"cls\", [URLInfo, CloudURLInfo])\ndef test_url_info_str(cls):\n u = cls(\"ssh://user@test.com:/test1/\")\n assert u.url == \"ssh://user@test.com/test1/\"\n assert str(u) == u.url\n\n\n@pytest.mark.parametrize(\"cls\", [URLInfo, CloudURLInfo])\ndef test_url_info_eq(cls):\n u1 = cls(\"ssh://user@test.com:/test1/\")\n u2 = cls(\"ssh://user@test.com/test1\")\n assert u1 == u2\n\n\n@pytest.mark.parametrize(\"cls\", [URLInfo, CloudURLInfo])\ndef test_url_info_parent(cls):\n u1 = cls(\"ssh://user@test.com:/test1/test2\")\n p = u1.parent\n u3 = cls(\"ssh://user@test.com/test1\")\n assert u3 == p\n assert str(p) == \"ssh://user@test.com/test1\"\n\n\n@pytest.mark.parametrize(\"cls\", [URLInfo, CloudURLInfo])\ndef test_url_info_parents(cls):\n u1 = cls(\"ssh://user@test.com:/test1/test2/test3\")\n assert list(u1.parents) == [\n cls(\"ssh://user@test.com/test1/test2\"),\n cls(\"ssh://user@test.com/test1\"),\n cls(\"ssh://user@test.com/\"),\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_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_TestPathConversion_test_stage_fname.assert_fname_out_txt_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_stage.py_TestPathConversion_test_stage_fname.assert_fname_out_txt_", "embedding": null, "metadata": {"file_path": "tests/unit/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 57, "end_line": 73, "span_ids": ["TestPathConversion.test", "test_stage_fname", "TestPathConversion"], "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": "class TestPathConversion(TestCase):\n def test(self):\n import os\n\n stage = Stage(None, \"path\")\n\n stage.wdir = os.path.join(\"..\", \"..\")\n self.assertEqual(stage.dumpd()[\"wdir\"], \"../..\")\n\n\n@pytest.mark.parametrize(\"add\", [True, False])\ndef test_stage_fname(add):\n out = mock.Mock()\n out.is_in_repo = False\n out.path_info = PathInfo(\"path/to/out.txt\")\n fname = Stage._stage_fname([out], add)\n assert fname == \"out.txt.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/unit/test_stage.py_test_stage_update_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_iterative__dvc/tests/unit/test_stage.py_test_stage_update_", "embedding": null, "metadata": {"file_path": "tests/unit/test_stage.py", "file_name": "test_stage.py", "file_type": "text/x-python", "category": "test", "start_line": 76, "end_line": 93, "span_ids": ["test_stage_update"], "tokens": 132}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_stage_update(mocker):\n dep = DependencyREPO({\"url\": \"example.com\"}, None, None)\n mocker.patch.object(dep, \"update\", return_value=None)\n\n stage = Stage(None, \"path\", deps=[dep])\n reproduce = mocker.patch.object(stage, \"reproduce\")\n is_repo_import = mocker.patch(\n __name__ + \".Stage.is_repo_import\", new_callable=mocker.PropertyMock\n )\n\n is_repo_import.return_value = True\n stage.update()\n assert reproduce.called_once_with()\n\n is_repo_import.return_value = False\n with pytest.raises(StageUpdateError):\n stage.update()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}}}